From d4ea3c171c55e99c126c8440708726c3ac194c94 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Sat, 26 Jan 2019 13:18:24 -0800 Subject: [PATCH 01/82] start [ci skip] --- tools/acorn-optimizer.js | 24 + tools/node_modules/acorn-walk/CHANGELOG.md | 97 + tools/node_modules/acorn-walk/LICENSE | 19 + tools/node_modules/acorn-walk/README.md | 126 + tools/node_modules/acorn-walk/dist/walk.js | 456 ++ .../node_modules/acorn-walk/dist/walk.js.map | 1 + tools/node_modules/acorn-walk/dist/walk.mjs | 436 ++ .../node_modules/acorn-walk/dist/walk.mjs.map | 1 + tools/node_modules/acorn-walk/package.json | 80 + tools/node_modules/acorn/CHANGELOG.md | 462 ++ tools/node_modules/acorn/LICENSE | 19 + tools/node_modules/acorn/README.md | 269 + tools/node_modules/acorn/bin/acorn | 4 + tools/node_modules/acorn/dist/acorn.d.ts | 209 + tools/node_modules/acorn/dist/acorn.js | 5333 +++++++++++++++++ tools/node_modules/acorn/dist/acorn.js.map | 1 + tools/node_modules/acorn/dist/acorn.mjs | 5302 ++++++++++++++++ tools/node_modules/acorn/dist/acorn.mjs.map | 1 + tools/node_modules/acorn/dist/bin.js | 68 + tools/node_modules/acorn/package.json | 91 + tools/node_modules/astring/CHANGELOG.md | 6 + tools/node_modules/astring/LICENSE | 19 + tools/node_modules/astring/README.md | 266 + tools/node_modules/astring/bin/astring | 103 + tools/node_modules/astring/dist/astring.js | 1055 ++++ .../node_modules/astring/dist/astring.js.map | 1 + .../node_modules/astring/dist/astring.min.js | 3 + .../astring/dist/astring.min.js.map | 1 + .../node_modules/astring/docs/CONTRIBUTING.md | 17 + .../astring/docs/demo/astravel.min.js | 9 + .../astring/docs/demo/astring.min.js | 3 + .../astring/docs/demo/astring.min.js.map | 1 + .../node_modules/astring/docs/demo/index.html | 110 + .../node_modules/astring/docs/demo/style.css | 67 + tools/node_modules/astring/docs/index.html | 11 + tools/node_modules/astring/package.json | 123 + tools/node_modules/astring/src/astring.js | 1048 ++++ tools/node_modules/astring/src/sourcemaps.js | 51 + tools/shared.py | 9 +- 39 files changed, 15901 insertions(+), 1 deletion(-) create mode 100644 tools/acorn-optimizer.js create mode 100644 tools/node_modules/acorn-walk/CHANGELOG.md create mode 100644 tools/node_modules/acorn-walk/LICENSE create mode 100644 tools/node_modules/acorn-walk/README.md create mode 100644 tools/node_modules/acorn-walk/dist/walk.js create mode 100644 tools/node_modules/acorn-walk/dist/walk.js.map create mode 100644 tools/node_modules/acorn-walk/dist/walk.mjs create mode 100644 tools/node_modules/acorn-walk/dist/walk.mjs.map create mode 100644 tools/node_modules/acorn-walk/package.json create mode 100644 tools/node_modules/acorn/CHANGELOG.md create mode 100644 tools/node_modules/acorn/LICENSE create mode 100644 tools/node_modules/acorn/README.md create mode 100755 tools/node_modules/acorn/bin/acorn create mode 100644 tools/node_modules/acorn/dist/acorn.d.ts create mode 100644 tools/node_modules/acorn/dist/acorn.js create mode 100644 tools/node_modules/acorn/dist/acorn.js.map create mode 100644 tools/node_modules/acorn/dist/acorn.mjs create mode 100644 tools/node_modules/acorn/dist/acorn.mjs.map create mode 100644 tools/node_modules/acorn/dist/bin.js create mode 100644 tools/node_modules/acorn/package.json create mode 100644 tools/node_modules/astring/CHANGELOG.md create mode 100644 tools/node_modules/astring/LICENSE create mode 100644 tools/node_modules/astring/README.md create mode 100755 tools/node_modules/astring/bin/astring create mode 100644 tools/node_modules/astring/dist/astring.js create mode 100644 tools/node_modules/astring/dist/astring.js.map create mode 100644 tools/node_modules/astring/dist/astring.min.js create mode 100644 tools/node_modules/astring/dist/astring.min.js.map create mode 100644 tools/node_modules/astring/docs/CONTRIBUTING.md create mode 100644 tools/node_modules/astring/docs/demo/astravel.min.js create mode 100644 tools/node_modules/astring/docs/demo/astring.min.js create mode 100644 tools/node_modules/astring/docs/demo/astring.min.js.map create mode 100644 tools/node_modules/astring/docs/demo/index.html create mode 100644 tools/node_modules/astring/docs/demo/style.css create mode 100644 tools/node_modules/astring/docs/index.html create mode 100644 tools/node_modules/astring/package.json create mode 100644 tools/node_modules/astring/src/astring.js create mode 100644 tools/node_modules/astring/src/sourcemaps.js diff --git a/tools/acorn-optimizer.js b/tools/acorn-optimizer.js new file mode 100644 index 000000000000..00b4f4ac339d --- /dev/null +++ b/tools/acorn-optimizer.js @@ -0,0 +1,24 @@ +var acorn = require('acorn'); +var acorn_walk = require('acorn-walk'); +var astring = require('astring'); +var fs = require('fs'); +var path = require('path'); + +// Setup + +var print = function(x) { + process['stdout'].write(x + '\n'); +}; + +var printErr = function(x) { + process['stderr'].write(x + '\n'); +}; + +// Main + +var arguments = process['argv'].slice(2);; + +var ast = acorn.parse(code, { ecmaVersion: 6 }); +var code = astring.generate(ast); +print(code); + diff --git a/tools/node_modules/acorn-walk/CHANGELOG.md b/tools/node_modules/acorn-walk/CHANGELOG.md new file mode 100644 index 000000000000..525950b5183b --- /dev/null +++ b/tools/node_modules/acorn-walk/CHANGELOG.md @@ -0,0 +1,97 @@ +## 6.1.0 (2018-09-28) + +### New features + +The walker now walks `TemplateElement` nodes. + +## 6.0.1 (2018-09-14) + +### Bug fixes + +Fix bad "main" field in package.json. + +## 6.0.0 (2018-09-14) + +### Breaking changes + +This is now a separate package, `acorn-walk`, rather than part of the main `acorn` package. + +The `ScopeBody` and `ScopeExpression` meta-node-types are no longer supported. + +## 5.7.1 (2018-06-15) + +### Bug fixes + +Make sure the walker and bin files are rebuilt on release (the previous release didn't get the up-to-date versions). + +## 5.7.0 (2018-06-15) + +### Bug fixes + +Fix crash in walker when walking a binding-less catch node. + +## 5.6.2 (2018-06-05) + +### Bug fixes + +In the walker, go back to allowing the `baseVisitor` argument to be null to default to the default base everywhere. + +## 5.6.1 (2018-06-01) + +### Bug fixes + +Fix regression when passing `null` as fourth argument to `walk.recursive`. + +## 5.6.0 (2018-05-31) + +### Bug fixes + +Fix a bug in the walker that caused a crash when walking an object pattern spread. + +## 5.5.1 (2018-03-06) + +### Bug fixes + +Fix regression in walker causing property values in object patterns to be walked as expressions. + +## 5.5.0 (2018-02-27) + +### Bug fixes + +Support object spread in the AST walker. + +## 5.4.1 (2018-02-02) + +### Bug fixes + +5.4.0 somehow accidentally included an old version of walk.js. + +## 5.2.0 (2017-10-30) + +### Bug fixes + +The `full` and `fullAncestor` walkers no longer visit nodes multiple times. + +## 5.1.0 (2017-07-05) + +### New features + +New walker functions `full` and `fullAncestor`. + +## 3.2.0 (2016-06-07) + +### New features + +Make it possible to use `visit.ancestor` with a walk state. + +## 3.1.0 (2016-04-18) + +### New features + +The walker now allows defining handlers for `CatchClause` nodes. + +## 2.5.2 (2015-10-27) + +### Fixes + +Fix bug where the walker walked an exported `let` statement as an expression. diff --git a/tools/node_modules/acorn-walk/LICENSE b/tools/node_modules/acorn-walk/LICENSE new file mode 100644 index 000000000000..2c0632b6a7c6 --- /dev/null +++ b/tools/node_modules/acorn-walk/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2018 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/node_modules/acorn-walk/README.md b/tools/node_modules/acorn-walk/README.md new file mode 100644 index 000000000000..2b94bec31ecc --- /dev/null +++ b/tools/node_modules/acorn-walk/README.md @@ -0,0 +1,126 @@ +# Acorn AST walker + +An abstract syntax tree walker for the +[ESTree](https://github.com/estree/estree) format. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/acornjs/acorn/blob/master/LICENSE). + +You are welcome to +[report bugs](https://github.com/acornjs/acorn/issues) or create pull +requests on [github](https://github.com/acornjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.ternjs.net). + +## Installation + +The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): + +```sh +npm install acorn-walk +``` + +Alternately, you can download the source and build acorn yourself: + +```sh +git clone https://github.com/acornjs/acorn.git +cd acorn +npm install +``` + +## Interface + +An algorithm for recursing through a syntax tree is stored as an +object, with a property for each tree node type holding a function +that will recurse through such a node. There are several ways to run +such a walker. + +**simple**`(node, visitors, base, state)` does a 'simple' walk over a +tree. `node` should be the AST node to walk, and `visitors` an object +with properties whose names correspond to node types in the [ESTree +spec](https://github.com/estree/estree). The properties should contain +functions that will be called with the node object and, if applicable +the state at that point. The last two arguments are optional. `base` +is a walker algorithm, and `state` is a start state. The default +walker will simply visit all statements and expressions and not +produce a meaningful state. (An example of a use of state is to track +scope at each point in the tree.) + +```js +const acorn = require("acorn") +const walk = require("acorn-walk") + +walk.simple(acorn.parse("let x = 10"), { + Literal(node) { + console.log(`Found a literal: ${node.value}`) + } +}) +``` + +**ancestor**`(node, visitors, base, state)` does a 'simple' walk over +a tree, building up an array of ancestor nodes (including the current node) +and passing the array to the callbacks as a third parameter. + +```js +const acorn = require("acorn") +const walk = require("acorn-walk") + +walk.ancestor(acorn.parse("foo('hi')"), { + Literal(_, ancestors) { + console.log("This literal's ancestors are:", ancestors.map(n => n.type)) + } +}) +``` + +**recursive**`(node, state, functions, base)` does a 'recursive' +walk, where the walker functions are responsible for continuing the +walk on the child nodes of their target node. `state` is the start +state, and `functions` should contain an object that maps node types +to walker functions. Such functions are called with `(node, state, c)` +arguments, and can cause the walk to continue on a sub-node by calling +the `c` argument on it with `(node, state)` arguments. The optional +`base` argument provides the fallback walker functions for node types +that aren't handled in the `functions` object. If not given, the +default walkers will be used. + +**make**`(functions, base)` builds a new walker object by using the +walker functions in `functions` and filling in the missing ones by +taking defaults from `base`. + +**full**`(node, callback, base, state)` does a 'full' walk over a +tree, calling the callback with the arguments (node, state, type) for +each node + +**fullAncestor**`(node, callback, base, state)` does a 'full' walk +over a tree, building up an array of ancestor nodes (including the +current node) and passing the array to the callbacks as a third +parameter. + +```js +const acorn = require("acorn") +const walk = require("acorn-walk") + +walk.full(acorn.parse("1 + 1"), node => { + console.log(`There's a ${node.type} node at ${node.ch}`) +}) +``` + +**findNodeAt**`(node, start, end, test, base, state)` tries to locate +a node in a tree at the given start and/or end offsets, which +satisfies the predicate `test`. `start` and `end` can be either `null` +(as wildcard) or a number. `test` may be a string (indicating a node +type) or a function that takes `(nodeType, node)` arguments and +returns a boolean indicating whether this node is interesting. `base` +and `state` are optional, and can be used to specify a custom walker. +Nodes are tested from inner to outer, so if two nodes match the +boundaries, the inner one will be preferred. + +**findNodeAround**`(node, pos, test, base, state)` is a lot like +`findNodeAt`, but will match any node that exists 'around' (spanning) +the given position. + +**findNodeAfter**`(node, pos, test, base, state)` is similar to +`findNodeAround`, but will match all nodes *after* the given position +(testing outer nodes before inner nodes). diff --git a/tools/node_modules/acorn-walk/dist/walk.js b/tools/node_modules/acorn-walk/dist/walk.js new file mode 100644 index 000000000000..322a58d9fabc --- /dev/null +++ b/tools/node_modules/acorn-walk/dist/walk.js @@ -0,0 +1,456 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.acorn = global.acorn || {}, global.acorn.walk = {}))); +}(this, (function (exports) { 'use strict'; + +// AST walker module for Mozilla Parser API compatible trees + +// A simple walk is one where you simply specify callbacks to be +// called on specific nodes. The last two arguments are optional. A +// simple use would be +// +// walk.simple(myTree, { +// Expression: function(node) { ... } +// }); +// +// to do something with all expressions. All Parser API node types +// can be used to identify node types, as well as Expression and +// Statement, which denote categories of nodes. +// +// The base argument can be used to pass a custom (recursive) +// walker, and state can be used to give this walked an initial +// state. + +function simple(node, visitors, baseVisitor, state, override) { + if (!baseVisitor) { baseVisitor = base + ; }(function c(node, st, override) { + var type = override || node.type, found = visitors[type]; + baseVisitor[type](node, st, c); + if (found) { found(node, st); } + })(node, state, override); +} + +// An ancestor walk keeps an array of ancestor nodes (including the +// current node) and passes them to the callback as third parameter +// (and also as state parameter when no other state is present). +function ancestor(node, visitors, baseVisitor, state) { + var ancestors = []; + if (!baseVisitor) { baseVisitor = base + ; }(function c(node, st, override) { + var type = override || node.type, found = visitors[type]; + var isNew = node !== ancestors[ancestors.length - 1]; + if (isNew) { ancestors.push(node); } + baseVisitor[type](node, st, c); + if (found) { found(node, st || ancestors, ancestors); } + if (isNew) { ancestors.pop(); } + })(node, state); +} + +// A recursive walk is one where your functions override the default +// walkers. They can modify and replace the state parameter that's +// threaded through the walk, and can opt how and whether to walk +// their child nodes (by calling their third argument on these +// nodes). +function recursive(node, state, funcs, baseVisitor, override) { + var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor;(function c(node, st, override) { + visitor[override || node.type](node, st, c); + })(node, state, override); +} + +function makeTest(test) { + if (typeof test === "string") + { return function (type) { return type === test; } } + else if (!test) + { return function () { return true; } } + else + { return test } +} + +var Found = function Found(node, state) { this.node = node; this.state = state; }; + +// A full walk triggers the callback on each node +function full(node, callback, baseVisitor, state, override) { + if (!baseVisitor) { baseVisitor = base + ; }(function c(node, st, override) { + var type = override || node.type; + baseVisitor[type](node, st, c); + if (!override) { callback(node, st, type); } + })(node, state, override); +} + +// An fullAncestor walk is like an ancestor walk, but triggers +// the callback on each node +function fullAncestor(node, callback, baseVisitor, state) { + if (!baseVisitor) { baseVisitor = base; } + var ancestors = [];(function c(node, st, override) { + var type = override || node.type; + var isNew = node !== ancestors[ancestors.length - 1]; + if (isNew) { ancestors.push(node); } + baseVisitor[type](node, st, c); + if (!override) { callback(node, st || ancestors, ancestors, type); } + if (isNew) { ancestors.pop(); } + })(node, state); +} + +// Find a node with a given start, end, and type (all are optional, +// null can be used as wildcard). Returns a {node, state} object, or +// undefined when it doesn't find a matching node. +function findNodeAt(node, start, end, test, baseVisitor, state) { + if (!baseVisitor) { baseVisitor = base; } + test = makeTest(test); + try { + (function c(node, st, override) { + var type = override || node.type; + if ((start == null || node.start <= start) && + (end == null || node.end >= end)) + { baseVisitor[type](node, st, c); } + if ((start == null || node.start === start) && + (end == null || node.end === end) && + test(type, node)) + { throw new Found(node, st) } + })(node, state); + } catch (e) { + if (e instanceof Found) { return e } + throw e + } +} + +// Find the innermost node of a given type that contains the given +// position. Interface similar to findNodeAt. +function findNodeAround(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { baseVisitor = base; } + try { + (function c(node, st, override) { + var type = override || node.type; + if (node.start > pos || node.end < pos) { return } + baseVisitor[type](node, st, c); + if (test(type, node)) { throw new Found(node, st) } + })(node, state); + } catch (e) { + if (e instanceof Found) { return e } + throw e + } +} + +// Find the outermost matching node after a given position. +function findNodeAfter(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { baseVisitor = base; } + try { + (function c(node, st, override) { + if (node.end < pos) { return } + var type = override || node.type; + if (node.start >= pos && test(type, node)) { throw new Found(node, st) } + baseVisitor[type](node, st, c); + })(node, state); + } catch (e) { + if (e instanceof Found) { return e } + throw e + } +} + +// Find the outermost matching node before a given position. +function findNodeBefore(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { baseVisitor = base; } + var max;(function c(node, st, override) { + if (node.start > pos) { return } + var type = override || node.type; + if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node)) + { max = new Found(node, st); } + baseVisitor[type](node, st, c); + })(node, state); + return max +} + +// Fallback to an Object.create polyfill for older environments. +var create = Object.create || function(proto) { + function Ctor() {} + Ctor.prototype = proto; + return new Ctor +}; + +// Used to create a custom walker. Will fill in all missing node +// type properties with the defaults. +function make(funcs, baseVisitor) { + var visitor = create(baseVisitor || base); + for (var type in funcs) { visitor[type] = funcs[type]; } + return visitor +} + +function skipThrough(node, st, c) { c(node, st); } +function ignore(_node, _st, _c) {} + +// Node walkers. + +var base = {}; + +base.Program = base.BlockStatement = function (node, st, c) { + for (var i = 0, list = node.body; i < list.length; i += 1) + { + var stmt = list[i]; + + c(stmt, st, "Statement"); + } +}; +base.Statement = skipThrough; +base.EmptyStatement = ignore; +base.ExpressionStatement = base.ParenthesizedExpression = + function (node, st, c) { return c(node.expression, st, "Expression"); }; +base.IfStatement = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Statement"); + if (node.alternate) { c(node.alternate, st, "Statement"); } +}; +base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); }; +base.BreakStatement = base.ContinueStatement = ignore; +base.WithStatement = function (node, st, c) { + c(node.object, st, "Expression"); + c(node.body, st, "Statement"); +}; +base.SwitchStatement = function (node, st, c) { + c(node.discriminant, st, "Expression"); + for (var i = 0, list = node.cases; i < list.length; i += 1) { + var cs = list[i]; + + if (cs.test) { c(cs.test, st, "Expression"); } + for (var i$1 = 0, list$1 = cs.consequent; i$1 < list$1.length; i$1 += 1) + { + var cons = list$1[i$1]; + + c(cons, st, "Statement"); + } + } +}; +base.SwitchCase = function (node, st, c) { + if (node.test) { c(node.test, st, "Expression"); } + for (var i = 0, list = node.consequent; i < list.length; i += 1) + { + var cons = list[i]; + + c(cons, st, "Statement"); + } +}; +base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) { + if (node.argument) { c(node.argument, st, "Expression"); } +}; +base.ThrowStatement = base.SpreadElement = + function (node, st, c) { return c(node.argument, st, "Expression"); }; +base.TryStatement = function (node, st, c) { + c(node.block, st, "Statement"); + if (node.handler) { c(node.handler, st); } + if (node.finalizer) { c(node.finalizer, st, "Statement"); } +}; +base.CatchClause = function (node, st, c) { + if (node.param) { c(node.param, st, "Pattern"); } + c(node.body, st, "Statement"); +}; +base.WhileStatement = base.DoWhileStatement = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.body, st, "Statement"); +}; +base.ForStatement = function (node, st, c) { + if (node.init) { c(node.init, st, "ForInit"); } + if (node.test) { c(node.test, st, "Expression"); } + if (node.update) { c(node.update, st, "Expression"); } + c(node.body, st, "Statement"); +}; +base.ForInStatement = base.ForOfStatement = function (node, st, c) { + c(node.left, st, "ForInit"); + c(node.right, st, "Expression"); + c(node.body, st, "Statement"); +}; +base.ForInit = function (node, st, c) { + if (node.type === "VariableDeclaration") { c(node, st); } + else { c(node, st, "Expression"); } +}; +base.DebuggerStatement = ignore; + +base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); }; +base.VariableDeclaration = function (node, st, c) { + for (var i = 0, list = node.declarations; i < list.length; i += 1) + { + var decl = list[i]; + + c(decl, st); + } +}; +base.VariableDeclarator = function (node, st, c) { + c(node.id, st, "Pattern"); + if (node.init) { c(node.init, st, "Expression"); } +}; + +base.Function = function (node, st, c) { + if (node.id) { c(node.id, st, "Pattern"); } + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + c(param, st, "Pattern"); + } + c(node.body, st, node.expression ? "Expression" : "Statement"); +}; + +base.Pattern = function (node, st, c) { + if (node.type === "Identifier") + { c(node, st, "VariablePattern"); } + else if (node.type === "MemberExpression") + { c(node, st, "MemberPattern"); } + else + { c(node, st); } +}; +base.VariablePattern = ignore; +base.MemberPattern = skipThrough; +base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); }; +base.ArrayPattern = function (node, st, c) { + for (var i = 0, list = node.elements; i < list.length; i += 1) { + var elt = list[i]; + + if (elt) { c(elt, st, "Pattern"); } + } +}; +base.ObjectPattern = function (node, st, c) { + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + if (prop.type === "Property") { + if (prop.computed) { c(prop.key, st, "Expression"); } + c(prop.value, st, "Pattern"); + } else if (prop.type === "RestElement") { + c(prop.argument, st, "Pattern"); + } + } +}; + +base.Expression = skipThrough; +base.ThisExpression = base.Super = base.MetaProperty = ignore; +base.ArrayExpression = function (node, st, c) { + for (var i = 0, list = node.elements; i < list.length; i += 1) { + var elt = list[i]; + + if (elt) { c(elt, st, "Expression"); } + } +}; +base.ObjectExpression = function (node, st, c) { + for (var i = 0, list = node.properties; i < list.length; i += 1) + { + var prop = list[i]; + + c(prop, st); + } +}; +base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration; +base.SequenceExpression = function (node, st, c) { + for (var i = 0, list = node.expressions; i < list.length; i += 1) + { + var expr = list[i]; + + c(expr, st, "Expression"); + } +}; +base.TemplateLiteral = function (node, st, c) { + for (var i = 0, list = node.quasis; i < list.length; i += 1) + { + var quasi = list[i]; + + c(quasi, st); + } + + for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) + { + var expr = list$1[i$1]; + + c(expr, st, "Expression"); + } +}; +base.TemplateElement = ignore; +base.UnaryExpression = base.UpdateExpression = function (node, st, c) { + c(node.argument, st, "Expression"); +}; +base.BinaryExpression = base.LogicalExpression = function (node, st, c) { + c(node.left, st, "Expression"); + c(node.right, st, "Expression"); +}; +base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) { + c(node.left, st, "Pattern"); + c(node.right, st, "Expression"); +}; +base.ConditionalExpression = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Expression"); + c(node.alternate, st, "Expression"); +}; +base.NewExpression = base.CallExpression = function (node, st, c) { + c(node.callee, st, "Expression"); + if (node.arguments) + { for (var i = 0, list = node.arguments; i < list.length; i += 1) + { + var arg = list[i]; + + c(arg, st, "Expression"); + } } +}; +base.MemberExpression = function (node, st, c) { + c(node.object, st, "Expression"); + if (node.computed) { c(node.property, st, "Expression"); } +}; +base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) { + if (node.declaration) + { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); } + if (node.source) { c(node.source, st, "Expression"); } +}; +base.ExportAllDeclaration = function (node, st, c) { + c(node.source, st, "Expression"); +}; +base.ImportDeclaration = function (node, st, c) { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) + { + var spec = list[i]; + + c(spec, st); + } + c(node.source, st, "Expression"); +}; +base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore; + +base.TaggedTemplateExpression = function (node, st, c) { + c(node.tag, st, "Expression"); + c(node.quasi, st, "Expression"); +}; +base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); }; +base.Class = function (node, st, c) { + if (node.id) { c(node.id, st, "Pattern"); } + if (node.superClass) { c(node.superClass, st, "Expression"); } + c(node.body, st); +}; +base.ClassBody = function (node, st, c) { + for (var i = 0, list = node.body; i < list.length; i += 1) + { + var elt = list[i]; + + c(elt, st); + } +}; +base.MethodDefinition = base.Property = function (node, st, c) { + if (node.computed) { c(node.key, st, "Expression"); } + c(node.value, st, "Expression"); +}; + +exports.simple = simple; +exports.ancestor = ancestor; +exports.recursive = recursive; +exports.full = full; +exports.fullAncestor = fullAncestor; +exports.findNodeAt = findNodeAt; +exports.findNodeAround = findNodeAround; +exports.findNodeAfter = findNodeAfter; +exports.findNodeBefore = findNodeBefore; +exports.make = make; +exports.base = base; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=walk.js.map diff --git a/tools/node_modules/acorn-walk/dist/walk.js.map b/tools/node_modules/acorn-walk/dist/walk.js.map new file mode 100644 index 000000000000..5590a2924f2d --- /dev/null +++ b/tools/node_modules/acorn-walk/dist/walk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"walk.js","sources":["../src/index.js"],"sourcesContent":["// AST walker module for Mozilla Parser API compatible trees\n\n// A simple walk is one where you simply specify callbacks to be\n// called on specific nodes. The last two arguments are optional. A\n// simple use would be\n//\n// walk.simple(myTree, {\n// Expression: function(node) { ... }\n// });\n//\n// to do something with all expressions. All Parser API node types\n// can be used to identify node types, as well as Expression and\n// Statement, which denote categories of nodes.\n//\n// The base argument can be used to pass a custom (recursive)\n// walker, and state can be used to give this walked an initial\n// state.\n\nexport function simple(node, visitors, baseVisitor, state, override) {\n if (!baseVisitor) baseVisitor = base\n ;(function c(node, st, override) {\n let type = override || node.type, found = visitors[type]\n baseVisitor[type](node, st, c)\n if (found) found(node, st)\n })(node, state, override)\n}\n\n// An ancestor walk keeps an array of ancestor nodes (including the\n// current node) and passes them to the callback as third parameter\n// (and also as state parameter when no other state is present).\nexport function ancestor(node, visitors, baseVisitor, state) {\n let ancestors = []\n if (!baseVisitor) baseVisitor = base\n ;(function c(node, st, override) {\n let type = override || node.type, found = visitors[type]\n let isNew = node !== ancestors[ancestors.length - 1]\n if (isNew) ancestors.push(node)\n baseVisitor[type](node, st, c)\n if (found) found(node, st || ancestors, ancestors)\n if (isNew) ancestors.pop()\n })(node, state)\n}\n\n// A recursive walk is one where your functions override the default\n// walkers. They can modify and replace the state parameter that's\n// threaded through the walk, and can opt how and whether to walk\n// their child nodes (by calling their third argument on these\n// nodes).\nexport function recursive(node, state, funcs, baseVisitor, override) {\n let visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c)\n })(node, state, override)\n}\n\nfunction makeTest(test) {\n if (typeof test === \"string\")\n return type => type === test\n else if (!test)\n return () => true\n else\n return test\n}\n\nclass Found {\n constructor(node, state) { this.node = node; this.state = state }\n}\n\n// A full walk triggers the callback on each node\nexport function full(node, callback, baseVisitor, state, override) {\n if (!baseVisitor) baseVisitor = base\n ;(function c(node, st, override) {\n let type = override || node.type\n baseVisitor[type](node, st, c)\n if (!override) callback(node, st, type)\n })(node, state, override)\n}\n\n// An fullAncestor walk is like an ancestor walk, but triggers\n// the callback on each node\nexport function fullAncestor(node, callback, baseVisitor, state) {\n if (!baseVisitor) baseVisitor = base\n let ancestors = []\n ;(function c(node, st, override) {\n let type = override || node.type\n let isNew = node !== ancestors[ancestors.length - 1]\n if (isNew) ancestors.push(node)\n baseVisitor[type](node, st, c)\n if (!override) callback(node, st || ancestors, ancestors, type)\n if (isNew) ancestors.pop()\n })(node, state)\n}\n\n// Find a node with a given start, end, and type (all are optional,\n// null can be used as wildcard). Returns a {node, state} object, or\n// undefined when it doesn't find a matching node.\nexport function findNodeAt(node, start, end, test, baseVisitor, state) {\n if (!baseVisitor) baseVisitor = base\n test = makeTest(test)\n try {\n (function c(node, st, override) {\n let type = override || node.type\n if ((start == null || node.start <= start) &&\n (end == null || node.end >= end))\n baseVisitor[type](node, st, c)\n if ((start == null || node.start === start) &&\n (end == null || node.end === end) &&\n test(type, node))\n throw new Found(node, st)\n })(node, state)\n } catch (e) {\n if (e instanceof Found) return e\n throw e\n }\n}\n\n// Find the innermost node of a given type that contains the given\n// position. Interface similar to findNodeAt.\nexport function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test)\n if (!baseVisitor) baseVisitor = base\n try {\n (function c(node, st, override) {\n let type = override || node.type\n if (node.start > pos || node.end < pos) return\n baseVisitor[type](node, st, c)\n if (test(type, node)) throw new Found(node, st)\n })(node, state)\n } catch (e) {\n if (e instanceof Found) return e\n throw e\n }\n}\n\n// Find the outermost matching node after a given position.\nexport function findNodeAfter(node, pos, test, baseVisitor, state) {\n test = makeTest(test)\n if (!baseVisitor) baseVisitor = base\n try {\n (function c(node, st, override) {\n if (node.end < pos) return\n let type = override || node.type\n if (node.start >= pos && test(type, node)) throw new Found(node, st)\n baseVisitor[type](node, st, c)\n })(node, state)\n } catch (e) {\n if (e instanceof Found) return e\n throw e\n }\n}\n\n// Find the outermost matching node before a given position.\nexport function findNodeBefore(node, pos, test, baseVisitor, state) {\n test = makeTest(test)\n if (!baseVisitor) baseVisitor = base\n let max\n ;(function c(node, st, override) {\n if (node.start > pos) return\n let type = override || node.type\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n max = new Found(node, st)\n baseVisitor[type](node, st, c)\n })(node, state)\n return max\n}\n\n// Fallback to an Object.create polyfill for older environments.\nconst create = Object.create || function(proto) {\n function Ctor() {}\n Ctor.prototype = proto\n return new Ctor\n}\n\n// Used to create a custom walker. Will fill in all missing node\n// type properties with the defaults.\nexport function make(funcs, baseVisitor) {\n let visitor = create(baseVisitor || base)\n for (let type in funcs) visitor[type] = funcs[type]\n return visitor\n}\n\nfunction skipThrough(node, st, c) { c(node, st) }\nfunction ignore(_node, _st, _c) {}\n\n// Node walkers.\n\nexport const base = {}\n\nbase.Program = base.BlockStatement = (node, st, c) => {\n for (let stmt of node.body)\n c(stmt, st, \"Statement\")\n}\nbase.Statement = skipThrough\nbase.EmptyStatement = ignore\nbase.ExpressionStatement = base.ParenthesizedExpression =\n (node, st, c) => c(node.expression, st, \"Expression\")\nbase.IfStatement = (node, st, c) => {\n c(node.test, st, \"Expression\")\n c(node.consequent, st, \"Statement\")\n if (node.alternate) c(node.alternate, st, \"Statement\")\n}\nbase.LabeledStatement = (node, st, c) => c(node.body, st, \"Statement\")\nbase.BreakStatement = base.ContinueStatement = ignore\nbase.WithStatement = (node, st, c) => {\n c(node.object, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.SwitchStatement = (node, st, c) => {\n c(node.discriminant, st, \"Expression\")\n for (let cs of node.cases) {\n if (cs.test) c(cs.test, st, \"Expression\")\n for (let cons of cs.consequent)\n c(cons, st, \"Statement\")\n }\n}\nbase.SwitchCase = (node, st, c) => {\n if (node.test) c(node.test, st, \"Expression\")\n for (let cons of node.consequent)\n c(cons, st, \"Statement\")\n}\nbase.ReturnStatement = base.YieldExpression = base.AwaitExpression = (node, st, c) => {\n if (node.argument) c(node.argument, st, \"Expression\")\n}\nbase.ThrowStatement = base.SpreadElement =\n (node, st, c) => c(node.argument, st, \"Expression\")\nbase.TryStatement = (node, st, c) => {\n c(node.block, st, \"Statement\")\n if (node.handler) c(node.handler, st)\n if (node.finalizer) c(node.finalizer, st, \"Statement\")\n}\nbase.CatchClause = (node, st, c) => {\n if (node.param) c(node.param, st, \"Pattern\")\n c(node.body, st, \"Statement\")\n}\nbase.WhileStatement = base.DoWhileStatement = (node, st, c) => {\n c(node.test, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.ForStatement = (node, st, c) => {\n if (node.init) c(node.init, st, \"ForInit\")\n if (node.test) c(node.test, st, \"Expression\")\n if (node.update) c(node.update, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.ForInStatement = base.ForOfStatement = (node, st, c) => {\n c(node.left, st, \"ForInit\")\n c(node.right, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.ForInit = (node, st, c) => {\n if (node.type === \"VariableDeclaration\") c(node, st)\n else c(node, st, \"Expression\")\n}\nbase.DebuggerStatement = ignore\n\nbase.FunctionDeclaration = (node, st, c) => c(node, st, \"Function\")\nbase.VariableDeclaration = (node, st, c) => {\n for (let decl of node.declarations)\n c(decl, st)\n}\nbase.VariableDeclarator = (node, st, c) => {\n c(node.id, st, \"Pattern\")\n if (node.init) c(node.init, st, \"Expression\")\n}\n\nbase.Function = (node, st, c) => {\n if (node.id) c(node.id, st, \"Pattern\")\n for (let param of node.params)\n c(param, st, \"Pattern\")\n c(node.body, st, node.expression ? \"Expression\" : \"Statement\")\n}\n\nbase.Pattern = (node, st, c) => {\n if (node.type === \"Identifier\")\n c(node, st, \"VariablePattern\")\n else if (node.type === \"MemberExpression\")\n c(node, st, \"MemberPattern\")\n else\n c(node, st)\n}\nbase.VariablePattern = ignore\nbase.MemberPattern = skipThrough\nbase.RestElement = (node, st, c) => c(node.argument, st, \"Pattern\")\nbase.ArrayPattern = (node, st, c) => {\n for (let elt of node.elements) {\n if (elt) c(elt, st, \"Pattern\")\n }\n}\nbase.ObjectPattern = (node, st, c) => {\n for (let prop of node.properties) {\n if (prop.type === \"Property\") {\n if (prop.computed) c(prop.key, st, \"Expression\")\n c(prop.value, st, \"Pattern\")\n } else if (prop.type === \"RestElement\") {\n c(prop.argument, st, \"Pattern\")\n }\n }\n}\n\nbase.Expression = skipThrough\nbase.ThisExpression = base.Super = base.MetaProperty = ignore\nbase.ArrayExpression = (node, st, c) => {\n for (let elt of node.elements) {\n if (elt) c(elt, st, \"Expression\")\n }\n}\nbase.ObjectExpression = (node, st, c) => {\n for (let prop of node.properties)\n c(prop, st)\n}\nbase.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration\nbase.SequenceExpression = (node, st, c) => {\n for (let expr of node.expressions)\n c(expr, st, \"Expression\")\n}\nbase.TemplateLiteral = (node, st, c) => {\n for (let quasi of node.quasis)\n c(quasi, st)\n\n for (let expr of node.expressions)\n c(expr, st, \"Expression\")\n}\nbase.TemplateElement = ignore\nbase.UnaryExpression = base.UpdateExpression = (node, st, c) => {\n c(node.argument, st, \"Expression\")\n}\nbase.BinaryExpression = base.LogicalExpression = (node, st, c) => {\n c(node.left, st, \"Expression\")\n c(node.right, st, \"Expression\")\n}\nbase.AssignmentExpression = base.AssignmentPattern = (node, st, c) => {\n c(node.left, st, \"Pattern\")\n c(node.right, st, \"Expression\")\n}\nbase.ConditionalExpression = (node, st, c) => {\n c(node.test, st, \"Expression\")\n c(node.consequent, st, \"Expression\")\n c(node.alternate, st, \"Expression\")\n}\nbase.NewExpression = base.CallExpression = (node, st, c) => {\n c(node.callee, st, \"Expression\")\n if (node.arguments)\n for (let arg of node.arguments)\n c(arg, st, \"Expression\")\n}\nbase.MemberExpression = (node, st, c) => {\n c(node.object, st, \"Expression\")\n if (node.computed) c(node.property, st, \"Expression\")\n}\nbase.ExportNamedDeclaration = base.ExportDefaultDeclaration = (node, st, c) => {\n if (node.declaration)\n c(node.declaration, st, node.type === \"ExportNamedDeclaration\" || node.declaration.id ? \"Statement\" : \"Expression\")\n if (node.source) c(node.source, st, \"Expression\")\n}\nbase.ExportAllDeclaration = (node, st, c) => {\n c(node.source, st, \"Expression\")\n}\nbase.ImportDeclaration = (node, st, c) => {\n for (let spec of node.specifiers)\n c(spec, st)\n c(node.source, st, \"Expression\")\n}\nbase.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore\n\nbase.TaggedTemplateExpression = (node, st, c) => {\n c(node.tag, st, \"Expression\")\n c(node.quasi, st, \"Expression\")\n}\nbase.ClassDeclaration = base.ClassExpression = (node, st, c) => c(node, st, \"Class\")\nbase.Class = (node, st, c) => {\n if (node.id) c(node.id, st, \"Pattern\")\n if (node.superClass) c(node.superClass, st, \"Expression\")\n c(node.body, st)\n}\nbase.ClassBody = (node, st, c) => {\n for (let elt of node.body)\n c(elt, st)\n}\nbase.MethodDefinition = base.Property = (node, st, c) => {\n if (node.computed) c(node.key, st, \"Expression\")\n c(node.value, st, \"Expression\")\n}\n"],"names":["let","const"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;AAkBA,AAAO,SAAS,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;EACnE,IAAI,CAAC,WAAW,EAAE,EAAA,WAAW,GAAG,IAAI;GACnC,EAAA,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE;IAC/BA,IAAI,IAAI,GAAG,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAC;IACxD,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAC;IAC9B,IAAI,KAAK,EAAE,EAAA,KAAK,CAAC,IAAI,EAAE,EAAE,EAAC,EAAA;GAC3B,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAC;CAC1B;;;;;AAKD,AAAO,SAAS,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE;EAC3DA,IAAI,SAAS,GAAG,GA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ChC;AACD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,GAAG,UAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,SAAG,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,IAAA;AACpF,IAAI,CAAC,KAAK,GAAG,UAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE;EACzB,IAAI,IAAI,CAAC,EAAE,EAAE,EAAA,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,EAAA;EACtC,IAAI,IAAI,CAAC,UAAU,EAAE,EAAA,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,EAAC,EAAA;EACzD,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAC;EACjB;AACD,IAAI,CAAC,SAAS,GAAG,UAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE;EAC7B,KAAY,kBAAI,IAAI,CAAC,IAAI,yBAAA;IAApB;IAAAA,IAAI,GAAG;;IACV,CAAC,CAAC,GAAG,EAAE,EAAE,EAAC;GAAA;EACb;AACD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,QAAQ,GAAG,UAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE;EACpD,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAA,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,YAAY,EAAC,EAAA;EAChD,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,YAAY,EAAC;CAChC;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/tools/node_modules/acorn-walk/dist/walk.mjs b/tools/node_modules/acorn-walk/dist/walk.mjs new file mode 100644 index 000000000000..0f4100b8c87c --- /dev/null +++ b/tools/node_modules/acorn-walk/dist/walk.mjs @@ -0,0 +1,436 @@ +// AST walker module for Mozilla Parser API compatible trees + +// A simple walk is one where you simply specify callbacks to be +// called on specific nodes. The last two arguments are optional. A +// simple use would be +// +// walk.simple(myTree, { +// Expression: function(node) { ... } +// }); +// +// to do something with all expressions. All Parser API node types +// can be used to identify node types, as well as Expression and +// Statement, which denote categories of nodes. +// +// The base argument can be used to pass a custom (recursive) +// walker, and state can be used to give this walked an initial +// state. + +function simple(node, visitors, baseVisitor, state, override) { + if (!baseVisitor) { baseVisitor = base + ; }(function c(node, st, override) { + var type = override || node.type, found = visitors[type]; + baseVisitor[type](node, st, c); + if (found) { found(node, st); } + })(node, state, override); +} + +// An ancestor walk keeps an array of ancestor nodes (including the +// current node) and passes them to the callback as third parameter +// (and also as state parameter when no other state is present). +function ancestor(node, visitors, baseVisitor, state) { + var ancestors = []; + if (!baseVisitor) { baseVisitor = base + ; }(function c(node, st, override) { + var type = override || node.type, found = visitors[type]; + var isNew = node !== ancestors[ancestors.length - 1]; + if (isNew) { ancestors.push(node); } + baseVisitor[type](node, st, c); + if (found) { found(node, st || ancestors, ancestors); } + if (isNew) { ancestors.pop(); } + })(node, state); +} + +// A recursive walk is one where your functions override the default +// walkers. They can modify and replace the state parameter that's +// threaded through the walk, and can opt how and whether to walk +// their child nodes (by calling their third argument on these +// nodes). +function recursive(node, state, funcs, baseVisitor, override) { + var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor;(function c(node, st, override) { + visitor[override || node.type](node, st, c); + })(node, state, override); +} + +function makeTest(test) { + if (typeof test === "string") + { return function (type) { return type === test; } } + else if (!test) + { return function () { return true; } } + else + { return test } +} + +var Found = function Found(node, state) { this.node = node; this.state = state; }; + +// A full walk triggers the callback on each node +function full(node, callback, baseVisitor, state, override) { + if (!baseVisitor) { baseVisitor = base + ; }(function c(node, st, override) { + var type = override || node.type; + baseVisitor[type](node, st, c); + if (!override) { callback(node, st, type); } + })(node, state, override); +} + +// An fullAncestor walk is like an ancestor walk, but triggers +// the callback on each node +function fullAncestor(node, callback, baseVisitor, state) { + if (!baseVisitor) { baseVisitor = base; } + var ancestors = [];(function c(node, st, override) { + var type = override || node.type; + var isNew = node !== ancestors[ancestors.length - 1]; + if (isNew) { ancestors.push(node); } + baseVisitor[type](node, st, c); + if (!override) { callback(node, st || ancestors, ancestors, type); } + if (isNew) { ancestors.pop(); } + })(node, state); +} + +// Find a node with a given start, end, and type (all are optional, +// null can be used as wildcard). Returns a {node, state} object, or +// undefined when it doesn't find a matching node. +function findNodeAt(node, start, end, test, baseVisitor, state) { + if (!baseVisitor) { baseVisitor = base; } + test = makeTest(test); + try { + (function c(node, st, override) { + var type = override || node.type; + if ((start == null || node.start <= start) && + (end == null || node.end >= end)) + { baseVisitor[type](node, st, c); } + if ((start == null || node.start === start) && + (end == null || node.end === end) && + test(type, node)) + { throw new Found(node, st) } + })(node, state); + } catch (e) { + if (e instanceof Found) { return e } + throw e + } +} + +// Find the innermost node of a given type that contains the given +// position. Interface similar to findNodeAt. +function findNodeAround(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { baseVisitor = base; } + try { + (function c(node, st, override) { + var type = override || node.type; + if (node.start > pos || node.end < pos) { return } + baseVisitor[type](node, st, c); + if (test(type, node)) { throw new Found(node, st) } + })(node, state); + } catch (e) { + if (e instanceof Found) { return e } + throw e + } +} + +// Find the outermost matching node after a given position. +function findNodeAfter(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { baseVisitor = base; } + try { + (function c(node, st, override) { + if (node.end < pos) { return } + var type = override || node.type; + if (node.start >= pos && test(type, node)) { throw new Found(node, st) } + baseVisitor[type](node, st, c); + })(node, state); + } catch (e) { + if (e instanceof Found) { return e } + throw e + } +} + +// Find the outermost matching node before a given position. +function findNodeBefore(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { baseVisitor = base; } + var max;(function c(node, st, override) { + if (node.start > pos) { return } + var type = override || node.type; + if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node)) + { max = new Found(node, st); } + baseVisitor[type](node, st, c); + })(node, state); + return max +} + +// Fallback to an Object.create polyfill for older environments. +var create = Object.create || function(proto) { + function Ctor() {} + Ctor.prototype = proto; + return new Ctor +}; + +// Used to create a custom walker. Will fill in all missing node +// type properties with the defaults. +function make(funcs, baseVisitor) { + var visitor = create(baseVisitor || base); + for (var type in funcs) { visitor[type] = funcs[type]; } + return visitor +} + +function skipThrough(node, st, c) { c(node, st); } +function ignore(_node, _st, _c) {} + +// Node walkers. + +var base = {}; + +base.Program = base.BlockStatement = function (node, st, c) { + for (var i = 0, list = node.body; i < list.length; i += 1) + { + var stmt = list[i]; + + c(stmt, st, "Statement"); + } +}; +base.Statement = skipThrough; +base.EmptyStatement = ignore; +base.ExpressionStatement = base.ParenthesizedExpression = + function (node, st, c) { return c(node.expression, st, "Expression"); }; +base.IfStatement = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Statement"); + if (node.alternate) { c(node.alternate, st, "Statement"); } +}; +base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); }; +base.BreakStatement = base.ContinueStatement = ignore; +base.WithStatement = function (node, st, c) { + c(node.object, st, "Expression"); + c(node.body, st, "Statement"); +}; +base.SwitchStatement = function (node, st, c) { + c(node.discriminant, st, "Expression"); + for (var i = 0, list = node.cases; i < list.length; i += 1) { + var cs = list[i]; + + if (cs.test) { c(cs.test, st, "Expression"); } + for (var i$1 = 0, list$1 = cs.consequent; i$1 < list$1.length; i$1 += 1) + { + var cons = list$1[i$1]; + + c(cons, st, "Statement"); + } + } +}; +base.SwitchCase = function (node, st, c) { + if (node.test) { c(node.test, st, "Expression"); } + for (var i = 0, list = node.consequent; i < list.length; i += 1) + { + var cons = list[i]; + + c(cons, st, "Statement"); + } +}; +base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) { + if (node.argument) { c(node.argument, st, "Expression"); } +}; +base.ThrowStatement = base.SpreadElement = + function (node, st, c) { return c(node.argument, st, "Expression"); }; +base.TryStatement = function (node, st, c) { + c(node.block, st, "Statement"); + if (node.handler) { c(node.handler, st); } + if (node.finalizer) { c(node.finalizer, st, "Statement"); } +}; +base.CatchClause = function (node, st, c) { + if (node.param) { c(node.param, st, "Pattern"); } + c(node.body, st, "Statement"); +}; +base.WhileStatement = base.DoWhileStatement = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.body, st, "Statement"); +}; +base.ForStatement = function (node, st, c) { + if (node.init) { c(node.init, st, "ForInit"); } + if (node.test) { c(node.test, st, "Expression"); } + if (node.update) { c(node.update, st, "Expression"); } + c(node.body, st, "Statement"); +}; +base.ForInStatement = base.ForOfStatement = function (node, st, c) { + c(node.left, st, "ForInit"); + c(node.right, st, "Expression"); + c(node.body, st, "Statement"); +}; +base.ForInit = function (node, st, c) { + if (node.type === "VariableDeclaration") { c(node, st); } + else { c(node, st, "Expression"); } +}; +base.DebuggerStatement = ignore; + +base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); }; +base.VariableDeclaration = function (node, st, c) { + for (var i = 0, list = node.declarations; i < list.length; i += 1) + { + var decl = list[i]; + + c(decl, st); + } +}; +base.VariableDeclarator = function (node, st, c) { + c(node.id, st, "Pattern"); + if (node.init) { c(node.init, st, "Expression"); } +}; + +base.Function = function (node, st, c) { + if (node.id) { c(node.id, st, "Pattern"); } + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + c(param, st, "Pattern"); + } + c(node.body, st, node.expression ? "Expression" : "Statement"); +}; + +base.Pattern = function (node, st, c) { + if (node.type === "Identifier") + { c(node, st, "VariablePattern"); } + else if (node.type === "MemberExpression") + { c(node, st, "MemberPattern"); } + else + { c(node, st); } +}; +base.VariablePattern = ignore; +base.MemberPattern = skipThrough; +base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); }; +base.ArrayPattern = function (node, st, c) { + for (var i = 0, list = node.elements; i < list.length; i += 1) { + var elt = list[i]; + + if (elt) { c(elt, st, "Pattern"); } + } +}; +base.ObjectPattern = function (node, st, c) { + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + if (prop.type === "Property") { + if (prop.computed) { c(prop.key, st, "Expression"); } + c(prop.value, st, "Pattern"); + } else if (prop.type === "RestElement") { + c(prop.argument, st, "Pattern"); + } + } +}; + +base.Expression = skipThrough; +base.ThisExpression = base.Super = base.MetaProperty = ignore; +base.ArrayExpression = function (node, st, c) { + for (var i = 0, list = node.elements; i < list.length; i += 1) { + var elt = list[i]; + + if (elt) { c(elt, st, "Expression"); } + } +}; +base.ObjectExpression = function (node, st, c) { + for (var i = 0, list = node.properties; i < list.length; i += 1) + { + var prop = list[i]; + + c(prop, st); + } +}; +base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration; +base.SequenceExpression = function (node, st, c) { + for (var i = 0, list = node.expressions; i < list.length; i += 1) + { + var expr = list[i]; + + c(expr, st, "Expression"); + } +}; +base.TemplateLiteral = function (node, st, c) { + for (var i = 0, list = node.quasis; i < list.length; i += 1) + { + var quasi = list[i]; + + c(quasi, st); + } + + for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) + { + var expr = list$1[i$1]; + + c(expr, st, "Expression"); + } +}; +base.TemplateElement = ignore; +base.UnaryExpression = base.UpdateExpression = function (node, st, c) { + c(node.argument, st, "Expression"); +}; +base.BinaryExpression = base.LogicalExpression = function (node, st, c) { + c(node.left, st, "Expression"); + c(node.right, st, "Expression"); +}; +base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) { + c(node.left, st, "Pattern"); + c(node.right, st, "Expression"); +}; +base.ConditionalExpression = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Expression"); + c(node.alternate, st, "Expression"); +}; +base.NewExpression = base.CallExpression = function (node, st, c) { + c(node.callee, st, "Expression"); + if (node.arguments) + { for (var i = 0, list = node.arguments; i < list.length; i += 1) + { + var arg = list[i]; + + c(arg, st, "Expression"); + } } +}; +base.MemberExpression = function (node, st, c) { + c(node.object, st, "Expression"); + if (node.computed) { c(node.property, st, "Expression"); } +}; +base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) { + if (node.declaration) + { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); } + if (node.source) { c(node.source, st, "Expression"); } +}; +base.ExportAllDeclaration = function (node, st, c) { + c(node.source, st, "Expression"); +}; +base.ImportDeclaration = function (node, st, c) { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) + { + var spec = list[i]; + + c(spec, st); + } + c(node.source, st, "Expression"); +}; +base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore; + +base.TaggedTemplateExpression = function (node, st, c) { + c(node.tag, st, "Expression"); + c(node.quasi, st, "Expression"); +}; +base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); }; +base.Class = function (node, st, c) { + if (node.id) { c(node.id, st, "Pattern"); } + if (node.superClass) { c(node.superClass, st, "Expression"); } + c(node.body, st); +}; +base.ClassBody = function (node, st, c) { + for (var i = 0, list = node.body; i < list.length; i += 1) + { + var elt = list[i]; + + c(elt, st); + } +}; +base.MethodDefinition = base.Property = function (node, st, c) { + if (node.computed) { c(node.key, st, "Expression"); } + c(node.value, st, "Expression"); +}; + +export { simple, ancestor, recursive, full, fullAncestor, findNodeAt, findNodeAround, findNodeAfter, findNodeBefore, make, base }; +//# sourceMappingURL=walk.mjs.map diff --git a/tools/node_modules/acorn-walk/dist/walk.mjs.map b/tools/node_modules/acorn-walk/dist/walk.mjs.map new file mode 100644 index 000000000000..2a94219c3bad --- /dev/null +++ b/tools/node_modules/acorn-walk/dist/walk.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"walk.mjs","sources":["../src/index.js"],"sourcesContent":["// AST walker module for Mozilla Parser API compatible trees\n\n// A simple walk is one where you simply specify callbacks to be\n// called on specific nodes. The last two arguments are optional. A\n// simple use would be\n//\n// walk.simple(myTree, {\n// Expression: function(node) { ... }\n// });\n//\n// to do something with all expressions. All Parser API node types\n// can be used to identify node types, as well as Expression and\n// Statement, which denote categories of nodes.\n//\n// The base argument can be used to pass a custom (recursive)\n// walker, and state can be used to give this walked an initial\n// state.\n\nexport function simple(node, visitors, baseVisitor, state, override) {\n if (!baseVisitor) baseVisitor = base\n ;(function c(node, st, override) {\n let type = override || node.type, found = visitors[type]\n baseVisitor[type](node, st, c)\n if (found) found(node, st)\n })(node, state, override)\n}\n\n// An ancestor walk keeps an array of ancestor nodes (including the\n// current node) and passes them to the callback as third parameter\n// (and also as state parameter when no other state is present).\nexport function ancestor(node, visitors, baseVisitor, state) {\n let ancestors = []\n if (!baseVisitor) baseVisitor = base\n ;(function c(node, st, override) {\n let type = override || node.type, found = visitors[type]\n let isNew = node !== ancestors[ancestors.length - 1]\n if (isNew) ancestors.push(node)\n baseVisitor[type](node, st, c)\n if (found) found(node, st || ancestors, ancestors)\n if (isNew) ancestors.pop()\n })(node, state)\n}\n\n// A recursive walk is one where your functions override the default\n// walkers. They can modify and replace the state parameter that's\n// threaded through the walk, and can opt how and whether to walk\n// their child nodes (by calling their third argument on these\n// nodes).\nexport function recursive(node, state, funcs, baseVisitor, override) {\n let visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c)\n })(node, state, override)\n}\n\nfunction makeTest(test) {\n if (typeof test === \"string\")\n return type => type === test\n else if (!test)\n return () => true\n else\n return test\n}\n\nclass Found {\n constructor(node, state) { this.node = node; this.state = state }\n}\n\n// A full walk triggers the callback on each node\nexport function full(node, callback, baseVisitor, state, override) {\n if (!baseVisitor) baseVisitor = base\n ;(function c(node, st, override) {\n let type = override || node.type\n baseVisitor[type](node, st, c)\n if (!override) callback(node, st, type)\n })(node, state, override)\n}\n\n// An fullAncestor walk is like an ancestor walk, but triggers\n// the callback on each node\nexport function fullAncestor(node, callback, baseVisitor, state) {\n if (!baseVisitor) baseVisitor = base\n let ancestors = []\n ;(function c(node, st, override) {\n let type = override || node.type\n let isNew = node !== ancestors[ancestors.length - 1]\n if (isNew) ancestors.push(node)\n baseVisitor[type](node, st, c)\n if (!override) callback(node, st || ancestors, ancestors, type)\n if (isNew) ancestors.pop()\n })(node, state)\n}\n\n// Find a node with a given start, end, and type (all are optional,\n// null can be used as wildcard). Returns a {node, state} object, or\n// undefined when it doesn't find a matching node.\nexport function findNodeAt(node, start, end, test, baseVisitor, state) {\n if (!baseVisitor) baseVisitor = base\n test = makeTest(test)\n try {\n (function c(node, st, override) {\n let type = override || node.type\n if ((start == null || node.start <= start) &&\n (end == null || node.end >= end))\n baseVisitor[type](node, st, c)\n if ((start == null || node.start === start) &&\n (end == null || node.end === end) &&\n test(type, node))\n throw new Found(node, st)\n })(node, state)\n } catch (e) {\n if (e instanceof Found) return e\n throw e\n }\n}\n\n// Find the innermost node of a given type that contains the given\n// position. Interface similar to findNodeAt.\nexport function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test)\n if (!baseVisitor) baseVisitor = base\n try {\n (function c(node, st, override) {\n let type = override || node.type\n if (node.start > pos || node.end < pos) return\n baseVisitor[type](node, st, c)\n if (test(type, node)) throw new Found(node, st)\n })(node, state)\n } catch (e) {\n if (e instanceof Found) return e\n throw e\n }\n}\n\n// Find the outermost matching node after a given position.\nexport function findNodeAfter(node, pos, test, baseVisitor, state) {\n test = makeTest(test)\n if (!baseVisitor) baseVisitor = base\n try {\n (function c(node, st, override) {\n if (node.end < pos) return\n let type = override || node.type\n if (node.start >= pos && test(type, node)) throw new Found(node, st)\n baseVisitor[type](node, st, c)\n })(node, state)\n } catch (e) {\n if (e instanceof Found) return e\n throw e\n }\n}\n\n// Find the outermost matching node before a given position.\nexport function findNodeBefore(node, pos, test, baseVisitor, state) {\n test = makeTest(test)\n if (!baseVisitor) baseVisitor = base\n let max\n ;(function c(node, st, override) {\n if (node.start > pos) return\n let type = override || node.type\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n max = new Found(node, st)\n baseVisitor[type](node, st, c)\n })(node, state)\n return max\n}\n\n// Fallback to an Object.create polyfill for older environments.\nconst create = Object.create || function(proto) {\n function Ctor() {}\n Ctor.prototype = proto\n return new Ctor\n}\n\n// Used to create a custom walker. Will fill in all missing node\n// type properties with the defaults.\nexport function make(funcs, baseVisitor) {\n let visitor = create(baseVisitor || base)\n for (let type in funcs) visitor[type] = funcs[type]\n return visitor\n}\n\nfunction skipThrough(node, st, c) { c(node, st) }\nfunction ignore(_node, _st, _c) {}\n\n// Node walkers.\n\nexport const base = {}\n\nbase.Program = base.BlockStatement = (node, st, c) => {\n for (let stmt of node.body)\n c(stmt, st, \"Statement\")\n}\nbase.Statement = skipThrough\nbase.EmptyStatement = ignore\nbase.ExpressionStatement = base.ParenthesizedExpression =\n (node, st, c) => c(node.expression, st, \"Expression\")\nbase.IfStatement = (node, st, c) => {\n c(node.test, st, \"Expression\")\n c(node.consequent, st, \"Statement\")\n if (node.alternate) c(node.alternate, st, \"Statement\")\n}\nbase.LabeledStatement = (node, st, c) => c(node.body, st, \"Statement\")\nbase.BreakStatement = base.ContinueStatement = ignore\nbase.WithStatement = (node, st, c) => {\n c(node.object, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.SwitchStatement = (node, st, c) => {\n c(node.discriminant, st, \"Expression\")\n for (let cs of node.cases) {\n if (cs.test) c(cs.test, st, \"Expression\")\n for (let cons of cs.consequent)\n c(cons, st, \"Statement\")\n }\n}\nbase.SwitchCase = (node, st, c) => {\n if (node.test) c(node.test, st, \"Expression\")\n for (let cons of node.consequent)\n c(cons, st, \"Statement\")\n}\nbase.ReturnStatement = base.YieldExpression = base.AwaitExpression = (node, st, c) => {\n if (node.argument) c(node.argument, st, \"Expression\")\n}\nbase.ThrowStatement = base.SpreadElement =\n (node, st, c) => c(node.argument, st, \"Expression\")\nbase.TryStatement = (node, st, c) => {\n c(node.block, st, \"Statement\")\n if (node.handler) c(node.handler, st)\n if (node.finalizer) c(node.finalizer, st, \"Statement\")\n}\nbase.CatchClause = (node, st, c) => {\n if (node.param) c(node.param, st, \"Pattern\")\n c(node.body, st, \"Statement\")\n}\nbase.WhileStatement = base.DoWhileStatement = (node, st, c) => {\n c(node.test, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.ForStatement = (node, st, c) => {\n if (node.init) c(node.init, st, \"ForInit\")\n if (node.test) c(node.test, st, \"Expression\")\n if (node.update) c(node.update, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.ForInStatement = base.ForOfStatement = (node, st, c) => {\n c(node.left, st, \"ForInit\")\n c(node.right, st, \"Expression\")\n c(node.body, st, \"Statement\")\n}\nbase.ForInit = (node, st, c) => {\n if (node.type === \"VariableDeclaration\") c(node, st)\n else c(node, st, \"Expression\")\n}\nbase.DebuggerStatement = ignore\n\nbase.FunctionDeclaration = (node, st, c) => c(node, st, \"Function\")\nbase.VariableDeclaration = (node, st, c) => {\n for (let decl of node.declarations)\n c(decl, st)\n}\nbase.VariableDeclarator = (node, st, c) => {\n c(node.id, st, \"Pattern\")\n if (node.init) c(node.init, st, \"Expression\")\n}\n\nbase.Function = (node, st, c) => {\n if (node.id) c(node.id, st, \"Pattern\")\n for (let param of node.params)\n c(param, st, \"Pattern\")\n c(node.body, st, node.expression ? \"Expression\" : \"Statement\")\n}\n\nbase.Pattern = (node, st, c) => {\n if (node.type === \"Identifier\")\n c(node, st, \"VariablePattern\")\n else if (node.type === \"MemberExpression\")\n c(node, st, \"MemberPattern\")\n else\n c(node, st)\n}\nbase.VariablePattern = ignore\nbase.MemberPattern = skipThrough\nbase.RestElement = (node, st, c) => c(node.argument, st, \"Pattern\")\nbase.ArrayPattern = (node, st, c) => {\n for (let elt of node.elements) {\n if (elt) c(elt, st, \"Pattern\")\n }\n}\nbase.ObjectPattern = (node, st, c) => {\n for (let prop of node.properties) {\n if (prop.type === \"Property\") {\n if (prop.computed) c(prop.key, st, \"Expression\")\n c(prop.value, st, \"Pattern\")\n } else if (prop.type === \"RestElement\") {\n c(prop.argument, st, \"Pattern\")\n }\n }\n}\n\nbase.Expression = skipThrough\nbase.ThisExpression = base.Super = base.MetaProperty = ignore\nbase.ArrayExpression = (node, st, c) => {\n for (let elt of node.elements) {\n if (elt) c(elt, st, \"Expression\")\n }\n}\nbase.ObjectExpression = (node, st, c) => {\n for (let prop of node.properties)\n c(prop, st)\n}\nbase.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration\nbase.SequenceExpression = (node, st, c) => {\n for (let expr of node.expressions)\n c(expr, st, \"Expression\")\n}\nbase.TemplateLiteral = (node, st, c) => {\n for (let quasi of node.quasis)\n c(quasi, st)\n\n for (let expr of node.expressions)\n c(expr, st, \"Expression\")\n}\nbase.TemplateElement = ignore\nbase.UnaryExpression = base.UpdateExpression = (node, st, c) => {\n c(node.argument, st, \"Expression\")\n}\nbase.BinaryExpression = base.LogicalExpression = (node, st, c) => {\n c(node.left, st, \"Expression\")\n c(node.right, st, \"Expression\")\n}\nbase.AssignmentExpression = base.AssignmentPattern = (node, st, c) => {\n c(node.left, st, \"Pattern\")\n c(node.right, st, \"Expression\")\n}\nbase.ConditionalExpression = (node, st, c) => {\n c(node.test, st, \"Expression\")\n c(node.consequent, st, \"Expression\")\n c(node.alternate, st, \"Expression\")\n}\nbase.NewExpression = base.CallExpression = (node, st, c) => {\n c(node.callee, st, \"Expression\")\n if (node.arguments)\n for (let arg of node.arguments)\n c(arg, st, \"Expression\")\n}\nbase.MemberExpression = (node, st, c) => {\n c(node.object, st, \"Expression\")\n if (node.computed) c(node.property, st, \"Expression\")\n}\nbase.ExportNamedDeclaration = base.ExportDefaultDeclaration = (node, st, c) => {\n if (node.declaration)\n c(node.declaration, st, node.type === \"ExportNamedDeclaration\" || node.declaration.id ? \"Statement\" : \"Expression\")\n if (node.source) c(node.source, st, \"Expression\")\n}\nbase.ExportAllDeclaration = (node, st, c) => {\n c(node.source, st, \"Expression\")\n}\nbase.ImportDeclaration = (node, st, c) => {\n for (let spec of node.specifiers)\n c(spec, st)\n c(node.source, st, \"Expression\")\n}\nbase.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore\n\nbase.TaggedTemplateExpression = (node, st, c) => {\n c(node.tag, st, \"Expression\")\n c(node.quasi, st, \"Expression\")\n}\nbase.ClassDeclaration = base.ClassExpression = (node, st, c) => c(node, st, \"Class\")\nbase.Class = (node, st, c) => {\n if (node.id) c(node.id, st, \"Pattern\")\n if (node.superClass) c(node.superClass, st, \"Expression\")\n c(node.body, st)\n}\nbase.ClassBody = (node, st, c) => {\n for (let elt of node.body)\n c(elt, st)\n}\nbase.MethodDefinition = base.Property = (node, st, c) => {\n if (node.computed) c(node.key, st, \"Expression\")\n c(node.value, st, \"Expression\")\n}\n"],"names":["let","const"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;AAkBA,AAAO,SAAS,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;EACnE,IAAI,CAAC,WAAW,EAAE,EAAA,WAAW,GAAG,IAAI;GACnC,EAAA,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE;IAC/BA,IAAI,IAAI,GAAG,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAC;IACxD,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAC;IAC9B,IAAI,KAAK,EAAE,EAAA,KAAK,CAAC,IAAI,EAAE,EAAE,EAAC,EAAA;GAC3B,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAC;CAC1B;;;;;AAKD,AAAO,SAAS,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE;EAC3DA,IAAI,SAAS,GAAG,GAAE;EAClB,IAAI,CAAC,WAAW,EAAE,EAAA,WAAW,GAAG,IAAI;GACnC,EAAA,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,E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CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,IAAA;AACpF,IAAI,CAAC,KAAK,GAAG,UAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE;EACzB,IAAI,IAAI,CAAC,EAAE,EAAE,EAAA,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,EAAA;EACtC,IAAI,IAAI,CAAC,UAAU,EAAE,EAAA,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,EAAC,EAAA;EACzD,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAC;EACjB;AACD,IAAI,CAAC,SAAS,GAAG,UAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE;EAC7B,KAAY,kBAAI,IAAI,CAAC,IAAI,yBAAA;IAApB;IAAAA,IAAI,GAAG;;IACV,CAAC,CAAC,GAAG,EAAE,EAAE,EAAC;GAAA;EACb;AACD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,QAAQ,GAAG,UAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE;EACpD,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAA,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,YAAY,EAAC,EAAA;EAChD,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,YAAY,EAAC;CAChC;;;;"} \ No newline at end of file diff --git a/tools/node_modules/acorn-walk/package.json b/tools/node_modules/acorn-walk/package.json new file mode 100644 index 000000000000..d28707faf471 --- /dev/null +++ b/tools/node_modules/acorn-walk/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + "acorn-walk", + "/home/alon/Dev/emscripten/tools" + ] + ], + "_from": "acorn-walk@latest", + "_hasShrinkwrap": false, + "_id": "acorn-walk@6.1.1", + "_inCache": true, + "_installable": true, + "_location": "/acorn-walk", + "_nodeVersion": "10.11.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/acorn-walk_6.1.1_1542099228973_0.491250253564689" + }, + "_npmUser": { + "email": "marijnh@gmail.com", + "name": "marijn" + }, + "_npmVersion": "6.4.1", + "_phantomChildren": {}, + "_requested": { + "name": "acorn-walk", + "raw": "acorn-walk", + "rawSpec": "", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER" + ], + "_resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "_shasum": "d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913", + "_shrinkwrap": null, + "_spec": "acorn-walk", + "_where": "/home/alon/Dev/emscripten/tools", + "bugs": { + "url": "https://github.com/acornjs/acorn/issues" + }, + "dependencies": {}, + "description": "ECMAScript (ESTree) AST walker", + "devDependencies": {}, + "directories": {}, + "dist": { + "fileCount": 8, + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6pEdCRA9TVsSAnZWagAA3v0QAIl5YksIo1U0+joKuD/2\n2W8TTBIwK2prDL+PpnP9bp7eCMFkh3oMip82ENzApni/Cjq/QejQZaOXW1Xv\n/opEPCvGYH4YCB4ykqWccfQBMu/ihZyG4DJHzsDyJ552isWkRbHgI8vZnb6V\ndEdzcyuZ1b0X/+40Blo1LQCPlE1cmUS0aMjAESeCS7VmjkzSbo1n9/20LgIf\nUNAvBcYtC/NGQ31z5ZSzhBLjr9E42bpJfKRKxUT1iNl3TUdzh+a/f5yyrof3\njE2F38/isziXHJu2QsVSmhBVqIxHqM0mz/RI1q6Yh/3yIIQU/0DvX9Eu5qc3\nZ87P674eGw1/pzkV2a5pm405tw9W6YIV0UNj//SLxWoeveLVl5X7WmLB2MTt\na69E3dUAk2HdlH+tc4M0Cqw2Ku6yu7vmrrs5OwZHJIt407iKX9anDHWWa2P/\n69Whc2idmizspsqJadciqXjXATNzMT1PBMj81cp03tWdBh78Yoq2EVts4hS6\nGg6uwMDwIw/9XD4DB/tLUTrBWEuN0Xk4R61J43Uh71Gr5SCXy/3FhKz21Aax\nSBNAWca4Hy8eO6g2awY7nKhvFkNXtciLJOhorrDVf1DQhiAocPIAXGVviwVx\nLw/2nxF2ClMXSNwgZIhYoiXRAJswxxwhsLIOuvMNudpWweCuPP3cbOBHAVkV\n/KrY\r\n=7LVC\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913", + "tarball": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "unpackedSize": 95740 + }, + "engines": { + "node": ">=0.4.0" + }, + "homepage": "https://github.com/acornjs/acorn", + "license": "MIT", + "main": "dist/walk.js", + "maintainers": [ + { + "name": "marijn", + "email": "marijnh@gmail.com" + } + ], + "module": "dist/walk.mjs", + "name": "acorn-walk", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/acornjs/acorn.git" + }, + "scripts": { + "prepare": "cd ..; npm run build:walk" + }, + "version": "6.1.1" +} diff --git a/tools/node_modules/acorn/CHANGELOG.md b/tools/node_modules/acorn/CHANGELOG.md new file mode 100644 index 000000000000..a9a08fc0cb51 --- /dev/null +++ b/tools/node_modules/acorn/CHANGELOG.md @@ -0,0 +1,462 @@ +## 6.0.5 (2019-01-02) + +### Bug fixes + +Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type. + +Don't treat `let` as a keyword when the next token is `{` on the next line. + +Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on. + +## 6.0.4 (2018-11-05) + +### Bug fixes + +Further improvements to tokenizing regular expressions in corner cases. + +## 6.0.3 (2018-11-04) + +### Bug fixes + +Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression. + +Remove stray symlink in the package tarball. + +## 6.0.2 (2018-09-26) + +### Bug fixes + +Fix bug where default expressions could fail to parse inside an object destructuring assignment expression. + +## 6.0.1 (2018-09-14) + +### Bug fixes + +Fix wrong value in `version` export. + +## 6.0.0 (2018-09-14) + +### Bug fixes + +Better handle variable-redefinition checks for catch bindings and functions directly under if statements. + +Forbid `new.target` in top-level arrow functions. + +Fix issue with parsing a regexp after `yield` in some contexts. + +### New features + +The package now comes with TypeScript definitions. + +### Breaking changes + +The default value of the `ecmaVersion` option is now 9 (2018). + +Plugins work differently, and will have to be rewritten to work with this version. + +The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`). + +## 5.7.3 (2018-09-10) + +### Bug fixes + +Fix failure to tokenize regexps after expressions like `x.of`. + +Better error message for unterminated template literals. + +## 5.7.2 (2018-08-24) + +### Bug fixes + +Properly handle `allowAwaitOutsideFunction` in for statements. + +Treat function declarations at the top level of modules like let bindings. + +Don't allow async function declarations as the only statement under a label. + +## 5.7.0 (2018-06-15) + +### New features + +Upgraded to Unicode 11. + +## 5.6.0 (2018-05-31) + +### New features + +Allow U+2028 and U+2029 in string when ECMAVersion >= 10. + +Allow binding-less catch statements when ECMAVersion >= 10. + +Add `allowAwaitOutsideFunction` option for parsing top-level `await`. + +## 5.5.3 (2018-03-08) + +### Bug fixes + +A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps. + +## 5.5.2 (2018-03-08) + +### Bug fixes + +A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0. + +## 5.5.1 (2018-03-06) + +### Bug fixes + +Fix misleading error message for octal escapes in template strings. + +## 5.5.0 (2018-02-27) + +### New features + +The identifier character categorization is now based on Unicode version 10. + +Acorn will now validate the content of regular expressions, including new ES9 features. + +## 5.4.0 (2018-02-01) + +### Bug fixes + +Disallow duplicate or escaped flags on regular expressions. + +Disallow octal escapes in strings in strict mode. + +### New features + +Add support for async iteration. + +Add support for object spread and rest. + +## 5.3.0 (2017-12-28) + +### Bug fixes + +Fix parsing of floating point literals with leading zeroes in loose mode. + +Allow duplicate property names in object patterns. + +Don't allow static class methods named `prototype`. + +Disallow async functions directly under `if` or `else`. + +Parse right-hand-side of `for`/`of` as an assignment expression. + +Stricter parsing of `for`/`in`. + +Don't allow unicode escapes in contextual keywords. + +### New features + +Parsing class members was factored into smaller methods to allow plugins to hook into it. + +## 5.2.1 (2017-10-30) + +### Bug fixes + +Fix a token context corruption bug. + +## 5.2.0 (2017-10-30) + +### Bug fixes + +Fix token context tracking for `class` and `function` in property-name position. + +Make sure `%*` isn't parsed as a valid operator. + +Allow shorthand properties `get` and `set` to be followed by default values. + +Disallow `super` when not in callee or object position. + +### New features + +Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements. + +## 5.1.2 (2017-09-04) + +### Bug fixes + +Disable parsing of legacy HTML-style comments in modules. + +Fix parsing of async methods whose names are keywords. + +## 5.1.1 (2017-07-06) + +### Bug fixes + +Fix problem with disambiguating regexp and division after a class. + +## 5.1.0 (2017-07-05) + +### Bug fixes + +Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`. + +Parse zero-prefixed numbers with non-octal digits as decimal. + +Allow object/array patterns in rest parameters. + +Don't error when `yield` is used as a property name. + +Allow `async` as a shorthand object property. + +### New features + +Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9. + +## 5.0.3 (2017-04-01) + +### Bug fixes + +Fix spurious duplicate variable definition errors for named functions. + +## 5.0.2 (2017-03-30) + +### Bug fixes + +A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error. + +## 5.0.0 (2017-03-28) + +### Bug fixes + +Raise an error for duplicated lexical bindings. + +Fix spurious error when an assignement expression occurred after a spread expression. + +Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions. + +Allow labels in front or `var` declarations, even in strict mode. + +### Breaking changes + +Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`. + +## 4.0.11 (2017-02-07) + +### Bug fixes + +Allow all forms of member expressions to be parenthesized as lvalue. + +## 4.0.10 (2017-02-07) + +### Bug fixes + +Don't expect semicolons after default-exported functions or classes, even when they are expressions. + +Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode. + +## 4.0.9 (2017-02-06) + +### Bug fixes + +Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again. + +## 4.0.8 (2017-02-03) + +### Bug fixes + +Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet. + +## 4.0.7 (2017-02-02) + +### Bug fixes + +Accept invalidly rejected code like `(x).y = 2` again. + +Don't raise an error when a function _inside_ strict code has a non-simple parameter list. + +## 4.0.6 (2017-02-02) + +### Bug fixes + +Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check. + +## 4.0.5 (2017-02-02) + +### Bug fixes + +Disallow parenthesized pattern expressions. + +Allow keywords as export names. + +Don't allow the `async` keyword to be parenthesized. + +Properly raise an error when a keyword contains a character escape. + +Allow `"use strict"` to appear after other string literal expressions. + +Disallow labeled declarations. + +## 4.0.4 (2016-12-19) + +### Bug fixes + +Fix crash when `export` was followed by a keyword that can't be +exported. + +## 4.0.3 (2016-08-16) + +### Bug fixes + +Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode. + +Properly parse properties named `async` in ES2017 mode. + +Fix bug where reserved words were broken in ES2017 mode. + +## 4.0.2 (2016-08-11) + +### Bug fixes + +Don't ignore period or 'e' characters after octal numbers. + +Fix broken parsing for call expressions in default parameter values of arrow functions. + +## 4.0.1 (2016-08-08) + +### Bug fixes + +Fix false positives in duplicated export name errors. + +## 4.0.0 (2016-08-07) + +### Breaking changes + +The default `ecmaVersion` option value is now 7. + +A number of internal method signatures changed, so plugins might need to be updated. + +### Bug fixes + +The parser now raises errors on duplicated export names. + +`arguments` and `eval` can now be used in shorthand properties. + +Duplicate parameter names in non-simple argument lists now always produce an error. + +### New features + +The `ecmaVersion` option now also accepts year-style version numbers +(2015, etc). + +Support for `async`/`await` syntax when `ecmaVersion` is >= 8. + +Support for trailing commas in call expressions when `ecmaVersion` is >= 8. + +## 3.3.0 (2016-07-25) + +### Bug fixes + +Fix bug in tokenizing of regexp operator after a function declaration. + +Fix parser crash when parsing an array pattern with a hole. + +### New features + +Implement check against complex argument lists in functions that enable strict mode in ES7. + +## 3.2.0 (2016-06-07) + +### Bug fixes + +Improve handling of lack of unicode regexp support in host +environment. + +Properly reject shorthand properties whose name is a keyword. + +### New features + +Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object. + +## 3.1.0 (2016-04-18) + +### Bug fixes + +Properly tokenize the division operator directly after a function expression. + +Allow trailing comma in destructuring arrays. + +## 3.0.4 (2016-02-25) + +### Fixes + +Allow update expressions as left-hand-side of the ES7 exponential operator. + +## 3.0.2 (2016-02-10) + +### Fixes + +Fix bug that accidentally made `undefined` a reserved word when parsing ES7. + +## 3.0.0 (2016-02-10) + +### Breaking changes + +The default value of the `ecmaVersion` option is now 6 (used to be 5). + +Support for comprehension syntax (which was dropped from the draft spec) has been removed. + +### Fixes + +`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code. + +A parenthesized class or function expression after `export default` is now parsed correctly. + +### New features + +When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`). + +The identifier character ranges are now based on Unicode 8.0.0. + +Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled. + +## 2.7.0 (2016-01-04) + +### Fixes + +Stop allowing rest parameters in setters. + +Disallow `y` rexexp flag in ES5. + +Disallow `\00` and `\000` escapes in strict mode. + +Raise an error when an import name is a reserved word. + +## 2.6.2 (2015-11-10) + +### Fixes + +Don't crash when no options object is passed. + +## 2.6.0 (2015-11-09) + +### Fixes + +Add `await` as a reserved word in module sources. + +Disallow `yield` in a parameter default value for a generator. + +Forbid using a comma after a rest pattern in an array destructuring. + +### New features + +Support parsing stdin in command-line tool. + +## 2.5.0 (2015-10-27) + +### Fixes + +Fix tokenizer support in the command-line tool. + +Stop allowing `new.target` outside of functions. + +Remove legacy `guard` and `guardedHandler` properties from try nodes. + +Stop allowing multiple `__proto__` properties on an object literal in strict mode. + +Don't allow rest parameters to be non-identifier patterns. + +Check for duplicate paramter names in arrow functions. diff --git a/tools/node_modules/acorn/LICENSE b/tools/node_modules/acorn/LICENSE new file mode 100644 index 000000000000..2c0632b6a7c6 --- /dev/null +++ b/tools/node_modules/acorn/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2018 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/node_modules/acorn/README.md b/tools/node_modules/acorn/README.md new file mode 100644 index 000000000000..e66dac31de22 --- /dev/null +++ b/tools/node_modules/acorn/README.md @@ -0,0 +1,269 @@ +# Acorn + +A tiny, fast JavaScript parser written in JavaScript. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/acornjs/acorn/blob/master/LICENSE). + +You are welcome to +[report bugs](https://github.com/acornjs/acorn/issues) or create pull +requests on [github](https://github.com/acornjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.ternjs.net). + +## Installation + +The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): + +```sh +npm install acorn +``` + +Alternately, you can download the source and build acorn yourself: + +```sh +git clone https://github.com/acornjs/acorn.git +cd acorn +npm install +``` + +## Interface + +**parse**`(input, options)` is the main interface to the library. The +`input` parameter is a string, `options` can be undefined or an object +setting some of the options listed below. The return value will be an +abstract syntax tree object as specified by the [ESTree +spec](https://github.com/estree/estree). + +```javascript +let acorn = require("acorn"); +console.log(acorn.parse("1 + 1")); +``` + +When encountering a syntax error, the parser will raise a +`SyntaxError` object with a meaningful message. The error object will +have a `pos` property that indicates the string offset at which the +error occurred, and a `loc` object that contains a `{line, column}` +object referring to that same position. + +Options can be provided by passing a second argument, which should be +an object containing any of these fields: + +- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be + either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial + support). This influences support for strict mode, the set of + reserved words, and support for new syntax features. Default is 7. + + **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being + implemented by Acorn. Other proposed new features can be implemented + through plugins. + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. This influences global strict mode + and parsing of `import` and `export` declarations. + +- **onInsertedSemicolon**: If given a callback, that callback will be + called whenever a missing semicolon is inserted by the parser. The + callback will be given the character offset of the point where the + semicolon is inserted as argument, and if `locations` is on, also a + `{line, column}` object representing this position. + +- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing + commas. + +- **allowReserved**: If `false`, using a reserved word will generate + an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher + versions. When given the value `"never"`, reserved words and + keywords can also not be used as property names (as in Internet + Explorer's old parser). + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed. + +- **allowAwaitOutsideFunction**: By default, `await` expressions can + only appear inside `async` functions. Setting this option to + `true` allows to have top-level `await` expressions. They are + still not allowed in non-`async` functions, though. + +- **allowHashBang**: When this is enabled (off by default), if the + code starts with the characters `#!` (as in a shellscript), the + first line will be treated as a comment. + +- **locations**: When `true`, each node has a `loc` object attached + with `start` and `end` subobjects, each of which contains the + one-based line and zero-based column numbers in `{line, column}` + form. Default is `false`. + +- **onToken**: If a function is passed for this option, each found + token will be passed in same format as tokens returned from + `tokenizer().getToken()`. + + If array is passed, each found token is pushed to it. + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **onComment**: If a function is passed for this option, whenever a + comment is encountered the function will be called with the + following parameters: + + - `block`: `true` if the comment is a block comment, false if it + is a line comment. + - `text`: The content of the comment. + - `start`: Character offset of the start of the comment. + - `end`: Character offset of the end of the comment. + + When the `locations` options is on, the `{line, column}` locations + of the comment’s start and end are passed as two additional + parameters. + + If array is passed for this option, each found comment is pushed + to it as object in Esprima format: + + ```javascript + { + "type": "Line" | "Block", + "value": "comment text", + "start": Number, + "end": Number, + // If `locations` option is on: + "loc": { + "start": {line: Number, column: Number} + "end": {line: Number, column: Number} + }, + // If `ranges` option is on: + "range": [Number, Number] + } + ``` + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **ranges**: Nodes have their start and end characters offsets + recorded in `start` and `end` properties (directly on the node, + rather than the `loc` object, which holds line/column data. To also + add a + [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) + `range` property holding a `[start, end]` array with the same + numbers, set the `ranges` option to `true`. + +- **program**: It is possible to parse multiple files into a single + AST by passing the tree produced by parsing the first file as the + `program` option in subsequent parses. This will add the toplevel + forms of the parsed file to the "Program" (top) node of an existing + parse tree. + +- **sourceFile**: When the `locations` option is `true`, you can pass + this option to add a `source` attribute in every node’s `loc` + object. Note that the contents of this option are not examined or + processed in any way; you are free to use whatever format you + choose. + +- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property + will be added (regardless of the `location` option) directly to the + nodes, rather than the `loc` object. + +- **preserveParens**: If this option is `true`, parenthesized expressions + are represented by (non-standard) `ParenthesizedExpression` nodes + that have a single `expression` property containing the expression + inside parentheses. + +**parseExpressionAt**`(input, offset, options)` will parse a single +expression in a string, and return its AST. It will not complain if +there is more of the string left after the expression. + +**tokenizer**`(input, options)` returns an object with a `getToken` +method that can be called repeatedly to get the next token, a `{start, +end, type, value}` object (with added `loc` property when the +`locations` option is enabled and `range` property when the `ranges` +option is enabled). When the token's type is `tokTypes.eof`, you +should stop calling the method, since it will keep returning that same +token forever. + +In ES6 environment, returned result can be used as any other +protocol-compliant iterable: + +```javascript +for (let token of acorn.tokenizer(str)) { + // iterate over the tokens +} + +// transform code to array of tokens: +var tokens = [...acorn.tokenizer(str)]; +``` + +**tokTypes** holds an object mapping names to the token type objects +that end up in the `type` properties of tokens. + +**getLineInfo**`(input, offset)` can be used to get a `{line, +column}` object for a given program string and offset. + +### The `Parser` class + +Instances of the **`Parser`** class contain all the state and logic +that drives a parse. It has static methods `parse`, +`parseExpressionAt`, and `tokenizer` that match the top-level +functions by the same name. + +When extending the parser with plugins, you need to call these methods +on the extended version of the class. To extend a parser with plugins, +you can use its static `extend` method. + +```javascript +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +var JSXParser = acorn.Parser.extend(jsx()); +JSXParser.parse("foo()"); +``` + +The `extend` method takes any number of plugin values, and returns a +new `Parser` class that includes the extra parser logic provided by +the plugins. + +## Command line interface + +The `bin/acorn` utility can be used to parse a file from the command +line. It accepts as arguments its input file and the following +options: + +- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version + to parse. Default is version 9. + +- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. + +- `--locations`: Attaches a "loc" object to each node with "start" and + "end" subobjects, each of which contains the one-based line and + zero-based column numbers in `{line, column}` form. + +- `--allow-hash-bang`: If the code starts with the characters #! (as + in a shellscript), the first line will be treated as a comment. + +- `--compact`: No whitespace is used in the AST output. + +- `--silent`: Do not output the AST, just return the exit status. + +- `--help`: Print the usage information and quit. + +The utility spits out the syntax tree as JSON data. + +## Existing plugins + + - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) + +Plugins for ECMAScript proposals: + + - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: + - [`acorn-async-iteration`](https://github.com/acornjs/acorn-async-iteration): Parse [async iteration proposal](https://github.com/tc39/proposal-async-iteration) + - [`acorn-bigint`](https://github.com/acornjs/acorn-bigint): Parse [BigInt proposal](https://github.com/tc39/proposal-bigint) + - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) + - [`acorn-dynamic-import`](https://github.com/kesne/acorn-dynamic-import): Parse [import() proposal](https://github.com/tc39/proposal-dynamic-import) + - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) + - [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator) + - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n diff --git a/tools/node_modules/acorn/bin/acorn b/tools/node_modules/acorn/bin/acorn new file mode 100755 index 000000000000..cf7df46890fd --- /dev/null +++ b/tools/node_modules/acorn/bin/acorn @@ -0,0 +1,4 @@ +#!/usr/bin/env node +'use strict'; + +require('../dist/bin.js'); diff --git a/tools/node_modules/acorn/dist/acorn.d.ts b/tools/node_modules/acorn/dist/acorn.d.ts new file mode 100644 index 000000000000..c6f9841b809a --- /dev/null +++ b/tools/node_modules/acorn/dist/acorn.d.ts @@ -0,0 +1,209 @@ +export as namespace acorn +export = acorn + +declare namespace acorn { + function parse(input: string, options?: Options): Node + + function parseExpressionAt(input: string, pos?: number, options?: Options): Node + + function tokenizer(input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + + interface Options { + ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019 + sourceType?: 'script' | 'module' + onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + allowReserved?: boolean + allowReturnOutsideFunction?: boolean + allowImportExportEverywhere?: boolean + allowAwaitOutsideFunction?: boolean + allowHashBang?: boolean + locations?: boolean + onToken?: ((token: Token) => any) | Token[] + onComment?: (( + isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, + endLoc?: Position + ) => void) | Comment[] + ranges?: boolean + program?: Node + sourceFile?: string + directSourceFile?: string + preserveParens?: boolean + } + + class Parser { + constructor(options: Options, input: string, startPos?: number) + parse(): Node + static parse(input: string, options?: Options): Node + static parseExpressionAt(input: string, pos: number, options?: Options): Node + static tokenizer(input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + static extend(...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser + } + + interface Position { line: number; column: number; offset: number } + + const defaultOptions: Options + + function getLineInfo(input: string, offset: number): Position + + class SourceLocation { + start: Position + end: Position + source?: string | null + constructor(p: Parser, start: Position, end: Position) + } + + class Node { + type: string + start: number + end: number + loc?: SourceLocation + sourceFile?: string + range?: [number, number] + constructor(parser: Parser, pos: number, loc?: SourceLocation) + } + + class TokenType { + label: string + keyword: string + beforeExpr: boolean + startsExpr: boolean + isLoop: boolean + isAssign: boolean + prefix: boolean + postfix: boolean + binop: number + updateContext?: (prevType: TokenType) => void + constructor(label: string, conf?: any) + } + + const tokTypes: { + num: TokenType + regexp: TokenType + string: TokenType + name: TokenType + eof: TokenType + bracketL: TokenType + bracketR: TokenType + braceL: TokenType + braceR: TokenType + parenL: TokenType + parenR: TokenType + comma: TokenType + semi: TokenType + colon: TokenType + dot: TokenType + question: TokenType + arrow: TokenType + template: TokenType + ellipsis: TokenType + backQuote: TokenType + dollarBraceL: TokenType + eq: TokenType + assign: TokenType + incDec: TokenType + prefix: TokenType + logicalOR: TokenType + logicalAND: TokenType + bitwiseOR: TokenType + bitwiseXOR: TokenType + bitwiseAND: TokenType + equality: TokenType + relational: TokenType + bitShift: TokenType + plusMin: TokenType + modulo: TokenType + star: TokenType + slash: TokenType + starstar: TokenType + _break: TokenType + _case: TokenType + _catch: TokenType + _continue: TokenType + _debugger: TokenType + _default: TokenType + _do: TokenType + _else: TokenType + _finally: TokenType + _for: TokenType + _function: TokenType + _if: TokenType + _return: TokenType + _switch: TokenType + _throw: TokenType + _try: TokenType + _var: TokenType + _const: TokenType + _while: TokenType + _with: TokenType + _new: TokenType + _this: TokenType + _super: TokenType + _class: TokenType + _extends: TokenType + _export: TokenType + _import: TokenType + _null: TokenType + _true: TokenType + _false: TokenType + _in: TokenType + _instanceof: TokenType + _typeof: TokenType + _void: TokenType + _delete: TokenType + } + + class TokContext { + constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void) + } + + const tokContexts: { + b_stat: TokContext + b_expr: TokContext + b_tmpl: TokContext + p_stat: TokContext + p_expr: TokContext + q_tmpl: TokContext + f_expr: TokContext + } + + function isIdentifierStart(code: number, astral?: boolean): boolean + + function isIdentifierChar(code: number, astral?: boolean): boolean + + interface AbstractToken { + } + + interface Comment extends AbstractToken { + type: string + value: string + start: number + end: number + loc?: SourceLocation + range?: [number, number] + } + + class Token { + type: TokenType + value: any + start: number + end: number + loc?: SourceLocation + range?: [number, number] + constructor(p: Parser) + } + + function isNewLine(code: number): boolean + + const lineBreak: RegExp + + const lineBreakG: RegExp + + const version: string +} diff --git a/tools/node_modules/acorn/dist/acorn.js b/tools/node_modules/acorn/dist/acorn.js new file mode 100644 index 000000000000..df8576ac4e63 --- /dev/null +++ b/tools/node_modules/acorn/dist/acorn.js @@ -0,0 +1,5333 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.acorn = {}))); +}(this, (function (exports) { 'use strict'; + +// Reserved word lists for various dialects of the language + +var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" +}; + +// And the keywords + +var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + +var keywords = { + 5: ecma5AndLessKeywords, + 6: ecma5AndLessKeywords + " const class extends export import super" +}; + +var keywordRelationalOperator = /^in(stanceof)?$/; + +// ## Character categories + +// Big ugly regular expressions that match characters in the +// whitespace, identifier, and identifier-start categories. These +// are only applied when a character is found to actually have a +// code point above 128. +// Generated by `bin/generate-identifier-regex.js`. + +var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7b9\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + +// These are a run-length and offset encoded representation of the +// >0xffff code points that are a valid part of identifiers. The +// offset starts at 0x10000, and each pair of numbers represents an +// offset to the next range, and then a size of the range. They were +// generated by bin/generate-identifier-regex.js + +// eslint-disable-next-line comma-spacing +var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; + +// eslint-disable-next-line comma-spacing +var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]; + +// This has a complexity linear to the value of the code. The +// assumption is that looking up astral identifier characters is +// rare. +function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } +} + +// Test whether a given character code starts an identifier. + +function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) +} + +// Test whether a given character is part of an identifier. + +function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) +} + +// ## Token types + +// The assignment of fine-grained, information-carrying type objects +// allows the tokenizer to store the information it has about a +// token in a way that is very cheap for the parser to look up. + +// All token type variables start with an underscore, to make them +// easy to recognize. + +// The `beforeExpr` property is used to disambiguate between regular +// expressions and divisions. It is set on all token types that can +// be followed by an expression (thus, a slash after them would be a +// regular expression). +// +// The `startsExpr` property is used to check if the token ends a +// `yield` expression. It is set on all token types that either can +// directly start an expression (like a quotation mark) or can +// continue an expression (like the body of a string). +// +// `isLoop` marks a keyword as starting a loop, which is important +// to know when parsing a label, in order to allow or disallow +// continue jumps to that label. + +var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; +}; + +function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) +} +var beforeExpr = {beforeExpr: true}; +var startsExpr = {startsExpr: true}; + +// Map keyword names to token types. + +var keywords$1 = {}; + +// Succinct definitions of keyword token types +function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) +} + +var types = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import"), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) +}; + +// Matches a whole line break (where CRLF is considered a single +// line break). Used to count lines. + +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); + +function isNewLine(code, ecma2019String) { + return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) +} + +var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + +var ref = Object.prototype; +var hasOwnProperty = ref.hasOwnProperty; +var toString = ref.toString; + +// Checks if an object has a property. + +function has(obj, propName) { + return hasOwnProperty.call(obj, propName) +} + +var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" +); }); + +// These are used when `options.locations` is on, for the +// `startLoc` and `endLoc` properties. + +var Position = function Position(line, col) { + this.line = line; + this.column = col; +}; + +Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) +}; + +var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } +}; + +// The `getLineInfo` function is mostly useful when the +// `locations` option is off (for performance reasons) and you +// want to find the line/column position for a given character +// offset. `input` should be the code string that the offset refers +// into. + +function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur) + } + } +} + +// A second optional argument can be given to further configure +// the parser process. These options are recognized: + +var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 + // (2019). This influences support for strict mode, the set of + // reserved words, and support for new syntax features. The default + // is 9. + ecmaVersion: 9, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // the position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false +}; + +// Interpret and default an options object + +function getOptions(opts) { + var options = {}; + + for (var opt in defaultOptions) + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + + if (options.ecmaVersion >= 2015) + { options.ecmaVersion -= 2009; } + + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } + + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; + } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } + + return options +} + +function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } +} + +// Each scope gets a bitset that may contain these flags +var SCOPE_TOP = 1; +var SCOPE_FUNCTION = 2; +var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION; +var SCOPE_ASYNC = 4; +var SCOPE_GENERATOR = 8; +var SCOPE_ARROW = 16; +var SCOPE_SIMPLE_CATCH = 32; +var SCOPE_SUPER = 64; +var SCOPE_DIRECT_SUPER = 128; + +function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) +} + +// Used in checkLVal and declareName to determine the type of a binding +var BIND_NONE = 0; +var BIND_VAR = 1; +var BIND_LEXICAL = 2; +var BIND_FUNCTION = 3; +var BIND_SIMPLE_CATCH = 4; +var BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + +function keywordRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") +} + +var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); + var reserved = ""; + if (!options.allowReserved) { + for (var v = options.ecmaVersion;; v--) + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType === "module") { reserved += " await"; } + } + this.reservedWords = keywordRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = keywordRegexp(reservedStrict); + this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = 0; + // Labels in scope. + this.labels = []; + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + + // For RegExp validation + this.regexpState = null; +}; + +var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true } }; + +Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) +}; + +prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; +prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; +prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; +prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; +prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + +// Switch to a getter for 7.0.0. +Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; + +Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; + + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls +}; + +Parser.parse = function parse (input, options) { + return new this(options, input).parse() +}; + +Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() +}; + +Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) +}; + +Object.defineProperties( Parser.prototype, prototypeAccessors ); + +var pp = Parser.prototype; + +// ## Parser utilities + +var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/; +pp.strictDirective = function(start) { + var this$1 = this; + + for (;;) { + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this$1.input)[0].length; + var match = literal.exec(this$1.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) === "use strict") { return true } + start += match[0].length; + } +}; + +// Predicate that tests whether the next token is of the given +// type, and if yes, consumes it as a side effect. + +pp.eat = function(type) { + if (this.type === type) { + this.next(); + return true + } else { + return false + } +}; + +// Tests whether parsed token is a contextual keyword. + +pp.isContextual = function(name) { + return this.type === types.name && this.value === name && !this.containsEsc +}; + +// Consumes contextual keyword if possible. + +pp.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true +}; + +// Asserts that following token is given contextual keyword. + +pp.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } +}; + +// Test whether a semicolon can be inserted at the current position. + +pp.canInsertSemicolon = function() { + return this.type === types.eof || + this.type === types.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) +}; + +pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true + } +}; + +// Consume a semicolon, or, failing that, see if we are allowed to +// pretend that there is a semicolon at this position. + +pp.semicolon = function() { + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } +}; + +pp.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true + } +}; + +// Expect a token of a given type. If found, consume it, otherwise, +// raise an unexpected token error. + +pp.expect = function(type) { + this.eat(type) || this.unexpected(); +}; + +// Raise an unexpected token error. + +pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); +}; + +function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; +} + +pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } +}; + +pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } +}; + +pp.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } +}; + +pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" +}; + +var pp$1 = Parser.prototype; + +// ### Statement parsing + +// Parse a program. Initializes the parser, reads any number of +// statements, and wraps them in a Program node. Optionally takes a +// `program` argument. If present, the statements will be appended +// to its body instead of creating a new node. + +pp$1.parseTopLevel = function(node) { + var this$1 = this; + + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this$1.parseStatement(null, true, exports); + node.body.push(stmt); + } + this.adaptDirectivePrologue(node.body); + this.next(); + if (this.options.ecmaVersion >= 6) { + node.sourceType = this.options.sourceType; + } + return this.finishNode(node, "Program") +}; + +var loopLabel = {kind: "loop"}; +var switchLabel = {kind: "switch"}; + +pp$1.isLet = function() { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 123 && !lineBreak.test(this.input.slice(this.end, next)) // '{' + || nextCh === 91) { return true } // '[' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false +}; + +// check 'async [no LineTerminator here] function' +// - 'async /*foo*/ function' is OK. +// - 'async /*\n*/ function' is invalid. +pp$1.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } + + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) +}; + +// Parse a single statement. +// +// If expecting a statement and finding a slash operator, parse a +// regular expression literal. This is to handle cases like +// `if (foo) /blah/.exec(foo)`, where looking at the previous token +// does not help. + +pp$1.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + + if (this.isLet()) { + starttype = types._var; + kind = "let"; + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + if ((context && (this.strict || context !== "if")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) + case types._class: + if (context) { this.unexpected(); } + return this.parseClass(node, true) + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (context && kind !== "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock(true, node) + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } + } + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (context) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true, !context) + } + + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr, context) } + else { return this.parseExpressionStatement(node, expr) } + } +}; + +pp$1.parseBreakContinueStatement = function(node, keyword) { + var this$1 = this; + + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this$1.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } + } + } + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") +}; + +pp$1.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") +}; + +pp$1.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") +}; + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. + +pp$1.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 && + !(kind !== "var" && init$1.declarations[0].init)) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) +}; + +pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) +}; + +pp$1.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement") +}; + +pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") +}; + +pp$1.parseSwitchStatement = function(node) { + var this$1 = this; + + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + var cur; + for (var sawDefault = false; this.type !== types.braceR;) { + if (this$1.type === types._case || this$1.type === types._default) { + var isCase = this$1.type === types._case; + if (cur) { this$1.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this$1.startNode()); + cur.consequent = []; + this$1.next(); + if (isCase) { + cur.test = this$1.parseExpression(); + } else { + if (sawDefault) { this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; + } + this$1.expect(types.colon); + } else { + if (!cur) { this$1.unexpected(); } + cur.consequent.push(this$1.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") +}; + +pp$1.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") +}; + +// Reused empty array added for node fields that are always empty. + +var empty = []; + +pp$1.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types.parenR); + } else { + if (this.options.ecmaVersion < 10) { this.unexpected(); } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") +}; + +pp$1.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") +}; + +pp$1.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") +}; + +pp$1.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement") +}; + +pp$1.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") +}; + +pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + var this$1 = this; + + for (var i$1 = 0, list = this$1.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this$1.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this$1.labels[i]; + if (label$1.statementStart === node.start) { + // Update information about previous labels on this node + label$1.statementStart = this$1.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(context); + if (node.body.type === "ClassDeclaration" || + node.body.type === "VariableDeclaration" && node.body.kind !== "var" || + node.body.type === "FunctionDeclaration" && (this.strict || node.body.generator || node.body.async)) + { this.raiseRecoverable(node.body.start, "Invalid labeled declaration"); } + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") +}; + +pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") +}; + +// Parse a semicolon-enclosed block of statements, handling `"use +// strict"` declarations when `allowStrict` is true (used for +// function bodies). + +pp$1.parseBlock = function(createNewLexicalScope, node) { + var this$1 = this; + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); + + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { this.enterScope(0); } + while (!this.eat(types.braceR)) { + var stmt = this$1.parseStatement(null); + node.body.push(stmt); + } + if (createNewLexicalScope) { this.exitScope(); } + return this.finishNode(node, "BlockStatement") +}; + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +pp$1.parseFor = function(node, init) { + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + this.exitScope(); + node.body = this.parseStatement("for"); + this.labels.pop(); + return this.finishNode(node, "ForStatement") +}; + +// Parse a `for`/`in` and `for`/`of` loop, which are almost +// same from parser's perspective. + +pp$1.parseForIn = function(node, init) { + var type = this.type === types._in ? "ForInStatement" : "ForOfStatement"; + this.next(); + if (type === "ForInStatement") { + if (init.type === "AssignmentPattern" || + (init.type === "VariableDeclaration" && init.declarations[0].init != null && + (this.strict || init.declarations[0].id.type !== "Identifier"))) + { this.raise(init.start, "Invalid assignment in for-in loop head"); } + } + node.left = init; + node.right = type === "ForInStatement" ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + this.exitScope(); + node.body = this.parseStatement("for"); + this.labels.pop(); + return this.finishNode(node, type) +}; + +// Parse a list of variable declarations. + +pp$1.parseVar = function(node, isFor, kind) { + var this$1 = this; + + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this$1.startNode(); + this$1.parseVarId(decl, kind); + if (this$1.eat(types.eq)) { + decl.init = this$1.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this$1.type === types._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) { + this$1.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this$1.type === types._in || this$1.isContextual("of")))) { + this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this$1.finishNode(decl, "VariableDeclarator")); + if (!this$1.eat(types.comma)) { break } + } + return node +}; + +pp$1.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(kind); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); +}; + +var FUNC_STATEMENT = 1; +var FUNC_HANGING_STATEMENT = 2; +var FUNC_NULLABLE_ID = 4; + +// Parse a function declaration or literal (depending on the +// `isStatement` parameter). + +pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) + { node.generator = this.eat(types.star); } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + { this.checkLVal(node.id, this.inModule && !this.inFunction ? BIND_LEXICAL : BIND_FUNCTION); } + } + + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + + if (!(statement & FUNC_STATEMENT)) + { node.id = this.type === types.name ? this.parseIdent() : null; } + + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") +}; + +pp$1.parseFunctionParams = function(node) { + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); +}; + +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). + +pp$1.parseClass = function(node, isStatement) { + var this$1 = this; + + this.next(); + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + var element = this$1.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this$1.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } + } + } + node.body = this.finishNode(classBody, "ClassBody"); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") +}; + +pp$1.parseClassElement = function(constructorAllowsSuper) { + var this$1 = this; + + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1.start, startLoc = this$1.startLoc; + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (method.key) { this$1.unexpected(); } + method.computed = false; + method.key = this$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1.finishNode(method.key, "Identifier"); + return false + }; + + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } + } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + var allowsDirectSuper = false; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + allowsDirectSuper = constructorAllowsSuper; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method +}; + +pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + return this.finishNode(method, "MethodDefinition") +}; + +pp$1.parseClassId = function(node, isStatement) { + node.id = this.type === types.name ? this.parseIdent() : isStatement === true ? this.unexpected() : null; +}; + +pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; +}; + +// Parses module export declaration. + +pp$1.parseExport = function(node, exports) { + var this$1 = this; + + this.next(); + // export * from '...' + if (this.eat(types.star)) { + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync, true); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + // check for keywords used as local names + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + var spec = list[i]; + + this$1.checkUnreserved(spec.local); + } + + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") +}; + +pp$1.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; +}; + +pp$1.checkPatternExport = function(exports, pat) { + var this$1 = this; + + var type = pat.type; + if (type === "Identifier") + { this.checkExport(exports, pat.name, pat.start); } + else if (type === "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkPatternExport(exports, prop); + } } + else if (type === "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this$1.checkPatternExport(exports, elt); } + } } + else if (type === "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type === "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type === "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type === "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } +}; + +pp$1.checkVariableExport = function(exports, decls) { + var this$1 = this; + + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this$1.checkPatternExport(exports, decl.id); + } +}; + +pp$1.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() +}; + +// Parses a comma-separated list of module exports. + +pp$1.parseExportSpecifiers = function(exports) { + var this$1 = this; + + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node = this$1.startNode(); + node.local = this$1.parseIdent(true); + node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local; + this$1.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this$1.finishNode(node, "ExportSpecifier")); + } + return nodes +}; + +// Parses import declaration. + +pp$1.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") +}; + +// Parses a comma-separated list of module imports. + +pp$1.parseImportSpecifiers = function() { + var this$1 = this; + + var nodes = [], first = true; + if (this.type === types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } + } + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node$2 = this$1.startNode(); + node$2.imported = this$1.parseIdent(true); + if (this$1.eatContextual("as")) { + node$2.local = this$1.parseIdent(); + } else { + this$1.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this$1.checkLVal(node$2.local, BIND_LEXICAL); + nodes.push(this$1.finishNode(node$2, "ImportSpecifier")); + } + return nodes +}; + +// Set `ExpressionStatement#directive` property for directive prologues. +pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } +}; +pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) +}; + +var pp$2 = Parser.prototype; + +// Convert existing expression atom to assignable pattern +// if possible. + +pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + var this$1 = this; + + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Can not use 'await' as identifier inside an async function"); } + break + + case "ObjectPattern": + case "ArrayPattern": + case "RestElement": + break + + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this$1.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this$1.raise(prop.argument.start, "Unexpected token"); + } + } + break + + case "Property": + // AssignmentProperty has type === "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break + + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern + + case "AssignmentPattern": + break + + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break + + case "MemberExpression": + if (!isBinding) { break } + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node +}; + +// Convert list of expression atoms to binding list. + +pp$2.toAssignableList = function(exprList, isBinding) { + var this$1 = this; + + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this$1.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } + } + return exprList +}; + +// Parses spread element. + +pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") +}; + +pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } + + node.argument = this.parseBindingAtom(); + + return this.finishNode(node, "RestElement") +}; + +// Parses lvalue (assignable) atom. + +pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") + + case types.braceL: + return this.parseObj(true) + } + } + return this.parseIdent() +}; + +pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var this$1 = this; + + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this$1.expect(types.comma); } + if (allowEmpty && this$1.type === types.comma) { + elts.push(null); + } else if (allowTrailingComma && this$1.afterTrailingComma(close)) { + break + } else if (this$1.type === types.ellipsis) { + var rest = this$1.parseRestBinding(); + this$1.parseBindingListItem(rest); + elts.push(rest); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } + this$1.expect(close); + break + } else { + var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc); + this$1.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts +}; + +pp$2.parseBindingListItem = function(param) { + return param +}; + +// Parses assignment pattern around given atom if possible. + +pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") +}; + +// Verify that a node is an lval — something that can be assigned +// to. +// bindingType can be either: +// 'var' indicating that the lval creates a 'var' binding +// 'let' indicating that the lval creates a lexical ('let' or 'const') binding +// 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references + +pp$2.checkLVal = function(expr, bindingType, checkClashes) { + var this$1 = this; + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (checkClashes) { + if (has(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + break + + case "MemberExpression": + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkLVal(prop, bindingType, checkClashes); + } + break + + case "Property": + // AssignmentProperty has type === "Property" + this.checkLVal(expr.value, bindingType, checkClashes); + break + + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this$1.checkLVal(elem, bindingType, checkClashes); } + } + break + + case "AssignmentPattern": + this.checkLVal(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLVal(expr.argument, bindingType, checkClashes); + break + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, bindingType, checkClashes); + break + + default: + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); + } +}; + +// A recursive descent parser operates by defining functions for all +// syntactic elements, and recursively calling those, each function +// advancing the input stream and returning an AST node. Precedence +// of constructs (for example, the fact that `!x[1]` means `!(x[1])` +// instead of `(!x)[1]` is handled by the fact that the parser +// function that parses unary prefix operators is called first, and +// in turn calls the function that parses `[]` subscripts — that +// way, it'll receive the node for `x[1]` already parsed, and wraps +// *that* in the unary operator node. +// +// Acorn uses an [operator precedence parser][opp] to handle binary +// operator precedence, because it is much more compact than using +// the technique outlined above, which uses different, nesting +// functions to specify precedence, for all of the ten binary +// precedence levels that JavaScript defines. +// +// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + +var pp$3 = Parser.prototype; + +// Check if property name clashes with already added. +// Object/class getters and setters are not allowed to clash — +// either with each other or with an init property — and in +// strict mode, init properties are also not allowed to be repeated. + +pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; +}; + +// ### Expression parsing + +// These nest, from the most general expression type at the top to +// 'atomic', nondivisible expression types at the bottom. Most of +// the functions will simply let the function(s) below them parse, +// and, *if* the syntactic construct they handle is present, wrap +// the AST node that the inner parser gave them in another node. + +// Parse a full expression. The optional arguments are used to +// forbid the `in` operator (in for loops initalization expressions) +// and provide reference for storing '=' operator inside shorthand +// property assignment in contexts where both object expression +// and object pattern might appear (so it's possible to raise +// delayed syntax error at correct position). + +pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr +}; + +// Parse an assignment expression. This includes applications of +// operators like `+=`. + +pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield() } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } + } + + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldShorthandAssign = refDestructuringErrors.shorthandAssign; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } + + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types.parenL || this.type === types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } + refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; } + return left +}; + +// Parse a ternary conditional (`?:`) operator. + +pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression") + } + return expr +}; + +// Start the precedence parser. + +pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) +}; + +// Parse binary operators with the operator precedence parsing +// algorithm. `left` is the left-hand side of the operator. +// `minPrec` provides context that allows the function to stop and +// defer further parser to one of its callers when it encounters an +// operator that has a lower precedence than the set it is parsing. + +pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { + if (prec > minPrec) { + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left +}; + +pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") +}; + +// Parse unary operators, both prefix and postfix. + +pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { + expr = this.parseAwait(); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else { + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this$1.startNodeAt(startPos, startLoc); + node$1.operator = this$1.value; + node$1.prefix = false; + node$1.argument = expr; + this$1.checkLVal(expr); + this$1.next(); + expr = this$1.finishNode(node$1, "UpdateExpression"); + } + } + + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } + else + { return expr } +}; + +// Parse call, dot, and `[]`-subscript expressions. + +pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + } + return result +}; + +pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var this$1 = this; + + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; + for (var computed = (void 0);;) { + if ((computed = this$1.eat(types.bracketL)) || this$1.eat(types.dot)) { + var node = this$1.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this$1.parseExpression() : this$1.parseIdent(true); + node.computed = !!computed; + if (computed) { this$1.expect(types.bracketR); } + base = this$1.finishNode(node, "MemberExpression"); + } else if (!noCalls && this$1.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this$1.yieldPos, oldAwaitPos = this$1.awaitPos; + this$1.yieldPos = 0; + this$1.awaitPos = 0; + var exprList = this$1.parseExprList(types.parenR, this$1.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !this$1.canInsertSemicolon() && this$1.eat(types.arrow)) { + this$1.checkPatternErrors(refDestructuringErrors, false); + this$1.checkYieldAwaitInDefaultParams(); + this$1.yieldPos = oldYieldPos; + this$1.awaitPos = oldAwaitPos; + return this$1.parseArrowExpression(this$1.startNodeAt(startPos, startLoc), exprList, true) + } + this$1.checkExpressionErrors(refDestructuringErrors, true); + this$1.yieldPos = oldYieldPos || this$1.yieldPos; + this$1.awaitPos = oldAwaitPos || this$1.awaitPos; + var node$1 = this$1.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + base = this$1.finishNode(node$1, "CallExpression"); + } else if (this$1.type === types.backQuote) { + var node$2 = this$1.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this$1.parseTemplate({isTagged: true}); + base = this$1.finishNode(node$2, "TaggedTemplateExpression"); + } else { + return base + } + } +}; + +// Parse an atomic expression — either a single token that is an +// expression, an expression started by a keyword like `function` or +// `new`, or an expression wrapped in punctuation like `()`, `[]`, +// or `{}`. + +pp$3.parseExprAtom = function(refDestructuringErrors) { + // If a division operator appears in an expression position, the + // tokenizer got confused, and we force it to read a regexp instead. + if (this.type === types.slash) { this.readRegexp(); } + + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types._super: + if (!this.allowSuper) + { this.raise(this.start, "'super' keyword outside a method"); } + node = this.startNode(); + this.next(); + if (this.type === types.parenL && !this.allowDirectSuper) + { this.raise(node.start, "super() call outside constructor of a subclass"); } + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super Arguments + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") + + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") + + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(this.type !== types.name); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + } + } + return id + + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node + + case types.num: case types.string: + return this.parseLiteral(this.value) + + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") + + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr + + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") + + case types.braceL: + return this.parseObj(false, refDestructuringErrors) + + case types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0) + + case types._class: + return this.parseClass(this.startNode(), false) + + case types._new: + return this.parseNew() + + case types.backQuote: + return this.parseTemplate() + + default: + this.unexpected(); + } +}; + +pp$3.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + this.next(); + return this.finishNode(node, "Literal") +}; + +pp$3.parseParenExpression = function() { + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); + return val +}; + +pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types.parenR) { + first ? first = false : this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; + break + } else if (this$1.type === types.ellipsis) { + spreadStart = this$1.start; + exprList.push(this$1.parseParenItem(this$1.parseRestBinding())); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem)); + } + } + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList) + } + + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } +}; + +pp$3.parseParenItem = function(item) { + return item +}; + +pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) +}; + +// New's precedence is slightly tricky. It must allow its argument to +// be a `[]` or dot subscript expression, but not a call — at least, +// not without wrapping it in parentheses. Thus, it uses the noCalls +// argument to parseSubscripts to prevent it from consuming the +// argument list. + +var empty$1 = []; + +pp$3.parseNew = function() { + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target" || containsEsc) + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } + if (!this.inNonArrowFunction()) + { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty$1; } + return this.finishNode(node, "NewExpression") +}; + +// Parse template expression. + +pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types.backQuote; + return this.finishNode(elem, "TemplateElement") +}; + +pp$3.parseTemplate = function(ref) { + var this$1 = this; + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this$1.type === types.eof) { this$1.raise(this$1.pos, "Unterminated template literal"); } + this$1.expect(types.dollarBraceL); + node.expressions.push(this$1.parseExpression()); + this$1.expect(types.braceR); + node.quasis.push(curElt = this$1.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") +}; + +pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) +}; + +// Parse an object literal or binding pattern. + +pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var this$1 = this; + + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var prop = this$1.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this$1.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") +}; + +pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") +}; + +pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } + + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type !== types.comma && this.type !== types.braceR)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + this.checkUnreserved(prop.key); + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else { this.unexpected(); } +}; + +pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(true) +}; + +// Initialize empty function node. + +pp$3.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } +}; + +// Parse object or class method. + +pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; + + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.finishNode(node, "FunctionExpression") +}; + +// Parse arrow function expression with given parameters. + +pp$3.parseArrowExpression = function(node, params, isAsync) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; + + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.finishNode(node, "ArrowFunctionExpression") +}; + +// Parse function body and check parameters. + +pp$3.parseFunctionBody = function(node, isArrowFunction) { + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; + + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } + + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && this.isSimpleParamList(node.params)); + node.body = this.parseBlock(false); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } + this.strict = oldStrict; +}; + +pp$3.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; + + if (param.type !== "Identifier") { return false + } } + return true +}; + +// Checks function params for various disallowed patterns such as using "eval" +// or "arguments" and duplicate parameters. + +pp$3.checkParams = function(node, allowDuplicates) { + var this$1 = this; + + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this$1.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); + } +}; + +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). + +pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var this$1 = this; + + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(close)) { break } + } else { first = false; } + + var elt = (void 0); + if (allowEmpty && this$1.type === types.comma) + { elt = null; } + else if (this$1.type === types.ellipsis) { + elt = this$1.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this$1.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this$1.start; } + } else { + elt = this$1.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts +}; + +pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Can not use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Can not use 'await' as identifier inside an async function"); } + if (this.keywords.test(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") !== -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Can not use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } +}; + +// Parse the next token as an identifier. If `liberal` is true (used +// when parsing properties), it will also convert keywords into +// identifiers. + +pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (liberal && this.options.allowReserved === "never") { liberal = false; } + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "Identifier"); + if (!liberal) { this.checkUnreserved(node); } + return node +}; + +// Parses yield expression inside generator. + +pp$3.parseYield = function() { + if (!this.yieldPos) { this.yieldPos = this.start; } + + var node = this.startNode(); + this.next(); + if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(); + } + return this.finishNode(node, "YieldExpression") +}; + +pp$3.parseAwait = function() { + if (!this.awaitPos) { this.awaitPos = this.start; } + + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + return this.finishNode(node, "AwaitExpression") +}; + +var pp$4 = Parser.prototype; + +// This function is used to raise exceptions on parse errors. It +// takes an offset integer (into the current `input`) to indicate +// the location of the error, attaches the position to the end +// of the error message, and then raises a `SyntaxError` with that +// message. + +pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err +}; + +pp$4.raiseRecoverable = pp$4.raise; + +pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } +}; + +var pp$5 = Parser.prototype; + +var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; +}; + +// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + +pp$5.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); +}; + +pp$5.exitScope = function() { + this.scopeStack.pop(); +}; + +pp$5.declareName = function(name, bindingType, pos) { + var this$1 = this; + + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + redeclared = scope$2.lexical.indexOf(name) > -1; + scope$2.var.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this$1.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) { redeclared = true; } + scope$3.var.push(name); + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } +}; + +pp$5.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] +}; + +pp$5.currentVarScope = function() { + var this$1 = this; + + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this$1.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } +}; + +// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. +pp$5.currentThisScope = function() { + var this$1 = this; + + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this$1.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } +}; + +var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } +}; + +// Start an AST node, attaching a start offset. + +var pp$6 = Parser.prototype; + +pp$6.startNode = function() { + return new Node(this, this.start, this.startLoc) +}; + +pp$6.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) +}; + +// Finish an AST node, adding `type` and `end` properties. + +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node +} + +pp$6.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) +}; + +// Finish node at given position + +pp$6.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) +}; + +// The algorithm used to determine whether a regexp can appear at a +// given point in the program is loosely based on sweet.js' approach. +// See https://github.com/mozilla/sweet.js/wiki/design + +var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; +}; + +var types$1 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) +}; + +var pp$7 = Parser.prototype; + +pp$7.initialContext = function() { + return [types$1.b_stat] +}; + +pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType === types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + { return true } + if (prevType === types.braceL) + { return parent === types$1.b_stat } + if (prevType === types._var || prevType === types._const || prevType === types.name) + { return false } + return !this.exprAllowed +}; + +pp$7.inGeneratorContext = function() { + var this$1 = this; + + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this$1.context[i]; + if (context.token === "function") + { return context.generator } + } + return false +}; + +pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } +}; + +// Token-specific context update code + +types.parenR.updateContext = types.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; +}; + +types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; +}; + +types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; +}; + +types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; +}; + +types.incDec.updateContext = function() { + // tokExprAllowed stays unchanged +}; + +types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } + else + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; +}; + +types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; +}; + +types.star.updateContext = function(prevType) { + if (prevType === types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } + } + this.exprAllowed = true; +}; + +types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; +}; + +var data = { + "$LONE": [ + "ASCII", + "ASCII_Hex_Digit", + "AHex", + "Alphabetic", + "Alpha", + "Any", + "Assigned", + "Bidi_Control", + "Bidi_C", + "Bidi_Mirrored", + "Bidi_M", + "Case_Ignorable", + "CI", + "Cased", + "Changes_When_Casefolded", + "CWCF", + "Changes_When_Casemapped", + "CWCM", + "Changes_When_Lowercased", + "CWL", + "Changes_When_NFKC_Casefolded", + "CWKCF", + "Changes_When_Titlecased", + "CWT", + "Changes_When_Uppercased", + "CWU", + "Dash", + "Default_Ignorable_Code_Point", + "DI", + "Deprecated", + "Dep", + "Diacritic", + "Dia", + "Emoji", + "Emoji_Component", + "Emoji_Modifier", + "Emoji_Modifier_Base", + "Emoji_Presentation", + "Extender", + "Ext", + "Grapheme_Base", + "Gr_Base", + "Grapheme_Extend", + "Gr_Ext", + "Hex_Digit", + "Hex", + "IDS_Binary_Operator", + "IDSB", + "IDS_Trinary_Operator", + "IDST", + "ID_Continue", + "IDC", + "ID_Start", + "IDS", + "Ideographic", + "Ideo", + "Join_Control", + "Join_C", + "Logical_Order_Exception", + "LOE", + "Lowercase", + "Lower", + "Math", + "Noncharacter_Code_Point", + "NChar", + "Pattern_Syntax", + "Pat_Syn", + "Pattern_White_Space", + "Pat_WS", + "Quotation_Mark", + "QMark", + "Radical", + "Regional_Indicator", + "RI", + "Sentence_Terminal", + "STerm", + "Soft_Dotted", + "SD", + "Terminal_Punctuation", + "Term", + "Unified_Ideograph", + "UIdeo", + "Uppercase", + "Upper", + "Variation_Selector", + "VS", + "White_Space", + "space", + "XID_Continue", + "XIDC", + "XID_Start", + "XIDS" + ], + "General_Category": [ + "Cased_Letter", + "LC", + "Close_Punctuation", + "Pe", + "Connector_Punctuation", + "Pc", + "Control", + "Cc", + "cntrl", + "Currency_Symbol", + "Sc", + "Dash_Punctuation", + "Pd", + "Decimal_Number", + "Nd", + "digit", + "Enclosing_Mark", + "Me", + "Final_Punctuation", + "Pf", + "Format", + "Cf", + "Initial_Punctuation", + "Pi", + "Letter", + "L", + "Letter_Number", + "Nl", + "Line_Separator", + "Zl", + "Lowercase_Letter", + "Ll", + "Mark", + "M", + "Combining_Mark", + "Math_Symbol", + "Sm", + "Modifier_Letter", + "Lm", + "Modifier_Symbol", + "Sk", + "Nonspacing_Mark", + "Mn", + "Number", + "N", + "Open_Punctuation", + "Ps", + "Other", + "C", + "Other_Letter", + "Lo", + "Other_Number", + "No", + "Other_Punctuation", + "Po", + "Other_Symbol", + "So", + "Paragraph_Separator", + "Zp", + "Private_Use", + "Co", + "Punctuation", + "P", + "punct", + "Separator", + "Z", + "Space_Separator", + "Zs", + "Spacing_Mark", + "Mc", + "Surrogate", + "Cs", + "Symbol", + "S", + "Titlecase_Letter", + "Lt", + "Unassigned", + "Cn", + "Uppercase_Letter", + "Lu" + ], + "Script": [ + "Adlam", + "Adlm", + "Ahom", + "Anatolian_Hieroglyphs", + "Hluw", + "Arabic", + "Arab", + "Armenian", + "Armn", + "Avestan", + "Avst", + "Balinese", + "Bali", + "Bamum", + "Bamu", + "Bassa_Vah", + "Bass", + "Batak", + "Batk", + "Bengali", + "Beng", + "Bhaiksuki", + "Bhks", + "Bopomofo", + "Bopo", + "Brahmi", + "Brah", + "Braille", + "Brai", + "Buginese", + "Bugi", + "Buhid", + "Buhd", + "Canadian_Aboriginal", + "Cans", + "Carian", + "Cari", + "Caucasian_Albanian", + "Aghb", + "Chakma", + "Cakm", + "Cham", + "Cherokee", + "Cher", + "Common", + "Zyyy", + "Coptic", + "Copt", + "Qaac", + "Cuneiform", + "Xsux", + "Cypriot", + "Cprt", + "Cyrillic", + "Cyrl", + "Deseret", + "Dsrt", + "Devanagari", + "Deva", + "Duployan", + "Dupl", + "Egyptian_Hieroglyphs", + "Egyp", + "Elbasan", + "Elba", + "Ethiopic", + "Ethi", + "Georgian", + "Geor", + "Glagolitic", + "Glag", + "Gothic", + "Goth", + "Grantha", + "Gran", + "Greek", + "Grek", + "Gujarati", + "Gujr", + "Gurmukhi", + "Guru", + "Han", + "Hani", + "Hangul", + "Hang", + "Hanunoo", + "Hano", + "Hatran", + "Hatr", + "Hebrew", + "Hebr", + "Hiragana", + "Hira", + "Imperial_Aramaic", + "Armi", + "Inherited", + "Zinh", + "Qaai", + "Inscriptional_Pahlavi", + "Phli", + "Inscriptional_Parthian", + "Prti", + "Javanese", + "Java", + "Kaithi", + "Kthi", + "Kannada", + "Knda", + "Katakana", + "Kana", + "Kayah_Li", + "Kali", + "Kharoshthi", + "Khar", + "Khmer", + "Khmr", + "Khojki", + "Khoj", + "Khudawadi", + "Sind", + "Lao", + "Laoo", + "Latin", + "Latn", + "Lepcha", + "Lepc", + "Limbu", + "Limb", + "Linear_A", + "Lina", + "Linear_B", + "Linb", + "Lisu", + "Lycian", + "Lyci", + "Lydian", + "Lydi", + "Mahajani", + "Mahj", + "Malayalam", + "Mlym", + "Mandaic", + "Mand", + "Manichaean", + "Mani", + "Marchen", + "Marc", + "Masaram_Gondi", + "Gonm", + "Meetei_Mayek", + "Mtei", + "Mende_Kikakui", + "Mend", + "Meroitic_Cursive", + "Merc", + "Meroitic_Hieroglyphs", + "Mero", + "Miao", + "Plrd", + "Modi", + "Mongolian", + "Mong", + "Mro", + "Mroo", + "Multani", + "Mult", + "Myanmar", + "Mymr", + "Nabataean", + "Nbat", + "New_Tai_Lue", + "Talu", + "Newa", + "Nko", + "Nkoo", + "Nushu", + "Nshu", + "Ogham", + "Ogam", + "Ol_Chiki", + "Olck", + "Old_Hungarian", + "Hung", + "Old_Italic", + "Ital", + "Old_North_Arabian", + "Narb", + "Old_Permic", + "Perm", + "Old_Persian", + "Xpeo", + "Old_South_Arabian", + "Sarb", + "Old_Turkic", + "Orkh", + "Oriya", + "Orya", + "Osage", + "Osge", + "Osmanya", + "Osma", + "Pahawh_Hmong", + "Hmng", + "Palmyrene", + "Palm", + "Pau_Cin_Hau", + "Pauc", + "Phags_Pa", + "Phag", + "Phoenician", + "Phnx", + "Psalter_Pahlavi", + "Phlp", + "Rejang", + "Rjng", + "Runic", + "Runr", + "Samaritan", + "Samr", + "Saurashtra", + "Saur", + "Sharada", + "Shrd", + "Shavian", + "Shaw", + "Siddham", + "Sidd", + "SignWriting", + "Sgnw", + "Sinhala", + "Sinh", + "Sora_Sompeng", + "Sora", + "Soyombo", + "Soyo", + "Sundanese", + "Sund", + "Syloti_Nagri", + "Sylo", + "Syriac", + "Syrc", + "Tagalog", + "Tglg", + "Tagbanwa", + "Tagb", + "Tai_Le", + "Tale", + "Tai_Tham", + "Lana", + "Tai_Viet", + "Tavt", + "Takri", + "Takr", + "Tamil", + "Taml", + "Tangut", + "Tang", + "Telugu", + "Telu", + "Thaana", + "Thaa", + "Thai", + "Tibetan", + "Tibt", + "Tifinagh", + "Tfng", + "Tirhuta", + "Tirh", + "Ugaritic", + "Ugar", + "Vai", + "Vaii", + "Warang_Citi", + "Wara", + "Yi", + "Yiii", + "Zanabazar_Square", + "Zanb" + ] +}; +Array.prototype.push.apply(data.$LONE, data.General_Category); +data.gc = data.General_Category; +data.sc = data.Script_Extensions = data.scx = data.Script; + +var pp$9 = Parser.prototype; + +var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; +}; + +RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; +}; + +RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); +}; + +// If u flag is given, this returns the code point at the index (it combines a surrogate pair). +// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). +RegExpValidationState.prototype.at = function at (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00 +}; + +RegExpValidationState.prototype.nextIndex = function nextIndex (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return i + 1 + } + return i + 2 +}; + +RegExpValidationState.prototype.current = function current () { + return this.at(this.pos) +}; + +RegExpValidationState.prototype.lookahead = function lookahead () { + return this.at(this.nextIndex(this.pos)) +}; + +RegExpValidationState.prototype.advance = function advance () { + this.pos = this.nextIndex(this.pos); +}; + +RegExpValidationState.prototype.eat = function eat (ch) { + if (this.current() === ch) { + this.advance(); + return true + } + return false +}; + +function codePointToString$1(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) +} + +/** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ +pp$9.validateRegExpFlags = function(state) { + var this$1 = this; + + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this$1.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this$1.raise(state.start, "Duplicate regular expression flag"); + } + } +}; + +/** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ +pp$9.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern +pp$9.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction +pp$9.regexp_disjunction = function(state) { + var this$1 = this; + + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this$1.regexp_alternative(state); + } + + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative +pp$9.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term +pp$9.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } + + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion +pp$9.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } + + state.pos = start; + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier +pp$9.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix +pp$9.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) +}; +pp$9.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom +pp$9.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) +}; +pp$9.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom +pp$9.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier +pp$9.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter +pp$9.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false +}; +function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter +// But eat eager. +pp$9.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter +pp$9.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false +}; + +// GroupSpecifier[U] :: +// [empty] +// `?` GroupName[?U] +pp$9.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } +}; + +// GroupName[U] :: +// `<` RegExpIdentifierName[?U] `>` +// Note: this updates `state.lastStringValue` property with the eaten name. +pp$9.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false +}; + +// RegExpIdentifierName[U] :: +// RegExpIdentifierStart[?U] +// RegExpIdentifierName[?U] RegExpIdentifierPart[?U] +// Note: this updates `state.lastStringValue` property with the eaten name. +pp$9.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + } + return true + } + return false +}; + +// RegExpIdentifierStart[U] :: +// UnicodeIDStart +// `$` +// `_` +// `\` RegExpUnicodeEscapeSequence[?U] +pp$9.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false +}; +function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ +} + +// RegExpIdentifierPart[U] :: +// UnicodeIDContinue +// `$` +// `_` +// `\` RegExpUnicodeEscapeSequence[?U] +// +// +pp$9.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false +}; +function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape +pp$9.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false +}; +pp$9.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape +pp$9.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) +}; +pp$9.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape +pp$9.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter +pp$9.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false +}; +function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence +pp$9.regexp_eatRegExpUnicodeEscapeSequence = function(state) { + var start = state.pos; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + state.switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (state.switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + + return false +}; +function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape +pp$9.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } + + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape +pp$9.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape +pp$9.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } + + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } + + return false +}; +function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) +} + +// UnicodePropertyValueExpression :: +// UnicodePropertyName `=` UnicodePropertyValue +// LoneUnicodePropertyNameOrValue +pp$9.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; + + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false +}; +pp$9.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!data.hasOwnProperty(name) || data[name].indexOf(value) === -1) { + state.raise("Invalid property name"); + } +}; +pp$9.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (data.$LONE.indexOf(nameOrValue) === -1) { + state.raise("Invalid property name"); + } +}; + +// UnicodePropertyName :: +// UnicodePropertyNameCharacters +pp$9.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" +}; +function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ +} + +// UnicodePropertyValue :: +// UnicodePropertyValueCharacters +pp$9.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" +}; +function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) +} + +// LoneUnicodePropertyNameOrValue :: +// UnicodePropertyValueCharacters +pp$9.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass +pp$9.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* [ */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges +// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges +// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash +pp$9.regexp_classRanges = function(state) { + var this$1 = this; + + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this$1.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash +pp$9.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + + var ch = state.current(); + if (ch !== 0x5D /* [ */) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape +pp$9.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } + + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter +pp$9.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence +pp$9.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits +pp$9.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start +}; +function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits +pp$9.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start +}; +function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) +} +function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence +// Allows only 0-377(octal) i.e. 0-255(decimal). +pp$9.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit +pp$9.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false +}; +function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit +// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence +pp$9.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true +}; + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + +var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } +}; + +// ## Tokenizer + +var pp$8 = Parser.prototype; + +// Move to the next token + +pp$8.next = function() { + if (this.options.onToken) + { this.options.onToken(new Token(this)); } + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); +}; + +pp$8.getToken = function() { + this.next(); + return new Token(this) +}; + +// If we're in an ES6 environment, make parsers iterable +if (typeof Symbol !== "undefined") + { pp$8[Symbol.iterator] = function() { + var this$1 = this; + + return { + next: function () { + var token = this$1.getToken(); + return { + done: token.type === types.eof, + value: token + } + } + } + }; } + +// Toggle strict mode. Re-reads the next number or string to please +// pedantic tests (`"use strict"; 010;` should fail). + +pp$8.curContext = function() { + return this.context[this.context.length - 1] +}; + +// Read a single token, updating the parser object's token-related +// properties. + +pp$8.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } +}; + +pp$8.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) +}; + +pp$8.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00 +}; + +pp$8.skipBlockComment = function() { + var this$1 = this; + + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + lineBreakG.lastIndex = start; + var match; + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this$1.curLine; + this$1.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } +}; + +pp$8.skipLineComment = function(startSkip) { + var this$1 = this; + + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this$1.input.charCodeAt(++this$1.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } +}; + +// Called at the start of the parse and after every token. Skips +// whitespace and comments, and. + +pp$8.skipSpace = function() { + var this$1 = this; + + loop: while (this.pos < this.input.length) { + var ch = this$1.input.charCodeAt(this$1.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this$1.pos; + break + case 13: + if (this$1.input.charCodeAt(this$1.pos + 1) === 10) { + ++this$1.pos; + } + case 10: case 8232: case 8233: + ++this$1.pos; + if (this$1.options.locations) { + ++this$1.curLine; + this$1.lineStart = this$1.pos; + } + break + case 47: // '/' + switch (this$1.input.charCodeAt(this$1.pos + 1)) { + case 42: // '*' + this$1.skipBlockComment(); + break + case 47: + this$1.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this$1.pos; + } else { + break loop + } + } + } +}; + +// Called at the end of every token. Sets `end`, `val`, and +// maintains `context` and `exprAllowed`, and skips the space after +// the token, so that the next one's `start` will point at the +// right position. + +pp$8.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); +}; + +// ### Token reading + +// This is the function that is called to fetch the next token. It +// is somewhat obscure, because it works in character codes rather +// than characters, and because operator parsing has been inlined +// into it. +// +// All in the name of speed. +// +pp$8.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types.ellipsis) + } else { + ++this.pos; + return this.finishToken(types.dot) + } +}; + +pp$8.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) +}; + +pp$8.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(tokentype, size) +}; + +pp$8.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) +}; + +pp$8.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) +}; + +pp$8.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) +}; + +pp$8.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) +}; + +pp$8.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `\") && S.newline_before) {\n forward(3);\n skip_line_comment(\"comment4\");\n continue;\n }\n }\n var ch = peek();\n if (!ch) return token(\"eof\");\n var code = ch.charCodeAt(0);\n switch (code) {\n case 34: case 39: return read_string(ch);\n case 46: return handle_dot();\n case 47: {\n var tok = handle_slash();\n if (tok === next_token) continue;\n return tok;\n }\n case 61: return handle_eq_sign();\n case 96: return read_template_characters(true);\n case 123:\n S.brace_counter++;\n break;\n case 125:\n S.brace_counter--;\n if (S.template_braces.length > 0\n && S.template_braces[S.template_braces.length - 1] === S.brace_counter)\n return read_template_characters(false);\n break;\n }\n if (is_digit(code)) return read_num();\n if (PUNC_CHARS(ch)) return token(\"punc\", next());\n if (OPERATOR_CHARS(ch)) return read_operator();\n if (code == 92 || is_identifier_start(ch)) return read_word();\n break;\n }\n parse_error(\"Unexpected character '\" + ch + \"'\");\n }\n\n next_token.next = next;\n next_token.peek = peek;\n\n next_token.context = function(nc) {\n if (nc) S = nc;\n return S;\n };\n\n next_token.add_directive = function(directive) {\n S.directive_stack[S.directive_stack.length - 1].push(directive);\n\n if (S.directives[directive] === undefined) {\n S.directives[directive] = 1;\n } else {\n S.directives[directive]++;\n }\n };\n\n next_token.push_directives_stack = function() {\n S.directive_stack.push([]);\n };\n\n next_token.pop_directives_stack = function() {\n var directives = S.directive_stack[S.directive_stack.length - 1];\n\n for (var i = 0; i < directives.length; i++) {\n S.directives[directives[i]]--;\n }\n\n S.directive_stack.pop();\n };\n\n next_token.has_directive = function(directive) {\n return S.directives[directive] > 0;\n };\n\n return next_token;\n\n}\n\n/* -----[ Parser (constants) ]----- */\n\nvar UNARY_PREFIX = makePredicate([\n \"typeof\",\n \"void\",\n \"delete\",\n \"--\",\n \"++\",\n \"!\",\n \"~\",\n \"-\",\n \"+\"\n]);\n\nvar UNARY_POSTFIX = makePredicate([ \"--\", \"++\" ]);\n\nvar ASSIGNMENT = makePredicate([ \"=\", \"+=\", \"-=\", \"/=\", \"*=\", \"**=\", \"%=\", \">>=\", \"<<=\", \">>>=\", \"|=\", \"^=\", \"&=\" ]);\n\nvar PRECEDENCE = (function(a, ret) {\n for (var i = 0; i < a.length; ++i) {\n var b = a[i];\n for (var j = 0; j < b.length; ++j) {\n ret[b[j]] = i + 1;\n }\n }\n return ret;\n})(\n [\n [\"||\"],\n [\"&&\"],\n [\"|\"],\n [\"^\"],\n [\"&\"],\n [\"==\", \"===\", \"!=\", \"!==\"],\n [\"<\", \">\", \"<=\", \">=\", \"in\", \"instanceof\"],\n [\">>\", \"<<\", \">>>\"],\n [\"+\", \"-\"],\n [\"*\", \"/\", \"%\"],\n [\"**\"]\n ],\n {}\n);\n\nvar ATOMIC_START_TOKEN = makePredicate([ \"atom\", \"num\", \"string\", \"regexp\", \"name\" ]);\n\n/* -----[ Parser ]----- */\n\nfunction parse($TEXT, options) {\n\n options = defaults(options, {\n bare_returns : false,\n ecma : 8,\n expression : false,\n filename : null,\n html5_comments : true,\n module : false,\n shebang : true,\n strict : false,\n toplevel : null,\n }, true);\n\n var S = {\n input : (typeof $TEXT == \"string\"\n ? tokenizer($TEXT, options.filename,\n options.html5_comments, options.shebang)\n : $TEXT),\n token : null,\n prev : null,\n peeked : null,\n in_function : 0,\n in_async : -1,\n in_generator : -1,\n in_directives : true,\n in_loop : 0,\n labels : []\n };\n\n S.token = next();\n\n function is(type, value) {\n return is_token(S.token, type, value);\n }\n\n function peek() { return S.peeked || (S.peeked = S.input()); }\n\n function next() {\n S.prev = S.token;\n\n if (!S.peeked) peek();\n S.token = S.peeked;\n S.peeked = null;\n S.in_directives = S.in_directives && (\n S.token.type == \"string\" || is(\"punc\", \";\")\n );\n return S.token;\n }\n\n function prev() {\n return S.prev;\n }\n\n function croak(msg, line, col, pos) {\n var ctx = S.input.context();\n js_error(msg,\n ctx.filename,\n line != null ? line : ctx.tokline,\n col != null ? col : ctx.tokcol,\n pos != null ? pos : ctx.tokpos);\n }\n\n function token_error(token, msg) {\n croak(msg, token.line, token.col);\n }\n\n function unexpected(token) {\n if (token == null)\n token = S.token;\n token_error(token, \"Unexpected token: \" + token.type + \" (\" + token.value + \")\");\n }\n\n function expect_token(type, val) {\n if (is(type, val)) {\n return next();\n }\n token_error(S.token, \"Unexpected token \" + S.token.type + \" «\" + S.token.value + \"»\" + \", expected \" + type + \" «\" + val + \"»\");\n }\n\n function expect(punc) { return expect_token(\"punc\", punc); }\n\n function has_newline_before(token) {\n return token.nlb || !all(token.comments_before, function(comment) {\n return !comment.nlb;\n });\n }\n\n function can_insert_semicolon() {\n return !options.strict\n && (is(\"eof\") || is(\"punc\", \"}\") || has_newline_before(S.token));\n }\n\n function is_in_generator() {\n return S.in_generator === S.in_function;\n }\n\n function is_in_async() {\n return S.in_async === S.in_function;\n }\n\n function semicolon(optional) {\n if (is(\"punc\", \";\")) next();\n else if (!optional && !can_insert_semicolon()) unexpected();\n }\n\n function parenthesised() {\n expect(\"(\");\n var exp = expression(true);\n expect(\")\");\n return exp;\n }\n\n function embed_tokens(parser) {\n return function() {\n var start = S.token;\n var expr = parser.apply(null, arguments);\n var end = prev();\n expr.start = start;\n expr.end = end;\n return expr;\n };\n }\n\n function handle_regexp() {\n if (is(\"operator\", \"/\") || is(\"operator\", \"/=\")) {\n S.peeked = null;\n S.token = S.input(S.token.value.substr(1)); // force regexp\n }\n }\n\n var statement = embed_tokens(function(is_export_default, is_for_body, is_if_body) {\n handle_regexp();\n switch (S.token.type) {\n case \"string\":\n if (S.in_directives) {\n var token = peek();\n if (S.token.raw.indexOf(\"\\\\\") == -1\n && (is_token(token, \"punc\", \";\")\n || is_token(token, \"punc\", \"}\")\n || has_newline_before(token)\n || is_token(token, \"eof\"))) {\n S.input.add_directive(S.token.value);\n } else {\n S.in_directives = false;\n }\n }\n var dir = S.in_directives, stat = simple_statement();\n return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat;\n case \"template_head\":\n case \"num\":\n case \"regexp\":\n case \"operator\":\n case \"atom\":\n return simple_statement();\n\n case \"name\":\n if (S.token.value == \"async\" && is_token(peek(), \"keyword\", \"function\")) {\n next();\n next();\n if (is_for_body) {\n croak(\"functions are not allowed as the body of a loop\");\n }\n return function_(AST_Defun, false, true, is_export_default);\n }\n if (S.token.value == \"import\" && !is_token(peek(), \"punc\", \"(\")) {\n next();\n var node = import_();\n semicolon();\n return node;\n }\n return is_token(peek(), \"punc\", \":\")\n ? labeled_statement()\n : simple_statement();\n\n case \"punc\":\n switch (S.token.value) {\n case \"{\":\n return new AST_BlockStatement({\n start : S.token,\n body : block_(),\n end : prev()\n });\n case \"[\":\n case \"(\":\n return simple_statement();\n case \";\":\n S.in_directives = false;\n next();\n return new AST_EmptyStatement();\n default:\n unexpected();\n }\n\n case \"keyword\":\n switch (S.token.value) {\n case \"break\":\n next();\n return break_cont(AST_Break);\n\n case \"continue\":\n next();\n return break_cont(AST_Continue);\n\n case \"debugger\":\n next();\n semicolon();\n return new AST_Debugger();\n\n case \"do\":\n next();\n var body = in_loop(statement);\n expect_token(\"keyword\", \"while\");\n var condition = parenthesised();\n semicolon(true);\n return new AST_Do({\n body : body,\n condition : condition\n });\n\n case \"while\":\n next();\n return new AST_While({\n condition : parenthesised(),\n body : in_loop(function() { return statement(false, true); })\n });\n\n case \"for\":\n next();\n return for_();\n\n case \"class\":\n next();\n if (is_for_body) {\n croak(\"classes are not allowed as the body of a loop\");\n }\n if (is_if_body) {\n croak(\"classes are not allowed as the body of an if\");\n }\n return class_(AST_DefClass);\n\n case \"function\":\n next();\n if (is_for_body) {\n croak(\"functions are not allowed as the body of a loop\");\n }\n return function_(AST_Defun, false, false, is_export_default);\n\n case \"if\":\n next();\n return if_();\n\n case \"return\":\n if (S.in_function == 0 && !options.bare_returns)\n croak(\"'return' outside of function\");\n next();\n var value = null;\n if (is(\"punc\", \";\")) {\n next();\n } else if (!can_insert_semicolon()) {\n value = expression(true);\n semicolon();\n }\n return new AST_Return({\n value: value\n });\n\n case \"switch\":\n next();\n return new AST_Switch({\n expression : parenthesised(),\n body : in_loop(switch_body_)\n });\n\n case \"throw\":\n next();\n if (has_newline_before(S.token))\n croak(\"Illegal newline after 'throw'\");\n var value = expression(true);\n semicolon();\n return new AST_Throw({\n value: value\n });\n\n case \"try\":\n next();\n return try_();\n\n case \"var\":\n next();\n var node = var_();\n semicolon();\n return node;\n\n case \"let\":\n next();\n var node = let_();\n semicolon();\n return node;\n\n case \"const\":\n next();\n var node = const_();\n semicolon();\n return node;\n\n case \"with\":\n if (S.input.has_directive(\"use strict\")) {\n croak(\"Strict mode may not include a with statement\");\n }\n next();\n return new AST_With({\n expression : parenthesised(),\n body : statement()\n });\n\n case \"export\":\n if (!is_token(peek(), \"punc\", \"(\")) {\n next();\n var node = export_();\n if (is(\"punc\", \";\")) semicolon();\n return node;\n }\n }\n }\n unexpected();\n });\n\n function labeled_statement() {\n var label = as_symbol(AST_Label);\n if (label.name === \"await\" && is_in_async()) {\n token_error(S.prev, \"await cannot be used as label inside async function\");\n }\n if (find_if(function(l) { return l.name == label.name; }, S.labels)) {\n // ECMA-262, 12.12: An ECMAScript program is considered\n // syntactically incorrect if it contains a\n // LabelledStatement that is enclosed by a\n // LabelledStatement with the same Identifier as label.\n croak(\"Label \" + label.name + \" defined twice\");\n }\n expect(\":\");\n S.labels.push(label);\n var stat = statement();\n S.labels.pop();\n if (!(stat instanceof AST_IterationStatement)) {\n // check for `continue` that refers to this label.\n // those should be reported as syntax errors.\n // https://github.com/mishoo/UglifyJS2/issues/287\n label.references.forEach(function(ref) {\n if (ref instanceof AST_Continue) {\n ref = ref.label.start;\n croak(\"Continue label `\" + label.name + \"` refers to non-IterationStatement.\",\n ref.line, ref.col, ref.pos);\n }\n });\n }\n return new AST_LabeledStatement({ body: stat, label: label });\n }\n\n function simple_statement(tmp) {\n return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) });\n }\n\n function break_cont(type) {\n var label = null, ldef;\n if (!can_insert_semicolon()) {\n label = as_symbol(AST_LabelRef, true);\n }\n if (label != null) {\n ldef = find_if(function(l) { return l.name == label.name; }, S.labels);\n if (!ldef)\n croak(\"Undefined label \" + label.name);\n label.thedef = ldef;\n } else if (S.in_loop == 0)\n croak(type.TYPE + \" not inside a loop or switch\");\n semicolon();\n var stat = new type({ label: label });\n if (ldef) ldef.references.push(stat);\n return stat;\n }\n\n function for_() {\n var for_await_error = \"`for await` invalid in this context\";\n var await_tok = S.token;\n if (await_tok.type == \"name\" && await_tok.value == \"await\") {\n if (!is_in_async()) {\n token_error(await_tok, for_await_error);\n }\n next();\n } else {\n await_tok = false;\n }\n expect(\"(\");\n var init = null;\n if (!is(\"punc\", \";\")) {\n init =\n is(\"keyword\", \"var\") ? (next(), var_(true)) :\n is(\"keyword\", \"let\") ? (next(), let_(true)) :\n is(\"keyword\", \"const\") ? (next(), const_(true)) :\n expression(true, true);\n var is_in = is(\"operator\", \"in\");\n var is_of = is(\"name\", \"of\");\n if (await_tok && !is_of) {\n token_error(await_tok, for_await_error);\n }\n if (is_in || is_of) {\n if (init instanceof AST_Definitions) {\n if (init.definitions.length > 1)\n token_error(init.start, \"Only one variable declaration allowed in for..in loop\");\n } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) {\n token_error(init.start, \"Invalid left-hand side in for..in loop\");\n }\n next();\n if (is_in) {\n return for_in(init);\n } else {\n return for_of(init, !!await_tok);\n }\n }\n } else if (await_tok) {\n token_error(await_tok, for_await_error);\n }\n return regular_for(init);\n }\n\n function regular_for(init) {\n expect(\";\");\n var test = is(\"punc\", \";\") ? null : expression(true);\n expect(\";\");\n var step = is(\"punc\", \")\") ? null : expression(true);\n expect(\")\");\n return new AST_For({\n init : init,\n condition : test,\n step : step,\n body : in_loop(function() { return statement(false, true); })\n });\n }\n\n function for_of(init, is_await) {\n var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null;\n var obj = expression(true);\n expect(\")\");\n return new AST_ForOf({\n await : is_await,\n init : init,\n name : lhs,\n object : obj,\n body : in_loop(function() { return statement(false, true); })\n });\n }\n\n function for_in(init) {\n var obj = expression(true);\n expect(\")\");\n return new AST_ForIn({\n init : init,\n object : obj,\n body : in_loop(function() { return statement(false, true); })\n });\n }\n\n var arrow_function = function(start, argnames, is_async) {\n if (has_newline_before(S.token)) {\n croak(\"Unexpected newline before arrow (=>)\");\n }\n\n expect_token(\"arrow\", \"=>\");\n\n var body = _function_body(is(\"punc\", \"{\"), false, is_async);\n\n var end =\n body instanceof Array && body.length ? body[body.length - 1].end :\n body instanceof Array ? start :\n body.end;\n\n return new AST_Arrow({\n start : start,\n end : end,\n async : is_async,\n argnames : argnames,\n body : body\n });\n };\n\n var function_ = function(ctor, is_generator_property, is_async, is_export_default) {\n var start = S.token;\n\n var in_statement = ctor === AST_Defun;\n var is_generator = is(\"operator\", \"*\");\n if (is_generator) {\n next();\n }\n\n var name = is(\"name\") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null;\n if (in_statement && !name) {\n if (is_export_default) {\n ctor = AST_Function;\n } else {\n unexpected();\n }\n }\n\n if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration))\n unexpected(prev());\n\n var args = [];\n var body = _function_body(true, is_generator || is_generator_property, is_async, name, args);\n return new ctor({\n start : args.start,\n end : body.end,\n is_generator: is_generator,\n async : is_async,\n name : name,\n argnames: args,\n body : body\n });\n };\n\n function track_used_binding_identifiers(is_parameter, strict) {\n var parameters = {};\n var duplicate = false;\n var default_assignment = false;\n var spread = false;\n var strict_mode = !!strict;\n var tracker = {\n add_parameter: function(token) {\n if (parameters[\"$\" + token.value] !== undefined) {\n if (duplicate === false) {\n duplicate = token;\n }\n tracker.check_strict();\n } else {\n parameters[\"$\" + token.value] = true;\n if (is_parameter) {\n switch (token.value) {\n case \"arguments\":\n case \"eval\":\n case \"yield\":\n if (strict_mode) {\n token_error(token, \"Unexpected \" + token.value + \" identifier as parameter inside strict mode\");\n }\n break;\n default:\n if (RESERVED_WORDS(token.value)) {\n unexpected();\n }\n }\n }\n }\n },\n mark_default_assignment: function(token) {\n if (default_assignment === false) {\n default_assignment = token;\n }\n },\n mark_spread: function(token) {\n if (spread === false) {\n spread = token;\n }\n },\n mark_strict_mode: function() {\n strict_mode = true;\n },\n is_strict: function() {\n return default_assignment !== false || spread !== false || strict_mode;\n },\n check_strict: function() {\n if (tracker.is_strict() && duplicate !== false) {\n token_error(duplicate, \"Parameter \" + duplicate.value + \" was used already\");\n }\n }\n };\n\n return tracker;\n }\n\n function parameters(params) {\n var start = S.token;\n var used_parameters = track_used_binding_identifiers(true, S.input.has_directive(\"use strict\"));\n\n expect(\"(\");\n\n while (!is(\"punc\", \")\")) {\n var param = parameter(used_parameters);\n params.push(param);\n\n if (!is(\"punc\", \")\")) {\n expect(\",\");\n if (is(\"punc\", \")\") && options.ecma < 8) unexpected();\n }\n\n if (param instanceof AST_Expansion) {\n break;\n }\n }\n\n next();\n }\n\n function parameter(used_parameters, symbol_type) {\n var param;\n var expand = false;\n if (used_parameters === undefined) {\n used_parameters = track_used_binding_identifiers(true, S.input.has_directive(\"use strict\"));\n }\n if (is(\"expand\", \"...\")) {\n expand = S.token;\n used_parameters.mark_spread(S.token);\n next();\n }\n param = binding_element(used_parameters, symbol_type);\n\n if (is(\"operator\", \"=\") && expand === false) {\n used_parameters.mark_default_assignment(S.token);\n next();\n param = new AST_DefaultAssign({\n start: param.start,\n left: param,\n operator: \"=\",\n right: expression(false),\n end: S.token\n });\n }\n\n if (expand !== false) {\n if (!is(\"punc\", \")\")) {\n unexpected();\n }\n param = new AST_Expansion({\n start: expand,\n expression: param,\n end: expand\n });\n }\n used_parameters.check_strict();\n\n return param;\n }\n\n function binding_element(used_parameters, symbol_type) {\n var elements = [];\n var first = true;\n var is_expand = false;\n var expand_token;\n var first_token = S.token;\n if (used_parameters === undefined) {\n used_parameters = track_used_binding_identifiers(false, S.input.has_directive(\"use strict\"));\n }\n symbol_type = symbol_type === undefined ? AST_SymbolFunarg : symbol_type;\n if (is(\"punc\", \"[\")) {\n next();\n while (!is(\"punc\", \"]\")) {\n if (first) {\n first = false;\n } else {\n expect(\",\");\n }\n\n if (is(\"expand\", \"...\")) {\n is_expand = true;\n expand_token = S.token;\n used_parameters.mark_spread(S.token);\n next();\n }\n if (is(\"punc\")) {\n switch (S.token.value) {\n case \",\":\n elements.push(new AST_Hole({\n start: S.token,\n end: S.token\n }));\n continue;\n case \"]\": // Trailing comma after last element\n break;\n case \"[\":\n case \"{\":\n elements.push(binding_element(used_parameters, symbol_type));\n break;\n default:\n unexpected();\n }\n } else if (is(\"name\")) {\n used_parameters.add_parameter(S.token);\n elements.push(as_symbol(symbol_type));\n } else {\n croak(\"Invalid function parameter\");\n }\n if (is(\"operator\", \"=\") && is_expand === false) {\n used_parameters.mark_default_assignment(S.token);\n next();\n elements[elements.length - 1] = new AST_DefaultAssign({\n start: elements[elements.length - 1].start,\n left: elements[elements.length - 1],\n operator: \"=\",\n right: expression(false),\n end: S.token\n });\n }\n if (is_expand) {\n if (!is(\"punc\", \"]\")) {\n croak(\"Rest element must be last element\");\n }\n elements[elements.length - 1] = new AST_Expansion({\n start: expand_token,\n expression: elements[elements.length - 1],\n end: expand_token\n });\n }\n }\n expect(\"]\");\n used_parameters.check_strict();\n return new AST_Destructuring({\n start: first_token,\n names: elements,\n is_array: true,\n end: prev()\n });\n } else if (is(\"punc\", \"{\")) {\n next();\n while (!is(\"punc\", \"}\")) {\n if (first) {\n first = false;\n } else {\n expect(\",\");\n }\n if (is(\"expand\", \"...\")) {\n is_expand = true;\n expand_token = S.token;\n used_parameters.mark_spread(S.token);\n next();\n }\n if (is(\"name\") && (is_token(peek(), \"punc\") || is_token(peek(), \"operator\")) && [\",\", \"}\", \"=\"].indexOf(peek().value) !== -1) {\n used_parameters.add_parameter(S.token);\n var start = prev();\n var value = as_symbol(symbol_type);\n if (is_expand) {\n elements.push(new AST_Expansion({\n start: expand_token,\n expression: value,\n end: value.end,\n }));\n } else {\n elements.push(new AST_ObjectKeyVal({\n start: start,\n key: value.name,\n value: value,\n end: value.end,\n }));\n }\n } else if (is(\"punc\", \"}\")) {\n continue; // Allow trailing hole\n } else {\n var property_token = S.token;\n var property = as_property_name();\n if (property === null) {\n unexpected(prev());\n } else if (prev().type === \"name\" && !is(\"punc\", \":\")) {\n elements.push(new AST_ObjectKeyVal({\n start: prev(),\n key: property,\n value: new symbol_type({\n start: prev(),\n name: property,\n end: prev()\n }),\n end: prev()\n }));\n } else {\n expect(\":\");\n elements.push(new AST_ObjectKeyVal({\n start: property_token,\n quote: property_token.quote,\n key: property,\n value: binding_element(used_parameters, symbol_type),\n end: prev()\n }));\n }\n }\n if (is_expand) {\n if (!is(\"punc\", \"}\")) {\n croak(\"Rest element must be last element\");\n }\n } else if (is(\"operator\", \"=\")) {\n used_parameters.mark_default_assignment(S.token);\n next();\n elements[elements.length - 1].value = new AST_DefaultAssign({\n start: elements[elements.length - 1].value.start,\n left: elements[elements.length - 1].value,\n operator: \"=\",\n right: expression(false),\n end: S.token\n });\n }\n }\n expect(\"}\");\n used_parameters.check_strict();\n return new AST_Destructuring({\n start: first_token,\n names: elements,\n is_array: false,\n end: prev()\n });\n } else if (is(\"name\")) {\n used_parameters.add_parameter(S.token);\n return as_symbol(symbol_type);\n } else {\n croak(\"Invalid function parameter\");\n }\n }\n\n function params_or_seq_(allow_arrows, maybe_sequence) {\n var spread_token;\n var invalid_sequence;\n var trailing_comma;\n var a = [];\n expect(\"(\");\n while (!is(\"punc\", \")\")) {\n if (spread_token) unexpected(spread_token);\n if (is(\"expand\", \"...\")) {\n spread_token = S.token;\n if (maybe_sequence) invalid_sequence = S.token;\n next();\n a.push(new AST_Expansion({\n start: prev(),\n expression: expression(),\n end: S.token,\n }));\n } else {\n a.push(expression());\n }\n if (!is(\"punc\", \")\")) {\n expect(\",\");\n if (is(\"punc\", \")\")) {\n if (options.ecma < 8) unexpected();\n trailing_comma = prev();\n if (maybe_sequence) invalid_sequence = trailing_comma;\n }\n }\n }\n expect(\")\");\n if (allow_arrows && is(\"arrow\", \"=>\")) {\n if (spread_token && trailing_comma) unexpected(trailing_comma);\n } else if (invalid_sequence) {\n unexpected(invalid_sequence);\n }\n return a;\n }\n\n function _function_body(block, generator, is_async, name, args) {\n var loop = S.in_loop;\n var labels = S.labels;\n var current_generator = S.in_generator;\n var current_async = S.in_async;\n ++S.in_function;\n if (generator)\n S.in_generator = S.in_function;\n if (is_async)\n S.in_async = S.in_function;\n if (args) parameters(args);\n if (block)\n S.in_directives = true;\n S.in_loop = 0;\n S.labels = [];\n if (block) {\n S.input.push_directives_stack();\n var a = block_();\n if (name) _verify_symbol(name);\n if (args) args.forEach(_verify_symbol);\n S.input.pop_directives_stack();\n } else {\n var a = expression(false);\n }\n --S.in_function;\n S.in_loop = loop;\n S.labels = labels;\n S.in_generator = current_generator;\n S.in_async = current_async;\n return a;\n }\n\n function _await_expression() {\n // Previous token must be \"await\" and not be interpreted as an identifier\n if (!is_in_async()) {\n croak(\"Unexpected await expression outside async function\",\n S.prev.line, S.prev.col, S.prev.pos);\n }\n // the await expression is parsed as a unary expression in Babel\n return new AST_Await({\n start: prev(),\n end: S.token,\n expression : maybe_unary(true),\n });\n }\n\n function _yield_expression() {\n // Previous token must be keyword yield and not be interpret as an identifier\n if (!is_in_generator()) {\n croak(\"Unexpected yield expression outside generator function\",\n S.prev.line, S.prev.col, S.prev.pos);\n }\n var start = S.token;\n var star = false;\n var has_expression = true;\n\n // Attempt to get expression or star (and then the mandatory expression)\n // behind yield on the same line.\n //\n // If nothing follows on the same line of the yieldExpression,\n // it should default to the value `undefined` for yield to return.\n // In that case, the `undefined` stored as `null` in ast.\n //\n // Note 1: It isn't allowed for yield* to close without an expression\n // Note 2: If there is a nlb between yield and star, it is interpret as\n // yield *\n if (can_insert_semicolon() ||\n (is(\"punc\") && PUNC_AFTER_EXPRESSION(S.token.value))) {\n has_expression = false;\n\n } else if (is(\"operator\", \"*\")) {\n star = true;\n next();\n }\n\n return new AST_Yield({\n start : start,\n is_star : star,\n expression : has_expression ? expression() : null,\n end : prev()\n });\n }\n\n function if_() {\n var cond = parenthesised(), body = statement(false, false, true), belse = null;\n if (is(\"keyword\", \"else\")) {\n next();\n belse = statement(false, false, true);\n }\n return new AST_If({\n condition : cond,\n body : body,\n alternative : belse\n });\n }\n\n function block_() {\n expect(\"{\");\n var a = [];\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n a.push(statement());\n }\n next();\n return a;\n }\n\n function switch_body_() {\n expect(\"{\");\n var a = [], cur = null, branch = null, tmp;\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n if (is(\"keyword\", \"case\")) {\n if (branch) branch.end = prev();\n cur = [];\n branch = new AST_Case({\n start : (tmp = S.token, next(), tmp),\n expression : expression(true),\n body : cur\n });\n a.push(branch);\n expect(\":\");\n } else if (is(\"keyword\", \"default\")) {\n if (branch) branch.end = prev();\n cur = [];\n branch = new AST_Default({\n start : (tmp = S.token, next(), expect(\":\"), tmp),\n body : cur\n });\n a.push(branch);\n } else {\n if (!cur) unexpected();\n cur.push(statement());\n }\n }\n if (branch) branch.end = prev();\n next();\n return a;\n }\n\n function try_() {\n var body = block_(), bcatch = null, bfinally = null;\n if (is(\"keyword\", \"catch\")) {\n var start = S.token;\n next();\n if (is(\"punc\", \"{\")) {\n var name = null;\n } else {\n expect(\"(\");\n var name = parameter(undefined, AST_SymbolCatch);\n expect(\")\");\n }\n bcatch = new AST_Catch({\n start : start,\n argname : name,\n body : block_(),\n end : prev()\n });\n }\n if (is(\"keyword\", \"finally\")) {\n var start = S.token;\n next();\n bfinally = new AST_Finally({\n start : start,\n body : block_(),\n end : prev()\n });\n }\n if (!bcatch && !bfinally)\n croak(\"Missing catch/finally blocks\");\n return new AST_Try({\n body : body,\n bcatch : bcatch,\n bfinally : bfinally\n });\n }\n\n function vardefs(no_in, kind) {\n var a = [];\n var def;\n for (;;) {\n var sym_type =\n kind === \"var\" ? AST_SymbolVar :\n kind === \"const\" ? AST_SymbolConst :\n kind === \"let\" ? AST_SymbolLet : null;\n if (is(\"punc\", \"{\") || is(\"punc\", \"[\")) {\n def = new AST_VarDef({\n start: S.token,\n name: binding_element(undefined ,sym_type),\n value: is(\"operator\", \"=\") ? (expect_token(\"operator\", \"=\"), expression(false, no_in)) : null,\n end: prev()\n });\n } else {\n def = new AST_VarDef({\n start : S.token,\n name : as_symbol(sym_type),\n value : is(\"operator\", \"=\")\n ? (next(), expression(false, no_in))\n : !no_in && kind === \"const\"\n ? croak(\"Missing initializer in const declaration\") : null,\n end : prev()\n });\n if (def.name.name == \"import\") croak(\"Unexpected token: import\");\n }\n a.push(def);\n if (!is(\"punc\", \",\"))\n break;\n next();\n }\n return a;\n }\n\n var var_ = function(no_in) {\n return new AST_Var({\n start : prev(),\n definitions : vardefs(no_in, \"var\"),\n end : prev()\n });\n };\n\n var let_ = function(no_in) {\n return new AST_Let({\n start : prev(),\n definitions : vardefs(no_in, \"let\"),\n end : prev()\n });\n };\n\n var const_ = function(no_in) {\n return new AST_Const({\n start : prev(),\n definitions : vardefs(no_in, \"const\"),\n end : prev()\n });\n };\n\n var new_ = function(allow_calls) {\n var start = S.token;\n expect_token(\"operator\", \"new\");\n if (is(\"punc\", \".\")) {\n next();\n expect_token(\"name\", \"target\");\n return subscripts(new AST_NewTarget({\n start : start,\n end : prev()\n }), allow_calls);\n }\n var newexp = expr_atom(false), args;\n if (is(\"punc\", \"(\")) {\n next();\n args = expr_list(\")\", options.ecma >= 8);\n } else {\n args = [];\n }\n var call = new AST_New({\n start : start,\n expression : newexp,\n args : args,\n end : prev()\n });\n mark_pure(call);\n return subscripts(call, allow_calls);\n };\n\n function as_atom_node() {\n var tok = S.token, ret;\n switch (tok.type) {\n case \"name\":\n ret = _make_symbol(AST_SymbolRef);\n break;\n case \"num\":\n ret = new AST_Number({ start: tok, end: tok, value: tok.value });\n break;\n case \"string\":\n ret = new AST_String({\n start : tok,\n end : tok,\n value : tok.value,\n quote : tok.quote\n });\n break;\n case \"regexp\":\n ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });\n break;\n case \"atom\":\n switch (tok.value) {\n case \"false\":\n ret = new AST_False({ start: tok, end: tok });\n break;\n case \"true\":\n ret = new AST_True({ start: tok, end: tok });\n break;\n case \"null\":\n ret = new AST_Null({ start: tok, end: tok });\n break;\n }\n break;\n }\n next();\n return ret;\n }\n\n function to_fun_args(ex, _, __, default_seen_above) {\n var insert_default = function(ex, default_value) {\n if (default_value) {\n return new AST_DefaultAssign({\n start: ex.start,\n left: ex,\n operator: \"=\",\n right: default_value,\n end: default_value.end\n });\n }\n return ex;\n };\n if (ex instanceof AST_Object) {\n return insert_default(new AST_Destructuring({\n start: ex.start,\n end: ex.end,\n is_array: false,\n names: ex.properties.map(to_fun_args)\n }), default_seen_above);\n } else if (ex instanceof AST_ObjectKeyVal) {\n ex.value = to_fun_args(ex.value, 0, [ex.key]);\n return insert_default(ex, default_seen_above);\n } else if (ex instanceof AST_Hole) {\n return ex;\n } else if (ex instanceof AST_Destructuring) {\n ex.names = ex.names.map(to_fun_args);\n return insert_default(ex, default_seen_above);\n } else if (ex instanceof AST_SymbolRef) {\n return insert_default(new AST_SymbolFunarg({\n name: ex.name,\n start: ex.start,\n end: ex.end\n }), default_seen_above);\n } else if (ex instanceof AST_Expansion) {\n ex.expression = to_fun_args(ex.expression);\n return insert_default(ex, default_seen_above);\n } else if (ex instanceof AST_Array) {\n return insert_default(new AST_Destructuring({\n start: ex.start,\n end: ex.end,\n is_array: true,\n names: ex.elements.map(to_fun_args)\n }), default_seen_above);\n } else if (ex instanceof AST_Assign) {\n return insert_default(to_fun_args(ex.left, undefined, undefined, ex.right), default_seen_above);\n } else if (ex instanceof AST_DefaultAssign) {\n ex.left = to_fun_args(ex.left, 0, [ex.left]);\n return ex;\n } else {\n croak(\"Invalid function parameter\", ex.start.line, ex.start.col);\n }\n }\n\n var expr_atom = function(allow_calls, allow_arrows) {\n if (is(\"operator\", \"new\")) {\n return new_(allow_calls);\n }\n var start = S.token;\n var peeked;\n var async = is(\"name\", \"async\")\n && (peeked = peek()).value != \"[\"\n && peeked.type != \"arrow\"\n && as_atom_node();\n if (is(\"punc\")) {\n switch (S.token.value) {\n case \"(\":\n if (async && !allow_calls) break;\n var exprs = params_or_seq_(allow_arrows, !async);\n if (allow_arrows && is(\"arrow\", \"=>\")) {\n return arrow_function(start, exprs.map(to_fun_args), !!async);\n }\n var ex = async ? new AST_Call({\n expression: async,\n args: exprs\n }) : exprs.length == 1 ? exprs[0] : new AST_Sequence({\n expressions: exprs\n });\n if (ex.start) {\n var len = start.comments_before.length;\n [].unshift.apply(ex.start.comments_before, start.comments_before);\n start.comments_before = ex.start.comments_before;\n start.comments_before_length = len;\n if (len == 0 && start.comments_before.length > 0) {\n var comment = start.comments_before[0];\n if (!comment.nlb) {\n comment.nlb = start.nlb;\n start.nlb = false;\n }\n }\n start.comments_after = ex.start.comments_after;\n }\n ex.start = start;\n var end = prev();\n if (ex.end) {\n end.comments_before = ex.end.comments_before;\n [].push.apply(ex.end.comments_after, end.comments_after);\n end.comments_after = ex.end.comments_after;\n }\n ex.end = end;\n if (ex instanceof AST_Call) mark_pure(ex);\n return subscripts(ex, allow_calls);\n case \"[\":\n return subscripts(array_(), allow_calls);\n case \"{\":\n return subscripts(object_or_destructuring_(), allow_calls);\n }\n if (!async) unexpected();\n }\n if (allow_arrows && is(\"name\") && is_token(peek(), \"arrow\")) {\n var param = new AST_SymbolFunarg({\n name: S.token.value,\n start: start,\n end: start,\n });\n next();\n return arrow_function(start, [param], !!async);\n }\n if (is(\"keyword\", \"function\")) {\n next();\n var func = function_(AST_Function, false, !!async);\n func.start = start;\n func.end = prev();\n return subscripts(func, allow_calls);\n }\n if (async) return subscripts(async, allow_calls);\n if (is(\"keyword\", \"class\")) {\n next();\n var cls = class_(AST_ClassExpression);\n cls.start = start;\n cls.end = prev();\n return subscripts(cls, allow_calls);\n }\n if (is(\"template_head\")) {\n return subscripts(template_string(false), allow_calls);\n }\n if (ATOMIC_START_TOKEN(S.token.type)) {\n return subscripts(as_atom_node(), allow_calls);\n }\n unexpected();\n };\n\n function template_string(tagged) {\n var segments = [], start = S.token;\n\n segments.push(new AST_TemplateSegment({\n start: S.token,\n raw: S.token.raw,\n value: S.token.value,\n end: S.token\n }));\n while (S.token.end === false) {\n next();\n handle_regexp();\n segments.push(expression(true));\n\n if (!is_token(\"template_substitution\")) {\n unexpected();\n }\n\n segments.push(new AST_TemplateSegment({\n start: S.token,\n raw: S.token.raw,\n value: S.token.value,\n end: S.token\n }));\n }\n next();\n\n return new AST_TemplateString({\n start: start,\n segments: segments,\n end: S.token\n });\n }\n\n function expr_list(closing, allow_trailing_comma, allow_empty) {\n var first = true, a = [];\n while (!is(\"punc\", closing)) {\n if (first) first = false; else expect(\",\");\n if (allow_trailing_comma && is(\"punc\", closing)) break;\n if (is(\"punc\", \",\") && allow_empty) {\n a.push(new AST_Hole({ start: S.token, end: S.token }));\n } else if (is(\"expand\", \"...\")) {\n next();\n a.push(new AST_Expansion({start: prev(), expression: expression(),end: S.token}));\n } else {\n a.push(expression(false));\n }\n }\n next();\n return a;\n }\n\n var array_ = embed_tokens(function() {\n expect(\"[\");\n return new AST_Array({\n elements: expr_list(\"]\", !options.strict, true)\n });\n });\n\n var create_accessor = embed_tokens(function(is_generator, is_async) {\n return function_(AST_Accessor, is_generator, is_async);\n });\n\n var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() {\n var start = S.token, first = true, a = [];\n expect(\"{\");\n while (!is(\"punc\", \"}\")) {\n if (first) first = false; else expect(\",\");\n if (!options.strict && is(\"punc\", \"}\"))\n // allow trailing comma\n break;\n\n start = S.token;\n if (start.type == \"expand\") {\n next();\n a.push(new AST_Expansion({\n start: start,\n expression: expression(false),\n end: prev(),\n }));\n continue;\n }\n\n var name = as_property_name();\n var value;\n\n // Check property and fetch value\n if (!is(\"punc\", \":\")) {\n var concise = concise_method_or_getset(name, start);\n if (concise) {\n a.push(concise);\n continue;\n }\n\n value = new AST_SymbolRef({\n start: prev(),\n name: name,\n end: prev()\n });\n } else if (name === null) {\n unexpected(prev());\n } else {\n next(); // `:` - see first condition\n value = expression(false);\n }\n\n // Check for default value and alter value accordingly if necessary\n if (is(\"operator\", \"=\")) {\n next();\n value = new AST_Assign({\n start: start,\n left: value,\n operator: \"=\",\n right: expression(false),\n end: prev()\n });\n }\n\n // Create property\n a.push(new AST_ObjectKeyVal({\n start: start,\n quote: start.quote,\n key: name instanceof AST_Node ? name : \"\" + name,\n value: value,\n end: prev()\n }));\n }\n next();\n return new AST_Object({ properties: a });\n });\n\n function class_(KindOfClass) {\n var start, method, class_name, extends_, a = [];\n\n S.input.push_directives_stack(); // Push directive stack, but not scope stack\n S.input.add_directive(\"use strict\");\n\n if (S.token.type == \"name\" && S.token.value != \"extends\") {\n class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass);\n }\n\n if (KindOfClass === AST_DefClass && !class_name) {\n unexpected();\n }\n\n if (S.token.value == \"extends\") {\n next();\n extends_ = expression(true);\n }\n\n expect(\"{\");\n\n if (is(\"punc\", \";\")) { next(); } // Leading semicolons are okay in class bodies.\n while (!is(\"punc\", \"}\")) {\n start = S.token;\n method = concise_method_or_getset(as_property_name(), start, true);\n if (!method) { unexpected(); }\n a.push(method);\n if (is(\"punc\", \";\")) { next(); }\n }\n\n S.input.pop_directives_stack();\n\n next();\n\n return new KindOfClass({\n start: start,\n name: class_name,\n extends: extends_,\n properties: a,\n end: prev(),\n });\n }\n\n function concise_method_or_getset(name, start, is_class) {\n var get_ast = function(name, token) {\n if (typeof name === \"string\" || typeof name === \"number\") {\n return new AST_SymbolMethod({\n start: token,\n name: \"\" + name,\n end: prev()\n });\n } else if (name === null) {\n unexpected();\n }\n return name;\n };\n var is_async = false;\n var is_static = false;\n var is_generator = false;\n var property_token = start;\n if (is_class && name === \"static\" && !is(\"punc\", \"(\")) {\n is_static = true;\n property_token = S.token;\n name = as_property_name();\n }\n if (name === \"async\" && !is(\"punc\", \"(\") && !is(\"punc\", \",\") && !is(\"punc\", \"}\")) {\n is_async = true;\n property_token = S.token;\n name = as_property_name();\n }\n if (name === null) {\n is_generator = true;\n property_token = S.token;\n name = as_property_name();\n if (name === null) {\n unexpected();\n }\n }\n if (is(\"punc\", \"(\")) {\n name = get_ast(name, start);\n var node = new AST_ConciseMethod({\n start : start,\n static : is_static,\n is_generator: is_generator,\n async : is_async,\n key : name,\n quote : name instanceof AST_SymbolMethod ?\n property_token.quote : undefined,\n value : create_accessor(is_generator, is_async),\n end : prev()\n });\n return node;\n }\n property_token = S.token;\n if (name == \"get\") {\n if (!is(\"punc\") || is(\"punc\", \"[\")) {\n name = get_ast(as_property_name(), start);\n return new AST_ObjectGetter({\n start : start,\n static: is_static,\n key : name,\n quote : name instanceof AST_SymbolMethod ?\n property_token.quote : undefined,\n value : create_accessor(),\n end : prev()\n });\n }\n } else if (name == \"set\") {\n if (!is(\"punc\") || is(\"punc\", \"[\")) {\n name = get_ast(as_property_name(), start);\n return new AST_ObjectSetter({\n start : start,\n static: is_static,\n key : name,\n quote : name instanceof AST_SymbolMethod ?\n property_token.quote : undefined,\n value : create_accessor(),\n end : prev()\n });\n }\n }\n }\n\n function import_() {\n var start = prev();\n var imported_name;\n var imported_names;\n if (is(\"name\")) {\n imported_name = as_symbol(AST_SymbolImport);\n }\n\n if (is(\"punc\", \",\")) {\n next();\n }\n\n imported_names = map_names(true);\n\n if (imported_names || imported_name) {\n expect_token(\"name\", \"from\");\n }\n var mod_str = S.token;\n if (mod_str.type !== \"string\") {\n unexpected();\n }\n next();\n return new AST_Import({\n start: start,\n imported_name: imported_name,\n imported_names: imported_names,\n module_name: new AST_String({\n start: mod_str,\n value: mod_str.value,\n quote: mod_str.quote,\n end: mod_str,\n }),\n end: S.token,\n });\n }\n\n function map_name(is_import) {\n function make_symbol(type) {\n return new type({\n name: as_property_name(),\n start: prev(),\n end: prev()\n });\n }\n\n var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign;\n var type = is_import ? AST_SymbolImport : AST_SymbolExport;\n var start = S.token;\n var foreign_name;\n var name;\n\n if (is_import) {\n foreign_name = make_symbol(foreign_type);\n } else {\n name = make_symbol(type);\n }\n if (is(\"name\", \"as\")) {\n next(); // The \"as\" word\n if (is_import) {\n name = make_symbol(type);\n } else {\n foreign_name = make_symbol(foreign_type);\n }\n } else if (is_import) {\n name = new type(foreign_name);\n } else {\n foreign_name = new foreign_type(name);\n }\n\n return new AST_NameMapping({\n start: start,\n foreign_name: foreign_name,\n name: name,\n end: prev(),\n });\n }\n\n function map_nameAsterisk(is_import, name) {\n var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign;\n var type = is_import ? AST_SymbolImport : AST_SymbolExport;\n var start = S.token;\n var foreign_name;\n var end = prev();\n\n name = name || new type({\n name: \"*\",\n start: start,\n end: end,\n });\n\n foreign_name = new foreign_type({\n name: \"*\",\n start: start,\n end: end,\n });\n\n return new AST_NameMapping({\n start: start,\n foreign_name: foreign_name,\n name: name,\n end: end,\n });\n }\n\n function map_names(is_import) {\n var names;\n if (is(\"punc\", \"{\")) {\n next();\n names = [];\n while (!is(\"punc\", \"}\")) {\n names.push(map_name(is_import));\n if (is(\"punc\", \",\")) {\n next();\n }\n }\n next();\n } else if (is(\"operator\", \"*\")) {\n var name;\n next();\n if (is_import && is(\"name\", \"as\")) {\n next(); // The \"as\" word\n name = as_symbol(is_import ? AST_SymbolImport : AST_SymbolExportForeign);\n }\n names = [map_nameAsterisk(is_import, name)];\n }\n return names;\n }\n\n function export_() {\n var start = S.token;\n var is_default;\n var exported_names;\n\n if (is(\"keyword\", \"default\")) {\n is_default = true;\n next();\n } else if (exported_names = map_names(false)) {\n if (is(\"name\", \"from\")) {\n next();\n\n var mod_str = S.token;\n if (mod_str.type !== \"string\") {\n unexpected();\n }\n next();\n\n return new AST_Export({\n start: start,\n is_default: is_default,\n exported_names: exported_names,\n module_name: new AST_String({\n start: mod_str,\n value: mod_str.value,\n quote: mod_str.quote,\n end: mod_str,\n }),\n end: prev(),\n });\n } else {\n return new AST_Export({\n start: start,\n is_default: is_default,\n exported_names: exported_names,\n end: prev(),\n });\n }\n }\n\n var node;\n var exported_value;\n var exported_definition;\n if (is(\"punc\", \"{\")\n || is_default\n && (is(\"keyword\", \"class\") || is(\"keyword\", \"function\"))\n && is_token(peek(), \"punc\")) {\n exported_value = expression(false);\n semicolon();\n } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) {\n unexpected(node.start);\n } else if (node instanceof AST_Definitions || node instanceof AST_Lambda || node instanceof AST_DefClass) {\n exported_definition = node;\n } else if (node instanceof AST_SimpleStatement) {\n exported_value = node.body;\n } else {\n unexpected(node.start);\n }\n\n return new AST_Export({\n start: start,\n is_default: is_default,\n exported_value: exported_value,\n exported_definition: exported_definition,\n end: prev(),\n });\n }\n\n function as_property_name() {\n var tmp = S.token;\n switch (tmp.type) {\n case \"punc\":\n if (tmp.value === \"[\") {\n next();\n var ex = expression(false);\n expect(\"]\");\n return ex;\n } else unexpected(tmp);\n case \"operator\":\n if (tmp.value === \"*\") {\n next();\n return null;\n }\n if ([\"delete\", \"in\", \"instanceof\", \"new\", \"typeof\", \"void\"].indexOf(tmp.value) === -1) {\n unexpected(tmp);\n }\n case \"name\":\n if (tmp.value == \"yield\") {\n if (is_in_generator()) {\n token_error(tmp, \"Yield cannot be used as identifier inside generators\");\n } else if (!is_token(peek(), \"punc\", \":\")\n && !is_token(peek(), \"punc\", \"(\")\n && S.input.has_directive(\"use strict\")) {\n token_error(tmp, \"Unexpected yield identifier inside strict mode\");\n }\n }\n case \"string\":\n case \"num\":\n case \"keyword\":\n case \"atom\":\n next();\n return tmp.value;\n default:\n unexpected(tmp);\n }\n }\n\n function as_name() {\n var tmp = S.token;\n if (tmp.type != \"name\") unexpected();\n next();\n return tmp.value;\n }\n\n function _make_symbol(type) {\n var name = S.token.value;\n return new (name == \"this\" ? AST_This :\n name == \"super\" ? AST_Super :\n type)({\n name : String(name),\n start : S.token,\n end : S.token\n });\n }\n\n function _verify_symbol(sym) {\n var name = sym.name;\n if (is_in_generator() && name == \"yield\") {\n token_error(sym.start, \"Yield cannot be used as identifier inside generators\");\n }\n if (S.input.has_directive(\"use strict\")) {\n if (name == \"yield\") {\n token_error(sym.start, \"Unexpected yield identifier inside strict mode\");\n }\n if (sym instanceof AST_SymbolDeclaration && (name == \"arguments\" || name == \"eval\")) {\n token_error(sym.start, \"Unexpected \" + name + \" in strict mode\");\n }\n }\n }\n\n function as_symbol(type, noerror) {\n if (!is(\"name\")) {\n if (!noerror) croak(\"Name expected\");\n return null;\n }\n var sym = _make_symbol(type);\n _verify_symbol(sym);\n next();\n return sym;\n }\n\n function mark_pure(call) {\n var start = call.start;\n var comments = start.comments_before;\n var i = HOP(start, \"comments_before_length\") ? start.comments_before_length : comments.length;\n while (--i >= 0) {\n var comment = comments[i];\n if (/[@#]__PURE__/.test(comment.value)) {\n call.pure = comment;\n break;\n }\n }\n }\n\n var subscripts = function(expr, allow_calls) {\n var start = expr.start;\n if (is(\"punc\", \".\")) {\n next();\n return subscripts(new AST_Dot({\n start : start,\n expression : expr,\n property : as_name(),\n end : prev()\n }), allow_calls);\n }\n if (is(\"punc\", \"[\")) {\n next();\n var prop = expression(true);\n expect(\"]\");\n return subscripts(new AST_Sub({\n start : start,\n expression : expr,\n property : prop,\n end : prev()\n }), allow_calls);\n }\n if (allow_calls && is(\"punc\", \"(\")) {\n next();\n var call = new AST_Call({\n start : start,\n expression : expr,\n args : call_args(),\n end : prev()\n });\n mark_pure(call);\n return subscripts(call, true);\n }\n if (is(\"template_head\")) {\n return subscripts(new AST_PrefixedTemplateString({\n start: start,\n prefix: expr,\n template_string: template_string(true),\n end: prev()\n }), allow_calls);\n }\n return expr;\n };\n\n var call_args = embed_tokens(function _call_args() {\n var args = [];\n while (!is(\"punc\", \")\")) {\n if (is(\"expand\", \"...\")) {\n next();\n args.push(new AST_Expansion({\n start: prev(),\n expression: expression(false),\n end: prev()\n }));\n } else {\n args.push(expression(false));\n }\n if (!is(\"punc\", \")\")) {\n expect(\",\");\n if (is(\"punc\", \")\") && options.ecma < 8) unexpected();\n }\n }\n next();\n return args;\n });\n\n var maybe_unary = function(allow_calls, allow_arrows) {\n var start = S.token;\n if (start.type == \"name\" && start.value == \"await\") {\n if (is_in_async()) {\n next();\n return _await_expression();\n } else if (S.input.has_directive(\"use strict\")) {\n token_error(S.token, \"Unexpected await identifier inside strict mode\");\n }\n }\n if (is(\"operator\") && UNARY_PREFIX(start.value)) {\n next();\n handle_regexp();\n var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls));\n ex.start = start;\n ex.end = prev();\n return ex;\n }\n var val = expr_atom(allow_calls, allow_arrows);\n while (is(\"operator\") && UNARY_POSTFIX(S.token.value) && !has_newline_before(S.token)) {\n if (val instanceof AST_Arrow) unexpected();\n val = make_unary(AST_UnaryPostfix, S.token, val);\n val.start = start;\n val.end = S.token;\n next();\n }\n return val;\n };\n\n function make_unary(ctor, token, expr) {\n var op = token.value;\n switch (op) {\n case \"++\":\n case \"--\":\n if (!is_assignable(expr))\n croak(\"Invalid use of \" + op + \" operator\", token.line, token.col, token.pos);\n break;\n case \"delete\":\n if (expr instanceof AST_SymbolRef && S.input.has_directive(\"use strict\"))\n croak(\"Calling delete on expression not allowed in strict mode\", expr.start.line, expr.start.col, expr.start.pos);\n break;\n }\n return new ctor({ operator: op, expression: expr });\n }\n\n var expr_op = function(left, min_prec, no_in) {\n var op = is(\"operator\") ? S.token.value : null;\n if (op == \"in\" && no_in) op = null;\n if (op == \"**\" && left instanceof AST_UnaryPrefix\n /* unary token in front not allowed - parenthesis required */\n && !is_token(left.start, \"punc\", \"(\")\n && left.operator !== \"--\" && left.operator !== \"++\")\n unexpected(left.start);\n var prec = op != null ? PRECEDENCE[op] : null;\n if (prec != null && (prec > min_prec || (op === \"**\" && min_prec === prec))) {\n next();\n var right = expr_op(maybe_unary(true), prec, no_in);\n return expr_op(new AST_Binary({\n start : left.start,\n left : left,\n operator : op,\n right : right,\n end : right.end\n }), min_prec, no_in);\n }\n return left;\n };\n\n function expr_ops(no_in) {\n return expr_op(maybe_unary(true, true), 0, no_in);\n }\n\n var maybe_conditional = function(no_in) {\n var start = S.token;\n var expr = expr_ops(no_in);\n if (is(\"operator\", \"?\")) {\n next();\n var yes = expression(false);\n expect(\":\");\n return new AST_Conditional({\n start : start,\n condition : expr,\n consequent : yes,\n alternative : expression(false, no_in),\n end : prev()\n });\n }\n return expr;\n };\n\n function is_assignable(expr) {\n return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef;\n }\n\n function to_destructuring(node) {\n if (node instanceof AST_Object) {\n node = new AST_Destructuring({\n start: node.start,\n names: node.properties.map(to_destructuring),\n is_array: false,\n end: node.end\n });\n } else if (node instanceof AST_Array) {\n var names = [];\n\n for (var i = 0; i < node.elements.length; i++) {\n // Only allow expansion as last element\n if (node.elements[i] instanceof AST_Expansion) {\n if (i + 1 !== node.elements.length) {\n token_error(node.elements[i].start, \"Spread must the be last element in destructuring array\");\n }\n node.elements[i].expression = to_destructuring(node.elements[i].expression);\n }\n\n names.push(to_destructuring(node.elements[i]));\n }\n\n node = new AST_Destructuring({\n start: node.start,\n names: names,\n is_array: true,\n end: node.end\n });\n } else if (node instanceof AST_ObjectProperty) {\n node.value = to_destructuring(node.value);\n } else if (node instanceof AST_Assign) {\n node = new AST_DefaultAssign({\n start: node.start,\n left: node.left,\n operator: \"=\",\n right: node.right,\n end: node.end\n });\n }\n return node;\n }\n\n // In ES6, AssignmentExpression can also be an ArrowFunction\n var maybe_assign = function(no_in) {\n handle_regexp();\n var start = S.token;\n\n if (start.type == \"name\" && start.value == \"yield\") {\n if (is_in_generator()) {\n next();\n return _yield_expression();\n } else if (S.input.has_directive(\"use strict\")) {\n token_error(S.token, \"Unexpected yield identifier inside strict mode\");\n }\n }\n\n var left = maybe_conditional(no_in);\n var val = S.token.value;\n\n if (is(\"operator\") && ASSIGNMENT(val)) {\n if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) {\n next();\n return new AST_Assign({\n start : start,\n left : left,\n operator : val,\n right : maybe_assign(no_in),\n end : prev()\n });\n }\n croak(\"Invalid assignment\");\n }\n return left;\n };\n\n var expression = function(commas, no_in) {\n var start = S.token;\n var exprs = [];\n while (true) {\n exprs.push(maybe_assign(no_in));\n if (!commas || !is(\"punc\", \",\")) break;\n next();\n commas = true;\n }\n return exprs.length == 1 ? exprs[0] : new AST_Sequence({\n start : start,\n expressions : exprs,\n end : peek()\n });\n };\n\n function in_loop(cont) {\n ++S.in_loop;\n var ret = cont();\n --S.in_loop;\n return ret;\n }\n\n if (options.expression) {\n return expression(true);\n }\n\n return (function() {\n var start = S.token;\n var body = [];\n S.input.push_directives_stack();\n if (options.module) S.input.add_directive(\"use strict\");\n while (!is(\"eof\"))\n body.push(statement());\n S.input.pop_directives_stack();\n var end = prev();\n var toplevel = options.toplevel;\n if (toplevel) {\n toplevel.body = toplevel.body.concat(body);\n toplevel.end = end;\n } else {\n toplevel = new AST_Toplevel({ start: start, body: body, end: end });\n }\n return toplevel;\n })();\n\n}\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n// Tree transformer helpers.\n\nfunction TreeTransformer(before, after) {\n TreeWalker.call(this);\n this.before = before;\n this.after = after;\n}\nTreeTransformer.prototype = new TreeWalker;\n\n(function(undefined) {\n\n function _(node, descend) {\n node.DEFMETHOD(\"transform\", function(tw, in_list) {\n var x, y;\n tw.push(this);\n if (tw.before) x = tw.before(this, descend, in_list);\n if (x === undefined) {\n x = this;\n descend(x, tw);\n if (tw.after) {\n y = tw.after(x, in_list);\n if (y !== undefined) x = y;\n }\n }\n tw.pop();\n return x;\n });\n }\n\n function do_list(list, tw) {\n return MAP(list, function(node) {\n return node.transform(tw, true);\n });\n }\n\n _(AST_Node, noop);\n\n _(AST_LabeledStatement, function(self, tw) {\n self.label = self.label.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_SimpleStatement, function(self, tw) {\n self.body = self.body.transform(tw);\n });\n\n _(AST_Block, function(self, tw) {\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Do, function(self, tw) {\n self.body = self.body.transform(tw);\n self.condition = self.condition.transform(tw);\n });\n\n _(AST_While, function(self, tw) {\n self.condition = self.condition.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_For, function(self, tw) {\n if (self.init) self.init = self.init.transform(tw);\n if (self.condition) self.condition = self.condition.transform(tw);\n if (self.step) self.step = self.step.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_ForIn, function(self, tw) {\n self.init = self.init.transform(tw);\n self.object = self.object.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_With, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_Exit, function(self, tw) {\n if (self.value) self.value = self.value.transform(tw);\n });\n\n _(AST_LoopControl, function(self, tw) {\n if (self.label) self.label = self.label.transform(tw);\n });\n\n _(AST_If, function(self, tw) {\n self.condition = self.condition.transform(tw);\n self.body = self.body.transform(tw);\n if (self.alternative) self.alternative = self.alternative.transform(tw);\n });\n\n _(AST_Switch, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Case, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Try, function(self, tw) {\n self.body = do_list(self.body, tw);\n if (self.bcatch) self.bcatch = self.bcatch.transform(tw);\n if (self.bfinally) self.bfinally = self.bfinally.transform(tw);\n });\n\n _(AST_Catch, function(self, tw) {\n if (self.argname) self.argname = self.argname.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Definitions, function(self, tw) {\n self.definitions = do_list(self.definitions, tw);\n });\n\n _(AST_VarDef, function(self, tw) {\n self.name = self.name.transform(tw);\n if (self.value) self.value = self.value.transform(tw);\n });\n\n _(AST_Destructuring, function(self, tw) {\n self.names = do_list(self.names, tw);\n });\n\n _(AST_Lambda, function(self, tw) {\n if (self.name) self.name = self.name.transform(tw);\n self.argnames = do_list(self.argnames, tw);\n if (self.body instanceof AST_Node) {\n self.body = self.body.transform(tw);\n } else {\n self.body = do_list(self.body, tw);\n }\n });\n\n _(AST_Call, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.args = do_list(self.args, tw);\n });\n\n _(AST_Sequence, function(self, tw) {\n self.expressions = do_list(self.expressions, tw);\n });\n\n _(AST_Dot, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Sub, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.property = self.property.transform(tw);\n });\n\n _(AST_Yield, function(self, tw) {\n if (self.expression) self.expression = self.expression.transform(tw);\n });\n\n _(AST_Await, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Unary, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Binary, function(self, tw) {\n self.left = self.left.transform(tw);\n self.right = self.right.transform(tw);\n });\n\n _(AST_Conditional, function(self, tw) {\n self.condition = self.condition.transform(tw);\n self.consequent = self.consequent.transform(tw);\n self.alternative = self.alternative.transform(tw);\n });\n\n _(AST_Array, function(self, tw) {\n self.elements = do_list(self.elements, tw);\n });\n\n _(AST_Object, function(self, tw) {\n self.properties = do_list(self.properties, tw);\n });\n\n _(AST_ObjectProperty, function(self, tw) {\n if (self.key instanceof AST_Node) {\n self.key = self.key.transform(tw);\n }\n self.value = self.value.transform(tw);\n });\n\n _(AST_Class, function(self, tw) {\n if (self.name) self.name = self.name.transform(tw);\n if (self.extends) self.extends = self.extends.transform(tw);\n self.properties = do_list(self.properties, tw);\n });\n\n _(AST_Expansion, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_NameMapping, function(self, tw) {\n self.foreign_name = self.foreign_name.transform(tw);\n self.name = self.name.transform(tw);\n });\n\n _(AST_Import, function(self, tw) {\n if (self.imported_name) self.imported_name = self.imported_name.transform(tw);\n if (self.imported_names) do_list(self.imported_names, tw);\n self.module_name = self.module_name.transform(tw);\n });\n\n _(AST_Export, function(self, tw) {\n if (self.exported_definition) self.exported_definition = self.exported_definition.transform(tw);\n if (self.exported_value) self.exported_value = self.exported_value.transform(tw);\n if (self.exported_names) do_list(self.exported_names, tw);\n if (self.module_name) self.module_name = self.module_name.transform(tw);\n });\n\n _(AST_TemplateString, function(self, tw) {\n self.segments = do_list(self.segments, tw);\n });\n\n _(AST_PrefixedTemplateString, function(self, tw) {\n self.prefix = self.prefix.transform(tw);\n self.template_string = self.template_string.transform(tw);\n });\n\n})();\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction SymbolDef(scope, orig, init) {\n this.name = orig.name;\n this.orig = [ orig ];\n this.init = init;\n this.eliminated = 0;\n this.scope = scope;\n this.references = [];\n this.replaced = 0;\n this.global = false;\n this.export = false;\n this.mangled_name = null;\n this.undeclared = false;\n this.id = SymbolDef.next_id++;\n}\n\nSymbolDef.next_id = 1;\n\nvar MASK_EXPORT_DONT_MANGLE = 1 << 0;\nvar MASK_EXPORT_WANT_MANGLE = 1 << 1;\n\nSymbolDef.prototype = {\n unmangleable: function(options) {\n if (!options) options = {};\n\n return this.global && !options.toplevel\n || (this.export & MASK_EXPORT_DONT_MANGLE)\n || this.undeclared\n || !options.eval && this.scope.pinned()\n || (this.orig[0] instanceof AST_SymbolLambda\n || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name)\n || this.orig[0] instanceof AST_SymbolMethod\n || (this.orig[0] instanceof AST_SymbolClass\n || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name);\n },\n mangle: function(options) {\n var cache = options.cache && options.cache.props;\n if (this.global && cache && cache.has(this.name)) {\n this.mangled_name = cache.get(this.name);\n } else if (!this.mangled_name && !this.unmangleable(options)) {\n var s = this.scope;\n var sym = this.orig[0];\n if (options.ie8 && sym instanceof AST_SymbolLambda)\n s = s.parent_scope;\n var def;\n if (def = this.redefined()) {\n this.mangled_name = def.mangled_name || def.name;\n } else\n this.mangled_name = s.next_mangled(options, this);\n if (this.global && cache) {\n cache.set(this.name, this.mangled_name);\n }\n }\n },\n redefined: function() {\n return this.defun && this.defun.variables.get(this.name);\n }\n};\n\nAST_Toplevel.DEFMETHOD(\"figure_out_scope\", function(options) {\n options = defaults(options, {\n cache: null,\n ie8: false,\n safari10: false,\n });\n\n // pass 1: setup scope chaining and handle definitions\n var self = this;\n var scope = self.parent_scope = null;\n var labels = new Dictionary();\n var defun = null;\n var in_destructuring = null;\n var for_scopes = [];\n var tw = new TreeWalker(function(node, descend) {\n if (node.is_block_scope()) {\n var save_scope = scope;\n node.block_scope = scope = new AST_Scope(node);\n scope.init_scope_vars(save_scope);\n if (!(node instanceof AST_Scope)) {\n scope.uses_with = save_scope.uses_with;\n scope.uses_eval = save_scope.uses_eval;\n scope.directives = save_scope.directives;\n }\n if (options.safari10) {\n if (node instanceof AST_For || node instanceof AST_ForIn) {\n for_scopes.push(scope);\n }\n }\n descend();\n scope = save_scope;\n return true;\n }\n if (node instanceof AST_Destructuring) {\n in_destructuring = node; // These don't nest\n descend();\n in_destructuring = null;\n return true;\n }\n if (node instanceof AST_Scope) {\n node.init_scope_vars(scope);\n var save_scope = scope;\n var save_defun = defun;\n var save_labels = labels;\n defun = scope = node;\n labels = new Dictionary();\n descend();\n scope = save_scope;\n defun = save_defun;\n labels = save_labels;\n return true; // don't descend again in TreeWalker\n }\n if (node instanceof AST_LabeledStatement) {\n var l = node.label;\n if (labels.has(l.name)) {\n throw new Error(string_template(\"Label {name} defined twice\", l));\n }\n labels.set(l.name, l);\n descend();\n labels.del(l.name);\n return true; // no descend again\n }\n if (node instanceof AST_With) {\n for (var s = scope; s; s = s.parent_scope)\n s.uses_with = true;\n return;\n }\n if (node instanceof AST_Symbol) {\n node.scope = scope;\n }\n if (node instanceof AST_Label) {\n node.thedef = node;\n node.references = [];\n }\n if (node instanceof AST_SymbolLambda) {\n defun.def_function(node, node.name == \"arguments\" ? undefined : defun);\n } else if (node instanceof AST_SymbolDefun) {\n // Careful here, the scope where this should be defined is\n // the parent scope. The reason is that we enter a new\n // scope when we encounter the AST_Defun node (which is\n // instanceof AST_Scope) but we get to the symbol a bit\n // later.\n mark_export((node.scope = defun.parent_scope.get_defun_scope()).def_function(node, defun), 1);\n } else if (node instanceof AST_SymbolClass) {\n mark_export(defun.def_variable(node, defun), 1);\n } else if (node instanceof AST_SymbolImport) {\n scope.def_variable(node);\n } else if (node instanceof AST_SymbolDefClass) {\n // This deals with the name of the class being available\n // inside the class.\n mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1);\n } else if (node instanceof AST_SymbolVar\n || node instanceof AST_SymbolLet\n || node instanceof AST_SymbolConst) {\n var def;\n if (node instanceof AST_SymbolBlockDeclaration) {\n def = scope.def_variable(node, null);\n } else {\n def = defun.def_variable(node, node.TYPE == \"SymbolVar\" ? null : undefined);\n }\n if (!all(def.orig, function(sym) {\n if (sym === node) return true;\n if (node instanceof AST_SymbolBlockDeclaration) {\n return sym instanceof AST_SymbolLambda;\n }\n return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst);\n })) {\n js_error(\n node.name + \" redeclared\",\n node.start.file,\n node.start.line,\n node.start.col,\n node.start.pos\n );\n }\n if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2);\n def.destructuring = in_destructuring;\n if (defun !== scope) {\n node.mark_enclosed(options);\n var def = scope.find_variable(node);\n if (node.thedef !== def) {\n node.thedef = def;\n node.reference(options);\n }\n }\n } else if (node instanceof AST_SymbolCatch) {\n scope.def_variable(node).defun = defun;\n } else if (node instanceof AST_LabelRef) {\n var sym = labels.get(node.name);\n if (!sym) throw new Error(string_template(\"Undefined label {name} [{line},{col}]\", {\n name: node.name,\n line: node.start.line,\n col: node.start.col\n }));\n node.thedef = sym;\n }\n if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) {\n js_error(\n node.TYPE + \" statement may only appear at top level\",\n node.start.file,\n node.start.line,\n node.start.col,\n node.start.pos\n );\n }\n\n function mark_export(def, level) {\n if (in_destructuring) {\n var i = 0;\n do {\n level++;\n } while (tw.parent(i++) !== in_destructuring);\n }\n var node = tw.parent(level);\n if (def.export = node instanceof AST_Export && MASK_EXPORT_DONT_MANGLE) {\n var exported = node.exported_definition;\n if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) {\n def.export = MASK_EXPORT_WANT_MANGLE;\n }\n }\n }\n });\n self.walk(tw);\n\n // pass 2: find back references and eval\n self.globals = new Dictionary();\n var tw = new TreeWalker(function(node, descend) {\n if (node instanceof AST_LoopControl && node.label) {\n node.label.thedef.references.push(node);\n return true;\n }\n if (node instanceof AST_SymbolRef) {\n var name = node.name;\n if (name == \"eval\" && tw.parent() instanceof AST_Call) {\n for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) {\n s.uses_eval = true;\n }\n }\n var sym;\n if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name\n || !(sym = node.scope.find_variable(name))) {\n sym = self.def_global(node);\n if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE;\n } else if (sym.scope instanceof AST_Lambda && name == \"arguments\") {\n sym.scope.uses_arguments = true;\n }\n node.thedef = sym;\n node.reference(options);\n if (node.scope.is_block_scope()\n && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) {\n node.scope = node.scope.get_defun_scope();\n }\n return true;\n }\n // ensure mangling works if catch reuses a scope variable\n var def;\n if (node instanceof AST_SymbolCatch && (def = node.definition().redefined())) {\n var s = node.scope;\n while (s) {\n push_uniq(s.enclosed, def);\n if (s === def.scope) break;\n s = s.parent_scope;\n }\n }\n });\n self.walk(tw);\n\n // pass 3: work around IE8 and Safari catch scope bugs\n if (options.ie8 || options.safari10) {\n self.walk(new TreeWalker(function(node, descend) {\n if (node instanceof AST_SymbolCatch) {\n var name = node.name;\n var refs = node.thedef.references;\n var scope = node.thedef.defun;\n var def = scope.find_variable(name) || self.globals.get(name) || scope.def_variable(node);\n refs.forEach(function(ref) {\n ref.thedef = def;\n ref.reference(options);\n });\n node.thedef = def;\n node.reference(options);\n return true;\n }\n }));\n }\n\n // pass 4: add symbol definitions to loop scopes\n // Safari/Webkit bug workaround - loop init let variable shadowing argument.\n // https://github.com/mishoo/UglifyJS2/issues/1753\n // https://bugs.webkit.org/show_bug.cgi?id=171041\n if (options.safari10) {\n for (var i = 0; i < for_scopes.length; i++) {\n var scope = for_scopes[i];\n scope.parent_scope.variables.each(function(def) {\n push_uniq(scope.enclosed, def);\n });\n }\n }\n});\n\nAST_Toplevel.DEFMETHOD(\"def_global\", function(node) {\n var globals = this.globals, name = node.name;\n if (globals.has(name)) {\n return globals.get(name);\n } else {\n var g = new SymbolDef(this, node);\n g.undeclared = true;\n g.global = true;\n globals.set(name, g);\n return g;\n }\n});\n\nAST_Scope.DEFMETHOD(\"init_scope_vars\", function(parent_scope) {\n this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions)\n this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope)\n this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement\n this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval`\n this.parent_scope = parent_scope; // the parent scope\n this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes\n this.cname = -1; // the current index for mangling functions/variables\n});\n\nAST_Node.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Class.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Lambda.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Toplevel.DEFMETHOD(\"is_block_scope\", return_false);\nAST_SwitchBranch.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Block.DEFMETHOD(\"is_block_scope\", return_true);\nAST_IterationStatement.DEFMETHOD(\"is_block_scope\", return_true);\n\nAST_Lambda.DEFMETHOD(\"init_scope_vars\", function() {\n AST_Scope.prototype.init_scope_vars.apply(this, arguments);\n this.uses_arguments = false;\n this.def_variable(new AST_SymbolFunarg({\n name: \"arguments\",\n start: this.start,\n end: this.end\n }));\n});\n\nAST_Arrow.DEFMETHOD(\"init_scope_vars\", function() {\n AST_Scope.prototype.init_scope_vars.apply(this, arguments);\n this.uses_arguments = false;\n});\n\nAST_Symbol.DEFMETHOD(\"mark_enclosed\", function(options) {\n var def = this.definition();\n var s = this.scope;\n while (s) {\n push_uniq(s.enclosed, def);\n if (options.keep_fnames) {\n s.functions.each(function(d) {\n if (keep_name(options.keep_fnames, d.name)) {\n push_uniq(def.scope.enclosed, d);\n }\n });\n }\n if (s === def.scope) break;\n s = s.parent_scope;\n }\n});\n\nAST_Symbol.DEFMETHOD(\"reference\", function(options) {\n this.definition().references.push(this);\n this.mark_enclosed(options);\n});\n\nAST_Scope.DEFMETHOD(\"find_variable\", function(name) {\n if (name instanceof AST_Symbol) name = name.name;\n return this.variables.get(name)\n || (this.parent_scope && this.parent_scope.find_variable(name));\n});\n\nAST_Scope.DEFMETHOD(\"def_function\", function(symbol, init) {\n var def = this.def_variable(symbol, init);\n if (!def.init || def.init instanceof AST_Defun) def.init = init;\n this.functions.set(symbol.name, def);\n return def;\n});\n\nAST_Scope.DEFMETHOD(\"def_variable\", function(symbol, init) {\n var def = this.variables.get(symbol.name);\n if (def) {\n def.orig.push(symbol);\n if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) {\n def.init = init;\n }\n } else {\n def = new SymbolDef(this, symbol, init);\n this.variables.set(symbol.name, def);\n def.global = !this.parent_scope;\n }\n return symbol.thedef = def;\n});\n\nfunction next_mangled(scope, options) {\n var ext = scope.enclosed;\n out: while (true) {\n var m = base54(++scope.cname);\n if (!is_identifier(m)) continue; // skip over \"do\"\n\n // https://github.com/mishoo/UglifyJS2/issues/242 -- do not\n // shadow a name reserved from mangling.\n if (member(m, options.reserved)) continue;\n\n // we must ensure that the mangled name does not shadow a name\n // from some parent scope that is referenced in this or in\n // inner scopes.\n for (var i = ext.length; --i >= 0;) {\n var sym = ext[i];\n var name = sym.mangled_name || (sym.unmangleable(options) && sym.name);\n if (m == name) continue out;\n }\n return m;\n }\n}\n\nAST_Scope.DEFMETHOD(\"next_mangled\", function(options) {\n return next_mangled(this, options);\n});\n\nAST_Toplevel.DEFMETHOD(\"next_mangled\", function(options) {\n var name;\n do {\n name = next_mangled(this, options);\n } while (member(name, this.mangled_names));\n return name;\n});\n\nAST_Function.DEFMETHOD(\"next_mangled\", function(options, def) {\n // #179, #326\n // in Safari strict mode, something like (function x(x){...}) is a syntax error;\n // a function expression's argument cannot shadow the function expression's name\n\n var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition();\n\n // the function's mangled_name is null when keep_fnames is true\n var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null;\n\n while (true) {\n var name = next_mangled(this, options);\n if (!tricky_name || tricky_name != name)\n return name;\n }\n});\n\nAST_Symbol.DEFMETHOD(\"unmangleable\", function(options) {\n var def = this.definition();\n return !def || def.unmangleable(options);\n});\n\n// labels are always mangleable\nAST_Label.DEFMETHOD(\"unmangleable\", return_false);\n\nAST_Symbol.DEFMETHOD(\"unreferenced\", function() {\n return !this.definition().references.length && !this.scope.pinned();\n});\n\nAST_Symbol.DEFMETHOD(\"definition\", function() {\n return this.thedef;\n});\n\nAST_Symbol.DEFMETHOD(\"global\", function() {\n return this.definition().global;\n});\n\nAST_Toplevel.DEFMETHOD(\"_default_mangler_options\", function(options) {\n options = defaults(options, {\n eval : false,\n ie8 : false,\n keep_classnames: false,\n keep_fnames : false,\n module : false,\n reserved : [],\n toplevel : false,\n });\n if (options[\"module\"]) {\n options.toplevel = true;\n }\n if (!Array.isArray(options.reserved)) options.reserved = [];\n // Never mangle arguments\n push_uniq(options.reserved, \"arguments\");\n return options;\n});\n\nAST_Toplevel.DEFMETHOD(\"mangle_names\", function(options) {\n options = this._default_mangler_options(options);\n\n // We only need to mangle declaration nodes. Special logic wired\n // into the code generator will display the mangled name if it's\n // present (and for AST_SymbolRef-s it'll use the mangled name of\n // the AST_SymbolDeclaration that it points to).\n var lname = -1;\n var to_mangle = [];\n\n var mangled_names = this.mangled_names = [];\n if (options.cache) {\n this.globals.each(collect);\n if (options.cache.props) {\n options.cache.props.each(function(mangled_name) {\n push_uniq(mangled_names, mangled_name);\n });\n }\n }\n\n var tw = new TreeWalker(function(node, descend) {\n if (node instanceof AST_LabeledStatement) {\n // lname is incremented when we get to the AST_Label\n var save_nesting = lname;\n descend();\n lname = save_nesting;\n return true; // don't descend again in TreeWalker\n }\n if (node instanceof AST_Scope) {\n node.variables.each(collect);\n return;\n }\n if (node.is_block_scope()) {\n node.block_scope.variables.each(collect);\n return;\n }\n if (node instanceof AST_Label) {\n var name;\n do name = base54(++lname); while (!is_identifier(name));\n node.mangled_name = name;\n return true;\n }\n if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) {\n to_mangle.push(node.definition());\n return;\n }\n });\n this.walk(tw);\n to_mangle.forEach(function(def) { def.mangle(options); });\n\n function collect(symbol) {\n if (!member(symbol.name, options.reserved)) {\n if (!(symbol.export & MASK_EXPORT_DONT_MANGLE)) {\n to_mangle.push(symbol);\n }\n }\n }\n});\n\nAST_Toplevel.DEFMETHOD(\"find_colliding_names\", function(options) {\n var cache = options.cache && options.cache.props;\n var avoid = Object.create(null);\n options.reserved.forEach(to_avoid);\n this.globals.each(add_def);\n this.walk(new TreeWalker(function(node) {\n if (node instanceof AST_Scope) node.variables.each(add_def);\n if (node instanceof AST_SymbolCatch) add_def(node.definition());\n }));\n return avoid;\n\n function to_avoid(name) {\n avoid[name] = true;\n }\n\n function add_def(def) {\n var name = def.name;\n if (def.global && cache && cache.has(name)) name = cache.get(name);\n else if (!def.unmangleable(options)) return;\n to_avoid(name);\n }\n});\n\nAST_Toplevel.DEFMETHOD(\"expand_names\", function(options) {\n base54.reset();\n base54.sort();\n options = this._default_mangler_options(options);\n var avoid = this.find_colliding_names(options);\n var cname = 0;\n this.globals.each(rename);\n this.walk(new TreeWalker(function(node) {\n if (node instanceof AST_Scope) node.variables.each(rename);\n if (node instanceof AST_SymbolCatch) rename(node.definition());\n }));\n\n function next_name() {\n var name;\n do {\n name = base54(cname++);\n } while (avoid[name] || !is_identifier(name));\n return name;\n }\n\n function rename(def) {\n if (def.global && options.cache) return;\n if (def.unmangleable(options)) return;\n if (member(def.name, options.reserved)) return;\n var d = def.redefined();\n def.name = d ? d.name : next_name();\n def.orig.forEach(function(sym) {\n sym.name = def.name;\n });\n def.references.forEach(function(sym) {\n sym.name = def.name;\n });\n }\n});\n\nAST_Node.DEFMETHOD(\"tail_node\", return_this);\nAST_Sequence.DEFMETHOD(\"tail_node\", function() {\n return this.expressions[this.expressions.length - 1];\n});\n\nAST_Toplevel.DEFMETHOD(\"compute_char_frequency\", function(options) {\n options = this._default_mangler_options(options);\n try {\n AST_Node.prototype.print = function(stream, force_parens) {\n this._print(stream, force_parens);\n if (this instanceof AST_Symbol && !this.unmangleable(options)) {\n base54.consider(this.name, -1);\n } else if (options.properties) {\n if (this instanceof AST_Dot) {\n base54.consider(this.property, -1);\n } else if (this instanceof AST_Sub) {\n skip_string(this.property);\n }\n }\n };\n base54.consider(this.print_to_string(), 1);\n } finally {\n AST_Node.prototype.print = AST_Node.prototype._print;\n }\n base54.sort();\n\n function skip_string(node) {\n if (node instanceof AST_String) {\n base54.consider(node.value, -1);\n } else if (node instanceof AST_Conditional) {\n skip_string(node.consequent);\n skip_string(node.alternative);\n } else if (node instanceof AST_Sequence) {\n skip_string(node.tail_node());\n }\n }\n});\n\nvar base54 = (function() {\n var leading = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_\".split(\"\");\n var digits = \"0123456789\".split(\"\");\n var chars, frequency;\n function reset() {\n frequency = Object.create(null);\n leading.forEach(function(ch) {\n frequency[ch] = 0;\n });\n digits.forEach(function(ch) {\n frequency[ch] = 0;\n });\n }\n base54.consider = function(str, delta) {\n for (var i = str.length; --i >= 0;) {\n frequency[str[i]] += delta;\n }\n };\n function compare(a, b) {\n return frequency[b] - frequency[a];\n }\n base54.sort = function() {\n chars = mergeSort(leading, compare).concat(mergeSort(digits, compare));\n };\n base54.reset = reset;\n reset();\n function base54(num) {\n var ret = \"\", base = 54;\n num++;\n do {\n num--;\n ret += chars[num % base];\n num = Math.floor(num / base);\n base = 64;\n } while (num > 0);\n return ret;\n }\n return base54;\n})();\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nvar EXPECT_DIRECTIVE = /^$|[;{][\\s\\n]*$/;\n\nfunction is_some_comments(comment) {\n // multiline comment\n return comment.type == \"comment2\" && /@preserve|@license|@cc_on/i.test(comment.value);\n}\n\nfunction OutputStream(options) {\n\n var readonly = !options;\n options = defaults(options, {\n ascii_only : false,\n beautify : false,\n braces : false,\n comments : false,\n ecma : 5,\n ie8 : false,\n indent_level : 4,\n indent_start : 0,\n inline_script : true,\n keep_quoted_props: false,\n max_line_len : false,\n preamble : null,\n quote_keys : false,\n quote_style : 0,\n safari10 : false,\n semicolons : true,\n shebang : true,\n shorthand : undefined,\n source_map : null,\n webkit : false,\n width : 80,\n wrap_iife : false,\n }, true);\n\n if (options.shorthand === undefined)\n options.shorthand = options.ecma > 5;\n\n // Convert comment option to RegExp if neccessary and set up comments filter\n var comment_filter = return_false; // Default case, throw all comments away\n if (options.comments) {\n var comments = options.comments;\n if (typeof options.comments === \"string\" && /^\\/.*\\/[a-zA-Z]*$/.test(options.comments)) {\n var regex_pos = options.comments.lastIndexOf(\"/\");\n comments = new RegExp(\n options.comments.substr(1, regex_pos - 1),\n options.comments.substr(regex_pos + 1)\n );\n }\n if (comments instanceof RegExp) {\n comment_filter = function(comment) {\n return comment.type != \"comment5\" && comments.test(comment.value);\n };\n } else if (typeof comments === \"function\") {\n comment_filter = function(comment) {\n return comment.type != \"comment5\" && comments(this, comment);\n };\n } else if (comments === \"some\") {\n comment_filter = is_some_comments;\n } else { // NOTE includes \"all\" option\n comment_filter = return_true;\n }\n }\n\n var indentation = 0;\n var current_col = 0;\n var current_line = 1;\n var current_pos = 0;\n var OUTPUT = \"\";\n\n var to_utf8 = options.ascii_only ? function(str, identifier) {\n if (options.ecma >= 6) {\n str = str.replace(/[\\ud800-\\udbff][\\udc00-\\udfff]/g, function(ch) {\n var code = get_full_char_code(ch, 0).toString(16);\n return \"\\\\u{\" + code + \"}\";\n });\n }\n return str.replace(/[\\u0000-\\u001f\\u007f-\\uffff]/g, function(ch) {\n var code = ch.charCodeAt(0).toString(16);\n if (code.length <= 2 && !identifier) {\n while (code.length < 2) code = \"0\" + code;\n return \"\\\\x\" + code;\n } else {\n while (code.length < 4) code = \"0\" + code;\n return \"\\\\u\" + code;\n }\n });\n } : function(str) {\n var s = \"\";\n for (var i = 0, len = str.length; i < len; i++) {\n if (is_surrogate_pair_head(str[i]) && !is_surrogate_pair_tail(str[i + 1])\n || is_surrogate_pair_tail(str[i]) && !is_surrogate_pair_head(str[i - 1])) {\n s += \"\\\\u\" + str.charCodeAt(i).toString(16);\n } else {\n s += str[i];\n }\n }\n return s;\n };\n\n function make_string(str, quote) {\n var dq = 0, sq = 0;\n str = str.replace(/[\\\\\\b\\f\\n\\r\\v\\t\\x22\\x27\\u2028\\u2029\\0\\ufeff]/g,\n function(s, i) {\n switch (s) {\n case '\"': ++dq; return '\"';\n case \"'\": ++sq; return \"'\";\n case \"\\\\\": return \"\\\\\\\\\";\n case \"\\n\": return \"\\\\n\";\n case \"\\r\": return \"\\\\r\";\n case \"\\t\": return \"\\\\t\";\n case \"\\b\": return \"\\\\b\";\n case \"\\f\": return \"\\\\f\";\n case \"\\x0B\": return options.ie8 ? \"\\\\x0B\" : \"\\\\v\";\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n case \"\\ufeff\": return \"\\\\ufeff\";\n case \"\\0\":\n return /[0-9]/.test(get_full_char(str, i+1)) ? \"\\\\x00\" : \"\\\\0\";\n }\n return s;\n });\n function quote_single() {\n return \"'\" + str.replace(/\\x27/g, \"\\\\'\") + \"'\";\n }\n function quote_double() {\n return '\"' + str.replace(/\\x22/g, '\\\\\"') + '\"';\n }\n function quote_template() {\n return \"`\" + str.replace(/`/g, \"\\\\`\") + \"`\";\n }\n str = to_utf8(str);\n if (quote === \"`\") return quote_template();\n switch (options.quote_style) {\n case 1:\n return quote_single();\n case 2:\n return quote_double();\n case 3:\n return quote == \"'\" ? quote_single() : quote_double();\n default:\n return dq > sq ? quote_single() : quote_double();\n }\n }\n\n function encode_string(str, quote) {\n var ret = make_string(str, quote);\n if (options.inline_script) {\n ret = ret.replace(/<\\x2f(script)([>\\/\\t\\n\\f\\r ])/gi, \"<\\\\/$1$2\");\n ret = ret.replace(/\\x3c!--/g, \"\\\\x3c!--\");\n ret = ret.replace(/--\\x3e/g, \"--\\\\x3e\");\n }\n return ret;\n }\n\n function make_name(name) {\n name = name.toString();\n name = to_utf8(name, true);\n return name;\n }\n\n function make_indent(back) {\n return repeat_string(\" \", options.indent_start + indentation - back * options.indent_level);\n }\n\n /* -----[ beautification/minification ]----- */\n\n var has_parens = false;\n var might_need_space = false;\n var might_need_semicolon = false;\n var might_add_newline = 0;\n var need_newline_indented = false;\n var need_space = false;\n var newline_insert = -1;\n var last = \"\";\n var mapping_token, mapping_name, mappings = options.source_map && [];\n\n var do_add_mapping = mappings ? function() {\n mappings.forEach(function(mapping) {\n try {\n options.source_map.add(\n mapping.token.file,\n mapping.line, mapping.col,\n mapping.token.line, mapping.token.col,\n !mapping.name && mapping.token.type == \"name\" ? mapping.token.value : mapping.name\n );\n } catch(ex) {\n mapping.token.file != null && AST_Node.warn(\"Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]\", {\n file: mapping.token.file,\n line: mapping.token.line,\n col: mapping.token.col,\n cline: mapping.line,\n ccol: mapping.col,\n name: mapping.name || \"\"\n });\n }\n });\n mappings = [];\n } : noop;\n\n var ensure_line_len = options.max_line_len ? function() {\n if (current_col > options.max_line_len) {\n if (might_add_newline) {\n var left = OUTPUT.slice(0, might_add_newline);\n var right = OUTPUT.slice(might_add_newline);\n if (mappings) {\n var delta = right.length - current_col;\n mappings.forEach(function(mapping) {\n mapping.line++;\n mapping.col += delta;\n });\n }\n OUTPUT = left + \"\\n\" + right;\n current_line++;\n current_pos++;\n current_col = right.length;\n }\n if (current_col > options.max_line_len) {\n AST_Node.warn(\"Output exceeds {max_line_len} characters\", options);\n }\n }\n if (might_add_newline) {\n might_add_newline = 0;\n do_add_mapping();\n }\n } : noop;\n\n var requireSemicolonChars = makePredicate(\"( [ + * / - , . `\");\n\n function print(str) {\n str = String(str);\n var ch = get_full_char(str, 0);\n var prev = get_full_char(last, last.length - 1);\n if (need_newline_indented && ch) {\n need_newline_indented = false;\n if (ch != \"\\n\") {\n print(\"\\n\");\n indent();\n }\n }\n if (need_space && ch) {\n need_space = false;\n if (!/[\\s;})]/.test(ch)) {\n space();\n }\n }\n newline_insert = -1;\n var prev = last.charAt(last.length - 1);\n if (might_need_semicolon) {\n might_need_semicolon = false;\n\n if (prev == \":\" && ch == \"}\" || (!ch || \";}\".indexOf(ch) < 0) && prev != \";\") {\n if (options.semicolons || requireSemicolonChars(ch)) {\n OUTPUT += \";\";\n current_col++;\n current_pos++;\n } else {\n ensure_line_len();\n OUTPUT += \"\\n\";\n current_pos++;\n current_line++;\n current_col = 0;\n\n if (/^\\s+$/.test(str)) {\n // reset the semicolon flag, since we didn't print one\n // now and might still have to later\n might_need_semicolon = true;\n }\n }\n\n if (!options.beautify)\n might_need_space = false;\n }\n }\n\n if (might_need_space) {\n if ((is_identifier_char(prev)\n && (is_identifier_char(ch) || ch == \"\\\\\"))\n || (ch == \"/\" && ch == prev)\n || ((ch == \"+\" || ch == \"-\") && ch == last)\n ) {\n OUTPUT += \" \";\n current_col++;\n current_pos++;\n }\n might_need_space = false;\n }\n\n if (mapping_token) {\n mappings.push({\n token: mapping_token,\n name: mapping_name,\n line: current_line,\n col: current_col\n });\n mapping_token = false;\n if (!might_add_newline) do_add_mapping();\n }\n\n OUTPUT += str;\n has_parens = str[str.length - 1] == \"(\";\n current_pos += str.length;\n var a = str.split(/\\r?\\n/), n = a.length - 1;\n current_line += n;\n current_col += a[0].length;\n if (n > 0) {\n ensure_line_len();\n current_col = a[n].length;\n }\n last = str;\n }\n\n var star = function() {\n print(\"*\");\n };\n\n var space = options.beautify ? function() {\n print(\" \");\n } : function() {\n might_need_space = true;\n };\n\n var indent = options.beautify ? function(half) {\n if (options.beautify) {\n print(make_indent(half ? 0.5 : 0));\n }\n } : noop;\n\n var with_indent = options.beautify ? function(col, cont) {\n if (col === true) col = next_indent();\n var save_indentation = indentation;\n indentation = col;\n var ret = cont();\n indentation = save_indentation;\n return ret;\n } : function(col, cont) { return cont(); };\n\n var newline = options.beautify ? function() {\n if (newline_insert < 0) return print(\"\\n\");\n if (OUTPUT[newline_insert] != \"\\n\") {\n OUTPUT = OUTPUT.slice(0, newline_insert) + \"\\n\" + OUTPUT.slice(newline_insert);\n current_pos++;\n current_line++;\n }\n newline_insert++;\n } : options.max_line_len ? function() {\n ensure_line_len();\n might_add_newline = OUTPUT.length;\n } : noop;\n\n var semicolon = options.beautify ? function() {\n print(\";\");\n } : function() {\n might_need_semicolon = true;\n };\n\n function force_semicolon() {\n might_need_semicolon = false;\n print(\";\");\n }\n\n function next_indent() {\n return indentation + options.indent_level;\n }\n\n function with_block(cont) {\n var ret;\n print(\"{\");\n newline();\n with_indent(next_indent(), function() {\n ret = cont();\n });\n indent();\n print(\"}\");\n return ret;\n }\n\n function with_parens(cont) {\n print(\"(\");\n //XXX: still nice to have that for argument lists\n //var ret = with_indent(current_col, cont);\n var ret = cont();\n print(\")\");\n return ret;\n }\n\n function with_square(cont) {\n print(\"[\");\n //var ret = with_indent(current_col, cont);\n var ret = cont();\n print(\"]\");\n return ret;\n }\n\n function comma() {\n print(\",\");\n space();\n }\n\n function colon() {\n print(\":\");\n space();\n }\n\n var add_mapping = mappings ? function(token, name) {\n mapping_token = token;\n mapping_name = name;\n } : noop;\n\n function get() {\n if (might_add_newline) {\n ensure_line_len();\n }\n return OUTPUT;\n }\n\n function has_nlb() {\n var index = OUTPUT.lastIndexOf(\"\\n\");\n return /^ *$/.test(OUTPUT.slice(index + 1));\n }\n\n function prepend_comments(node) {\n var self = this;\n var start = node.start;\n if (!start) return;\n if (start.comments_before && start.comments_before._dumped === self) return;\n var comments = start.comments_before;\n if (!comments) {\n comments = start.comments_before = [];\n }\n comments._dumped = self;\n\n if (node instanceof AST_Exit && node.value) {\n var tw = new TreeWalker(function(node) {\n var parent = tw.parent();\n if (parent instanceof AST_Exit\n || parent instanceof AST_Binary && parent.left === node\n || parent.TYPE == \"Call\" && parent.expression === node\n || parent instanceof AST_Conditional && parent.condition === node\n || parent instanceof AST_Dot && parent.expression === node\n || parent instanceof AST_Sequence && parent.expressions[0] === node\n || parent instanceof AST_Sub && parent.expression === node\n || parent instanceof AST_UnaryPostfix) {\n if (!node.start) return;\n var text = node.start.comments_before;\n if (text && text._dumped !== self) {\n text._dumped = self;\n comments = comments.concat(text);\n }\n } else {\n return true;\n }\n });\n tw.push(node);\n node.value.walk(tw);\n }\n\n if (current_pos == 0) {\n if (comments.length > 0 && options.shebang && comments[0].type == \"comment5\") {\n print(\"#!\" + comments.shift().value + \"\\n\");\n indent();\n }\n var preamble = options.preamble;\n if (preamble) {\n print(preamble.replace(/\\r\\n?|[\\n\\u2028\\u2029]|\\s*$/g, \"\\n\"));\n }\n }\n\n comments = comments.filter(comment_filter, node);\n if (comments.length == 0) return;\n var last_nlb = has_nlb();\n comments.forEach(function(c, i) {\n if (!last_nlb) {\n if (c.nlb) {\n print(\"\\n\");\n indent();\n last_nlb = true;\n } else if (i > 0) {\n space();\n }\n }\n if (/comment[134]/.test(c.type)) {\n print(\"//\" + c.value.replace(/[@#]__PURE__/g, \" \") + \"\\n\");\n indent();\n last_nlb = true;\n } else if (c.type == \"comment2\") {\n print(\"/*\" + c.value.replace(/[@#]__PURE__/g, \" \") + \"*/\");\n last_nlb = false;\n }\n });\n if (!last_nlb) {\n if (start.nlb) {\n print(\"\\n\");\n indent();\n } else {\n space();\n }\n }\n }\n\n function append_comments(node, tail) {\n var self = this;\n var token = node.end;\n if (!token) return;\n var comments = token[tail ? \"comments_before\" : \"comments_after\"];\n if (!comments || comments._dumped === self) return;\n if (!(node instanceof AST_Statement || all(comments, function(c) {\n return !/comment[134]/.test(c.type);\n }))) return;\n comments._dumped = self;\n var insert = OUTPUT.length;\n comments.filter(comment_filter, node).forEach(function(c, i) {\n need_space = false;\n if (need_newline_indented) {\n print(\"\\n\");\n indent();\n need_newline_indented = false;\n } else if (c.nlb && (i > 0 || !has_nlb())) {\n print(\"\\n\");\n indent();\n } else if (i > 0 || !tail) {\n space();\n }\n if (/comment[134]/.test(c.type)) {\n print(\"//\" + c.value.replace(/[@#]__PURE__/g, \" \"));\n need_newline_indented = true;\n } else if (c.type == \"comment2\") {\n print(\"/*\" + c.value.replace(/[@#]__PURE__/g, \" \") + \"*/\");\n need_space = true;\n }\n });\n if (OUTPUT.length > insert) newline_insert = insert;\n }\n\n var stack = [];\n return {\n get : get,\n toString : get,\n indent : indent,\n indentation : function() { return indentation; },\n current_width : function() { return current_col - indentation; },\n should_break : function() { return options.width && this.current_width() >= options.width; },\n has_parens : function() { return has_parens; },\n newline : newline,\n print : print,\n star : star,\n space : space,\n comma : comma,\n colon : colon,\n last : function() { return last; },\n semicolon : semicolon,\n force_semicolon : force_semicolon,\n to_utf8 : to_utf8,\n print_name : function(name) { print(make_name(name)); },\n print_string : function(str, quote, escape_directive) {\n var encoded = encode_string(str, quote);\n if (escape_directive === true && encoded.indexOf(\"\\\\\") === -1) {\n // Insert semicolons to break directive prologue\n if (!EXPECT_DIRECTIVE.test(OUTPUT)) {\n force_semicolon();\n }\n force_semicolon();\n }\n print(encoded);\n },\n print_template_string_chars: function(str) {\n var encoded = encode_string(str, \"`\").replace(/\\${/g, \"\\\\${\");\n return print(encoded.substr(1, encoded.length - 2));\n },\n encode_string : encode_string,\n next_indent : next_indent,\n with_indent : with_indent,\n with_block : with_block,\n with_parens : with_parens,\n with_square : with_square,\n add_mapping : add_mapping,\n option : function(opt) { return options[opt]; },\n prepend_comments: readonly ? noop : prepend_comments,\n append_comments : readonly || comment_filter === return_false ? noop : append_comments,\n line : function() { return current_line; },\n col : function() { return current_col; },\n pos : function() { return current_pos; },\n push_node : function(node) { stack.push(node); },\n pop_node : function() { return stack.pop(); },\n parent : function(n) {\n return stack[stack.length - 2 - (n || 0)];\n }\n };\n\n}\n\n/* -----[ code generators ]----- */\n\n(function() {\n\n /* -----[ utils ]----- */\n\n function DEFPRINT(nodetype, generator) {\n nodetype.DEFMETHOD(\"_codegen\", generator);\n }\n\n var in_directive = false;\n var active_scope = null;\n var use_asm = null;\n\n AST_Node.DEFMETHOD(\"print\", function(stream, force_parens) {\n var self = this, generator = self._codegen;\n if (self instanceof AST_Scope) {\n active_scope = self;\n } else if (!use_asm && self instanceof AST_Directive && self.value == \"use asm\") {\n use_asm = active_scope;\n }\n function doit() {\n stream.prepend_comments(self);\n self.add_source_map(stream);\n generator(self, stream);\n stream.append_comments(self);\n }\n stream.push_node(self);\n if (force_parens || self.needs_parens(stream)) {\n stream.with_parens(doit);\n } else {\n doit();\n }\n stream.pop_node();\n if (self === use_asm) {\n use_asm = null;\n }\n });\n AST_Node.DEFMETHOD(\"_print\", AST_Node.prototype.print);\n\n AST_Node.DEFMETHOD(\"print_to_string\", function(options) {\n var s = OutputStream(options);\n this.print(s);\n return s.get();\n });\n\n /* -----[ PARENTHESES ]----- */\n\n function PARENS(nodetype, func) {\n if (Array.isArray(nodetype)) {\n nodetype.forEach(function(nodetype) {\n PARENS(nodetype, func);\n });\n } else {\n nodetype.DEFMETHOD(\"needs_parens\", func);\n }\n }\n\n PARENS(AST_Node, return_false);\n\n // a function expression needs parens around it when it's provably\n // the first token to appear in a statement.\n PARENS(AST_Function, function(output) {\n if (!output.has_parens() && first_in_statement(output)) {\n return true;\n }\n\n if (output.option(\"webkit\")) {\n var p = output.parent();\n if (p instanceof AST_PropAccess && p.expression === this) {\n return true;\n }\n }\n\n if (output.option(\"wrap_iife\")) {\n var p = output.parent();\n return p instanceof AST_Call && p.expression === this;\n }\n\n return false;\n });\n\n PARENS(AST_Arrow, function(output) {\n var p = output.parent();\n return p instanceof AST_PropAccess && p.expression === this;\n });\n\n // same goes for an object literal, because otherwise it would be\n // interpreted as a block of code.\n PARENS(AST_Object, function(output) {\n return !output.has_parens() && first_in_statement(output);\n });\n\n PARENS(AST_ClassExpression, first_in_statement);\n\n PARENS(AST_Unary, function(output) {\n var p = output.parent();\n return p instanceof AST_PropAccess && p.expression === this\n || p instanceof AST_Call && p.expression === this\n || p instanceof AST_Binary\n && p.operator === \"**\"\n && this instanceof AST_UnaryPrefix\n && p.left === this\n && this.operator !== \"++\"\n && this.operator !== \"--\";\n });\n\n PARENS(AST_Await, function(output) {\n var p = output.parent();\n return p instanceof AST_PropAccess && p.expression === this\n || p instanceof AST_Call && p.expression === this\n || output.option(\"safari10\") && p instanceof AST_UnaryPrefix;\n });\n\n PARENS(AST_Sequence, function(output) {\n var p = output.parent();\n return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)\n || p instanceof AST_Unary // !(foo, bar, baz)\n || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8\n || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4\n || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})[\"foo\"] ==> 2\n || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]\n || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2\n || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)\n * ==> 20 (side effect, set a := 10 and b := 20) */\n || p instanceof AST_Arrow // x => (x, x)\n || p instanceof AST_DefaultAssign // x => (x = (0, function(){}))\n || p instanceof AST_Expansion // [...(a, b)]\n || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}\n || p instanceof AST_Yield // yield (foo, bar)\n || p instanceof AST_Export // export default (foo, bar)\n ;\n });\n\n PARENS(AST_Binary, function(output) {\n var p = output.parent();\n // (foo && bar)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // typeof (foo && bar)\n if (p instanceof AST_Unary)\n return true;\n // (foo && bar)[\"prop\"], (foo && bar).prop\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n // this deals with precedence: 3 * (2 + 1)\n if (p instanceof AST_Binary) {\n var po = p.operator, pp = PRECEDENCE[po];\n var so = this.operator, sp = PRECEDENCE[so];\n if (pp > sp\n || (pp == sp\n && (this === p.right || po == \"**\"))) {\n return true;\n }\n }\n });\n\n PARENS(AST_Yield, function(output) {\n var p = output.parent();\n // (yield 1) + (yield 2)\n // a = yield 3\n if (p instanceof AST_Binary && p.operator !== \"=\")\n return true;\n // (yield 1)()\n // new (yield 1)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // (yield 1) ? yield 2 : yield 3\n if (p instanceof AST_Conditional && p.condition === this)\n return true;\n // -(yield 4)\n if (p instanceof AST_Unary)\n return true;\n // (yield x).foo\n // (yield x)['foo']\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n });\n\n PARENS(AST_PropAccess, function(output) {\n var p = output.parent();\n if (p instanceof AST_New && p.expression === this) {\n // i.e. new (foo.bar().baz)\n //\n // if there's one call into this subtree, then we need\n // parens around it too, otherwise the call will be\n // interpreted as passing the arguments to the upper New\n // expression.\n var parens = false;\n this.walk(new TreeWalker(function(node) {\n if (parens || node instanceof AST_Scope) return true;\n if (node instanceof AST_Call) {\n parens = true;\n return true;\n }\n }));\n return parens;\n }\n });\n\n PARENS(AST_Call, function(output) {\n var p = output.parent(), p1;\n if (p instanceof AST_New && p.expression === this\n || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function)\n return true;\n\n // workaround for Safari bug.\n // https://bugs.webkit.org/show_bug.cgi?id=123506\n return this.expression instanceof AST_Function\n && p instanceof AST_PropAccess\n && p.expression === this\n && (p1 = output.parent(1)) instanceof AST_Assign\n && p1.left === p;\n });\n\n PARENS(AST_New, function(output) {\n var p = output.parent();\n if (!need_constructor_parens(this, output)\n && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)[\"getTime\"]()\n || p instanceof AST_Call && p.expression === this)) // (new foo)(bar)\n return true;\n });\n\n PARENS(AST_Number, function(output) {\n var p = output.parent();\n if (p instanceof AST_PropAccess && p.expression === this) {\n var value = this.getValue();\n if (value < 0 || /^0/.test(make_num(value))) {\n return true;\n }\n }\n });\n\n PARENS([ AST_Assign, AST_Conditional ], function(output) {\n var p = output.parent();\n // !(a = false) → true\n if (p instanceof AST_Unary)\n return true;\n // 1 + (a = 2) + 3 → 6, side effect setting a = 2\n if (p instanceof AST_Binary && !(p instanceof AST_Assign))\n return true;\n // (a = func)() —or— new (a = Object)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // (a = foo) ? bar : baz\n if (p instanceof AST_Conditional && p.condition === this)\n return true;\n // (a = foo)[\"prop\"] —or— (a = foo).prop\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n // ({a, b} = {a: 1, b: 2}), a destructuring assignment\n if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false)\n return true;\n });\n\n /* -----[ PRINTERS ]----- */\n\n DEFPRINT(AST_Directive, function(self, output) {\n output.print_string(self.value, self.quote);\n output.semicolon();\n });\n\n DEFPRINT(AST_Expansion, function (self, output) {\n output.print(\"...\");\n self.expression.print(output);\n });\n\n DEFPRINT(AST_Destructuring, function (self, output) {\n output.print(self.is_array ? \"[\" : \"{\");\n var len = self.names.length;\n self.names.forEach(function (name, i) {\n if (i > 0) output.comma();\n name.print(output);\n // If the final element is a hole, we need to make sure it\n // doesn't look like a trailing comma, by inserting an actual\n // trailing comma.\n if (i == len - 1 && name instanceof AST_Hole) output.comma();\n });\n output.print(self.is_array ? \"]\" : \"}\");\n });\n\n DEFPRINT(AST_Debugger, function(self, output) {\n output.print(\"debugger\");\n output.semicolon();\n });\n\n /* -----[ statements ]----- */\n\n function display_body(body, is_toplevel, output, allow_directives) {\n var last = body.length - 1;\n in_directive = allow_directives;\n body.forEach(function(stmt, i) {\n if (in_directive === true && !(stmt instanceof AST_Directive ||\n stmt instanceof AST_EmptyStatement ||\n (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String)\n )) {\n in_directive = false;\n }\n if (!(stmt instanceof AST_EmptyStatement)) {\n output.indent();\n stmt.print(output);\n if (!(i == last && is_toplevel)) {\n output.newline();\n if (is_toplevel) output.newline();\n }\n }\n if (in_directive === true &&\n stmt instanceof AST_SimpleStatement &&\n stmt.body instanceof AST_String\n ) {\n in_directive = false;\n }\n });\n in_directive = false;\n }\n\n AST_StatementWithBody.DEFMETHOD(\"_do_print_body\", function(output) {\n force_statement(this.body, output);\n });\n\n DEFPRINT(AST_Statement, function(self, output) {\n self.body.print(output);\n output.semicolon();\n });\n DEFPRINT(AST_Toplevel, function(self, output) {\n display_body(self.body, true, output, true);\n output.print(\"\");\n });\n DEFPRINT(AST_LabeledStatement, function(self, output) {\n self.label.print(output);\n output.colon();\n self.body.print(output);\n });\n DEFPRINT(AST_SimpleStatement, function(self, output) {\n self.body.print(output);\n output.semicolon();\n });\n function print_braced_empty(self, output) {\n output.print(\"{\");\n output.with_indent(output.next_indent(), function() {\n output.append_comments(self, true);\n });\n output.print(\"}\");\n }\n function print_braced(self, output, allow_directives) {\n if (self.body.length > 0) {\n output.with_block(function() {\n display_body(self.body, false, output, allow_directives);\n });\n } else print_braced_empty(self, output);\n }\n DEFPRINT(AST_BlockStatement, function(self, output) {\n print_braced(self, output);\n });\n DEFPRINT(AST_EmptyStatement, function(self, output) {\n output.semicolon();\n });\n DEFPRINT(AST_Do, function(self, output) {\n output.print(\"do\");\n output.space();\n make_block(self.body, output);\n output.space();\n output.print(\"while\");\n output.space();\n output.with_parens(function() {\n self.condition.print(output);\n });\n output.semicolon();\n });\n DEFPRINT(AST_While, function(self, output) {\n output.print(\"while\");\n output.space();\n output.with_parens(function() {\n self.condition.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_For, function(self, output) {\n output.print(\"for\");\n output.space();\n output.with_parens(function() {\n if (self.init) {\n if (self.init instanceof AST_Definitions) {\n self.init.print(output);\n } else {\n parenthesize_for_noin(self.init, output, true);\n }\n output.print(\";\");\n output.space();\n } else {\n output.print(\";\");\n }\n if (self.condition) {\n self.condition.print(output);\n output.print(\";\");\n output.space();\n } else {\n output.print(\";\");\n }\n if (self.step) {\n self.step.print(output);\n }\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_ForIn, function(self, output) {\n output.print(\"for\");\n if (self.await) {\n output.space();\n output.print(\"await\");\n }\n output.space();\n output.with_parens(function() {\n self.init.print(output);\n output.space();\n output.print(self instanceof AST_ForOf ? \"of\" : \"in\");\n output.space();\n self.object.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_With, function(self, output) {\n output.print(\"with\");\n output.space();\n output.with_parens(function() {\n self.expression.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n\n /* -----[ functions ]----- */\n AST_Lambda.DEFMETHOD(\"_do_print\", function(output, nokeyword) {\n var self = this;\n if (!nokeyword) {\n if (self.async) {\n output.print(\"async\");\n output.space();\n }\n output.print(\"function\");\n if (self.is_generator) {\n output.star();\n }\n if (self.name) {\n output.space();\n }\n }\n if (self.name instanceof AST_Symbol) {\n self.name.print(output);\n } else if (nokeyword && self.name instanceof AST_Node) {\n output.with_square(function() {\n self.name.print(output); // Computed method name\n });\n }\n output.with_parens(function() {\n self.argnames.forEach(function(arg, i) {\n if (i) output.comma();\n arg.print(output);\n });\n });\n output.space();\n print_braced(self, output, true);\n });\n DEFPRINT(AST_Lambda, function(self, output) {\n self._do_print(output);\n });\n\n DEFPRINT(AST_PrefixedTemplateString, function(self, output) {\n var tag = self.prefix;\n var parenthesize_tag = tag instanceof AST_Arrow\n || tag instanceof AST_Binary\n || tag instanceof AST_Conditional\n || tag instanceof AST_Sequence\n || tag instanceof AST_Unary;\n if (parenthesize_tag) output.print(\"(\");\n self.prefix.print(output);\n if (parenthesize_tag) output.print(\")\");\n self.template_string.print(output);\n });\n DEFPRINT(AST_TemplateString, function(self, output) {\n var is_tagged = output.parent() instanceof AST_PrefixedTemplateString;\n\n output.print(\"`\");\n for (var i = 0; i < self.segments.length; i++) {\n if (!(self.segments[i] instanceof AST_TemplateSegment)) {\n output.print(\"${\");\n self.segments[i].print(output);\n output.print(\"}\");\n } else if (is_tagged) {\n output.print(self.segments[i].raw);\n } else {\n output.print_template_string_chars(self.segments[i].value);\n }\n }\n output.print(\"`\");\n });\n\n AST_Arrow.DEFMETHOD(\"_do_print\", function(output) {\n var self = this;\n var parent = output.parent();\n var needs_parens = parent instanceof AST_Binary ||\n parent instanceof AST_Unary ||\n (parent instanceof AST_Call && self === parent.expression);\n if (needs_parens) { output.print(\"(\"); }\n if (self.async) {\n output.print(\"async\");\n output.space();\n }\n if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) {\n self.argnames[0].print(output);\n } else {\n output.with_parens(function() {\n self.argnames.forEach(function(arg, i) {\n if (i) output.comma();\n arg.print(output);\n });\n });\n }\n output.space();\n output.print(\"=>\");\n output.space();\n if (self.body instanceof AST_Node) {\n self.body.print(output);\n } else {\n print_braced(self, output);\n }\n if (needs_parens) { output.print(\")\"); }\n });\n\n /* -----[ exits ]----- */\n AST_Exit.DEFMETHOD(\"_do_print\", function(output, kind) {\n output.print(kind);\n if (this.value) {\n output.space();\n this.value.print(output);\n }\n output.semicolon();\n });\n DEFPRINT(AST_Return, function(self, output) {\n self._do_print(output, \"return\");\n });\n DEFPRINT(AST_Throw, function(self, output) {\n self._do_print(output, \"throw\");\n });\n\n /* -----[ yield ]----- */\n\n DEFPRINT(AST_Yield, function(self, output) {\n var star = self.is_star ? \"*\" : \"\";\n output.print(\"yield\" + star);\n if (self.expression) {\n output.space();\n self.expression.print(output);\n }\n });\n\n DEFPRINT(AST_Await, function(self, output) {\n output.print(\"await\");\n output.space();\n var e = self.expression;\n var parens = !(\n e instanceof AST_Call\n || e instanceof AST_SymbolRef\n || e instanceof AST_PropAccess\n || e instanceof AST_Unary\n || e instanceof AST_Constant\n );\n if (parens) output.print(\"(\");\n self.expression.print(output);\n if (parens) output.print(\")\");\n });\n\n /* -----[ loop control ]----- */\n AST_LoopControl.DEFMETHOD(\"_do_print\", function(output, kind) {\n output.print(kind);\n if (this.label) {\n output.space();\n this.label.print(output);\n }\n output.semicolon();\n });\n DEFPRINT(AST_Break, function(self, output) {\n self._do_print(output, \"break\");\n });\n DEFPRINT(AST_Continue, function(self, output) {\n self._do_print(output, \"continue\");\n });\n\n /* -----[ if ]----- */\n function make_then(self, output) {\n var b = self.body;\n if (output.option(\"braces\")\n || output.option(\"ie8\") && b instanceof AST_Do)\n return make_block(b, output);\n // The squeezer replaces \"block\"-s that contain only a single\n // statement with the statement itself; technically, the AST\n // is correct, but this can create problems when we output an\n // IF having an ELSE clause where the THEN clause ends in an\n // IF *without* an ELSE block (then the outer ELSE would refer\n // to the inner IF). This function checks for this case and\n // adds the block braces if needed.\n if (!b) return output.force_semicolon();\n while (true) {\n if (b instanceof AST_If) {\n if (!b.alternative) {\n make_block(self.body, output);\n return;\n }\n b = b.alternative;\n } else if (b instanceof AST_StatementWithBody) {\n b = b.body;\n } else break;\n }\n force_statement(self.body, output);\n }\n DEFPRINT(AST_If, function(self, output) {\n output.print(\"if\");\n output.space();\n output.with_parens(function() {\n self.condition.print(output);\n });\n output.space();\n if (self.alternative) {\n make_then(self, output);\n output.space();\n output.print(\"else\");\n output.space();\n if (self.alternative instanceof AST_If)\n self.alternative.print(output);\n else\n force_statement(self.alternative, output);\n } else {\n self._do_print_body(output);\n }\n });\n\n /* -----[ switch ]----- */\n DEFPRINT(AST_Switch, function(self, output) {\n output.print(\"switch\");\n output.space();\n output.with_parens(function() {\n self.expression.print(output);\n });\n output.space();\n var last = self.body.length - 1;\n if (last < 0) print_braced_empty(self, output);\n else output.with_block(function() {\n self.body.forEach(function(branch, i) {\n output.indent(true);\n branch.print(output);\n if (i < last && branch.body.length > 0)\n output.newline();\n });\n });\n });\n AST_SwitchBranch.DEFMETHOD(\"_do_print_body\", function(output) {\n output.newline();\n this.body.forEach(function(stmt) {\n output.indent();\n stmt.print(output);\n output.newline();\n });\n });\n DEFPRINT(AST_Default, function(self, output) {\n output.print(\"default:\");\n self._do_print_body(output);\n });\n DEFPRINT(AST_Case, function(self, output) {\n output.print(\"case\");\n output.space();\n self.expression.print(output);\n output.print(\":\");\n self._do_print_body(output);\n });\n\n /* -----[ exceptions ]----- */\n DEFPRINT(AST_Try, function(self, output) {\n output.print(\"try\");\n output.space();\n print_braced(self, output);\n if (self.bcatch) {\n output.space();\n self.bcatch.print(output);\n }\n if (self.bfinally) {\n output.space();\n self.bfinally.print(output);\n }\n });\n DEFPRINT(AST_Catch, function(self, output) {\n output.print(\"catch\");\n if (self.argname) {\n output.space();\n output.with_parens(function() {\n self.argname.print(output);\n });\n }\n output.space();\n print_braced(self, output);\n });\n DEFPRINT(AST_Finally, function(self, output) {\n output.print(\"finally\");\n output.space();\n print_braced(self, output);\n });\n\n /* -----[ var/const ]----- */\n AST_Definitions.DEFMETHOD(\"_do_print\", function(output, kind) {\n output.print(kind);\n output.space();\n this.definitions.forEach(function(def, i) {\n if (i) output.comma();\n def.print(output);\n });\n var p = output.parent();\n var in_for = p instanceof AST_For || p instanceof AST_ForIn;\n var output_semicolon = !in_for || p && p.init !== this;\n if (output_semicolon)\n output.semicolon();\n });\n DEFPRINT(AST_Let, function(self, output) {\n self._do_print(output, \"let\");\n });\n DEFPRINT(AST_Var, function(self, output) {\n self._do_print(output, \"var\");\n });\n DEFPRINT(AST_Const, function(self, output) {\n self._do_print(output, \"const\");\n });\n DEFPRINT(AST_Import, function(self, output) {\n output.print(\"import\");\n output.space();\n if (self.imported_name) {\n self.imported_name.print(output);\n }\n if (self.imported_name && self.imported_names) {\n output.print(\",\");\n output.space();\n }\n if (self.imported_names) {\n if (self.imported_names.length === 1 && self.imported_names[0].foreign_name.name === \"*\") {\n self.imported_names[0].print(output);\n } else {\n output.print(\"{\");\n self.imported_names.forEach(function (name_import, i) {\n output.space();\n name_import.print(output);\n if (i < self.imported_names.length - 1) {\n output.print(\",\");\n }\n });\n output.space();\n output.print(\"}\");\n }\n }\n if (self.imported_name || self.imported_names) {\n output.space();\n output.print(\"from\");\n output.space();\n }\n self.module_name.print(output);\n output.semicolon();\n });\n\n DEFPRINT(AST_NameMapping, function(self, output) {\n var is_import = output.parent() instanceof AST_Import;\n var definition = self.name.definition();\n var names_are_different =\n (definition && definition.mangled_name || self.name.name) !==\n self.foreign_name.name;\n if (names_are_different) {\n if (is_import) {\n output.print(self.foreign_name.name);\n } else {\n self.name.print(output);\n }\n output.space();\n output.print(\"as\");\n output.space();\n if (is_import) {\n self.name.print(output);\n } else {\n output.print(self.foreign_name.name);\n }\n } else {\n self.name.print(output);\n }\n });\n\n DEFPRINT(AST_Export, function(self, output) {\n output.print(\"export\");\n output.space();\n if (self.is_default) {\n output.print(\"default\");\n output.space();\n }\n if (self.exported_names) {\n if (self.exported_names.length === 1 && self.exported_names[0].name.name === \"*\") {\n self.exported_names[0].print(output);\n } else {\n output.print(\"{\");\n self.exported_names.forEach(function(name_export, i) {\n output.space();\n name_export.print(output);\n if (i < self.exported_names.length - 1) {\n output.print(\",\");\n }\n });\n output.space();\n output.print(\"}\");\n }\n } else if (self.exported_value) {\n self.exported_value.print(output);\n } else if (self.exported_definition) {\n self.exported_definition.print(output);\n if (self.exported_definition instanceof AST_Definitions) return;\n }\n if (self.module_name) {\n output.space();\n output.print(\"from\");\n output.space();\n self.module_name.print(output);\n }\n if (self.exported_value\n && !(self.exported_value instanceof AST_Defun ||\n self.exported_value instanceof AST_Function ||\n self.exported_value instanceof AST_Class)\n || self.module_name\n || self.exported_names\n ) {\n output.semicolon();\n }\n });\n\n function parenthesize_for_noin(node, output, noin) {\n var parens = false;\n // need to take some precautions here:\n // https://github.com/mishoo/UglifyJS2/issues/60\n if (noin) node.walk(new TreeWalker(function(node) {\n if (parens || node instanceof AST_Scope) return true;\n if (node instanceof AST_Binary && node.operator == \"in\") {\n parens = true;\n return true;\n }\n }));\n node.print(output, parens);\n }\n\n DEFPRINT(AST_VarDef, function(self, output) {\n self.name.print(output);\n if (self.value) {\n output.space();\n output.print(\"=\");\n output.space();\n var p = output.parent(1);\n var noin = p instanceof AST_For || p instanceof AST_ForIn;\n parenthesize_for_noin(self.value, output, noin);\n }\n });\n\n /* -----[ other expressions ]----- */\n DEFPRINT(AST_Call, function(self, output) {\n self.expression.print(output);\n if (self instanceof AST_New && !need_constructor_parens(self, output))\n return;\n if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) {\n output.add_mapping(self.start);\n }\n output.with_parens(function() {\n self.args.forEach(function(expr, i) {\n if (i) output.comma();\n expr.print(output);\n });\n });\n });\n DEFPRINT(AST_New, function(self, output) {\n output.print(\"new\");\n output.space();\n AST_Call.prototype._codegen(self, output);\n });\n\n AST_Sequence.DEFMETHOD(\"_do_print\", function(output) {\n this.expressions.forEach(function(node, index) {\n if (index > 0) {\n output.comma();\n if (output.should_break()) {\n output.newline();\n output.indent();\n }\n }\n node.print(output);\n });\n });\n DEFPRINT(AST_Sequence, function(self, output) {\n self._do_print(output);\n // var p = output.parent();\n // if (p instanceof AST_Statement) {\n // output.with_indent(output.next_indent(), function(){\n // self._do_print(output);\n // });\n // } else {\n // self._do_print(output);\n // }\n });\n DEFPRINT(AST_Dot, function(self, output) {\n var expr = self.expression;\n expr.print(output);\n var prop = self.property;\n if (output.option(\"ie8\") && RESERVED_WORDS(prop)) {\n output.print(\"[\");\n output.add_mapping(self.end);\n output.print_string(prop);\n output.print(\"]\");\n } else {\n if (expr instanceof AST_Number && expr.getValue() >= 0) {\n if (!/[xa-f.)]/i.test(output.last())) {\n output.print(\".\");\n }\n }\n output.print(\".\");\n // the name after dot would be mapped about here.\n output.add_mapping(self.end);\n output.print_name(prop);\n }\n });\n DEFPRINT(AST_Sub, function(self, output) {\n self.expression.print(output);\n output.print(\"[\");\n self.property.print(output);\n output.print(\"]\");\n });\n DEFPRINT(AST_UnaryPrefix, function(self, output) {\n var op = self.operator;\n output.print(op);\n if (/^[a-z]/i.test(op)\n || (/[+-]$/.test(op)\n && self.expression instanceof AST_UnaryPrefix\n && /^[+-]/.test(self.expression.operator))) {\n output.space();\n }\n self.expression.print(output);\n });\n DEFPRINT(AST_UnaryPostfix, function(self, output) {\n self.expression.print(output);\n output.print(self.operator);\n });\n DEFPRINT(AST_Binary, function(self, output) {\n var op = self.operator;\n self.left.print(output);\n if (op[0] == \">\" /* \">>\" \">>>\" \">\" \">=\" */\n && self.left instanceof AST_UnaryPostfix\n && self.left.operator == \"--\") {\n // space is mandatory to avoid outputting -->\n output.print(\" \");\n } else {\n // the space is optional depending on \"beautify\"\n output.space();\n }\n output.print(op);\n if ((op == \"<\" || op == \"<<\")\n && self.right instanceof AST_UnaryPrefix\n && self.right.operator == \"!\"\n && self.right.expression instanceof AST_UnaryPrefix\n && self.right.expression.operator == \"--\") {\n // space is mandatory to avoid outputting x ? y : false\n if (self.left.operator == \"||\") {\n var lr = self.left.right.evaluate(compressor);\n if (!lr) return make_node(AST_Conditional, self, {\n condition: self.left.left,\n consequent: self.right,\n alternative: self.left.right\n }).optimize(compressor);\n }\n break;\n case \"||\":\n var ll = self.left.truthy ? true : self.left.falsy ? false : self.left.evaluate(compressor);\n if (!ll) {\n compressor.warn(\"Condition left of || always false [{file}:{line},{col}]\", self.start);\n return make_sequence(self, [ self.left, self.right ]).optimize(compressor);\n } else if (!(ll instanceof AST_Node)) {\n compressor.warn(\"Condition left of || always true [{file}:{line},{col}]\", self.start);\n return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor);\n }\n var rr = self.right.evaluate(compressor);\n if (!rr) {\n var parent = compressor.parent();\n if (parent.operator == \"||\" && parent.left === compressor.self() || compressor.in_boolean_context()) {\n compressor.warn(\"Dropping side-effect-free || [{file}:{line},{col}]\", self.start);\n return self.left.optimize(compressor);\n }\n } else if (!(rr instanceof AST_Node)) {\n if (compressor.in_boolean_context()) {\n compressor.warn(\"Boolean || always true [{file}:{line},{col}]\", self.start);\n return make_sequence(self, [\n self.left,\n make_node(AST_True, self)\n ]).optimize(compressor);\n } else self.truthy = true;\n }\n if (self.left.operator == \"&&\") {\n var lr = self.left.right.evaluate(compressor);\n if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, {\n condition: self.left.left,\n consequent: self.left.right,\n alternative: self.right\n }).optimize(compressor);\n }\n break;\n }\n var associative = true;\n switch (self.operator) {\n case \"+\":\n // \"foo\" + (\"bar\" + x) => \"foobar\" + x\n if (self.left instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == \"+\"\n && self.right.left instanceof AST_Constant\n && self.right.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: make_node(AST_String, self.left, {\n value: \"\" + self.left.getValue() + self.right.left.getValue(),\n start: self.left.start,\n end: self.right.left.end\n }),\n right: self.right.right\n });\n }\n // (x + \"foo\") + \"bar\" => x + \"foobar\"\n if (self.right instanceof AST_Constant\n && self.left instanceof AST_Binary\n && self.left.operator == \"+\"\n && self.left.right instanceof AST_Constant\n && self.left.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: self.left.left,\n right: make_node(AST_String, self.right, {\n value: \"\" + self.left.right.getValue() + self.right.getValue(),\n start: self.left.right.start,\n end: self.right.end\n })\n });\n }\n // (x + \"foo\") + (\"bar\" + y) => (x + \"foobar\") + y\n if (self.left instanceof AST_Binary\n && self.left.operator == \"+\"\n && self.left.is_string(compressor)\n && self.left.right instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == \"+\"\n && self.right.left instanceof AST_Constant\n && self.right.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: make_node(AST_Binary, self.left, {\n operator: \"+\",\n left: self.left.left,\n right: make_node(AST_String, self.left.right, {\n value: \"\" + self.left.right.getValue() + self.right.left.getValue(),\n start: self.left.right.start,\n end: self.right.left.end\n })\n }),\n right: self.right.right\n });\n }\n // a + -b => a - b\n if (self.right instanceof AST_UnaryPrefix\n && self.right.operator == \"-\"\n && self.left.is_number(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"-\",\n left: self.left,\n right: self.right.expression\n });\n break;\n }\n // -a + b => b - a\n if (self.left instanceof AST_UnaryPrefix\n && self.left.operator == \"-\"\n && reversible()\n && self.right.is_number(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"-\",\n left: self.right,\n right: self.left.expression\n });\n break;\n }\n case \"*\":\n associative = compressor.option(\"unsafe_math\");\n case \"&\":\n case \"|\":\n case \"^\":\n // a + +b => +b + a\n if (self.left.is_number(compressor)\n && self.right.is_number(compressor)\n && reversible()\n && !(self.left instanceof AST_Binary\n && self.left.operator != self.operator\n && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {\n var reversed = make_node(AST_Binary, self, {\n operator: self.operator,\n left: self.right,\n right: self.left\n });\n if (self.right instanceof AST_Constant\n && !(self.left instanceof AST_Constant)) {\n self = best_of(compressor, reversed, self);\n } else {\n self = best_of(compressor, self, reversed);\n }\n }\n if (associative && self.is_number(compressor)) {\n // a + (b + c) => (a + b) + c\n if (self.right instanceof AST_Binary\n && self.right.operator == self.operator) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: self.left,\n right: self.right.left,\n start: self.left.start,\n end: self.right.left.end\n }),\n right: self.right.right\n });\n }\n // (n + 2) + 3 => 5 + n\n // (2 * n) * 3 => 6 + n\n if (self.right instanceof AST_Constant\n && self.left instanceof AST_Binary\n && self.left.operator == self.operator) {\n if (self.left.left instanceof AST_Constant) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: self.left.left,\n right: self.right,\n start: self.left.left.start,\n end: self.right.end\n }),\n right: self.left.right\n });\n } else if (self.left.right instanceof AST_Constant) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: self.left.right,\n right: self.right,\n start: self.left.right.start,\n end: self.right.end\n }),\n right: self.left.left\n });\n }\n }\n // (a | 1) | (2 | d) => (3 | a) | b\n if (self.left instanceof AST_Binary\n && self.left.operator == self.operator\n && self.left.right instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == self.operator\n && self.right.left instanceof AST_Constant) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left.left, {\n operator: self.operator,\n left: self.left.right,\n right: self.right.left,\n start: self.left.right.start,\n end: self.right.left.end\n }),\n right: self.left.left\n }),\n right: self.right.right\n });\n }\n }\n }\n }\n // x && (y && z) ==> x && y && z\n // x || (y || z) ==> x || y || z\n // x + (\"y\" + z) ==> x + \"y\" + z\n // \"x\" + (y + \"z\")==> \"x\" + y + \"z\"\n if (self.right instanceof AST_Binary\n && self.right.operator == self.operator\n && (lazy_op(self.operator)\n || (self.operator == \"+\"\n && (self.right.left.is_string(compressor)\n || (self.left.is_string(compressor)\n && self.right.right.is_string(compressor)))))\n ) {\n self.left = make_node(AST_Binary, self.left, {\n operator : self.operator,\n left : self.left,\n right : self.right.left\n });\n self.right = self.right.right;\n return self.transform(compressor);\n }\n var ev = self.evaluate(compressor);\n if (ev !== self) {\n ev = make_node_from_constant(ev, self).optimize(compressor);\n return best_of(compressor, ev, self);\n }\n return self;\n });\n\n OPT(AST_SymbolExport, function(self, compressor) {\n return self;\n });\n\n function recursive_ref(compressor, def) {\n var node;\n for (var i = 0; node = compressor.parent(i); i++) {\n if (node instanceof AST_Lambda) {\n var name = node.name;\n if (name && name.definition() === def) break;\n }\n }\n return node;\n }\n\n function within_array_or_object_literal(compressor) {\n var node, level = 0;\n while (node = compressor.parent(level++)) {\n if (node instanceof AST_Statement) return false;\n if (node instanceof AST_Array\n || node instanceof AST_ObjectKeyVal\n || node instanceof AST_Object) {\n return true;\n }\n }\n return false;\n }\n\n OPT(AST_SymbolRef, function(self, compressor) {\n if (!compressor.option(\"ie8\")\n && is_undeclared_ref(self)\n && (!self.scope.uses_with || !compressor.find_parent(AST_With))) {\n switch (self.name) {\n case \"undefined\":\n return make_node(AST_Undefined, self).optimize(compressor);\n case \"NaN\":\n return make_node(AST_NaN, self).optimize(compressor);\n case \"Infinity\":\n return make_node(AST_Infinity, self).optimize(compressor);\n }\n }\n var parent = compressor.parent();\n if (compressor.option(\"reduce_vars\") && is_lhs(self, parent) !== self) {\n var d = self.definition();\n if (compressor.top_retain && d.global && compressor.top_retain(d)) {\n d.fixed = false;\n d.should_replace = false;\n d.single_use = false;\n return self;\n }\n var fixed = self.fixed_value();\n var single_use = d.single_use\n && !(parent instanceof AST_Call && parent.is_expr_pure(compressor));\n if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) {\n if (retain_top_func(fixed, compressor)) {\n single_use = false;\n } else if (d.scope !== self.scope\n && (!compressor.option(\"reduce_funcs\") && fixed instanceof AST_Lambda\n || d.escaped == 1\n || fixed.inlined\n || within_array_or_object_literal(compressor))) {\n single_use = false;\n } else if (recursive_ref(compressor, d)) {\n single_use = false;\n } else if (d.scope !== self.scope || d.orig[0] instanceof AST_SymbolFunarg) {\n single_use = fixed.is_constant_expression(self.scope);\n if (single_use == \"f\") {\n var scope = self.scope;\n do {\n if (scope instanceof AST_Defun || is_func_expr(scope)) {\n scope.inlined = true;\n }\n } while (scope = scope.parent_scope);\n }\n }\n }\n if (single_use && fixed) {\n if (fixed instanceof AST_DefClass) {\n fixed = make_node(AST_ClassExpression, fixed, fixed);\n }\n if (fixed instanceof AST_Defun) {\n fixed._squeezed = true;\n fixed = make_node(AST_Function, fixed, fixed);\n }\n var value;\n if (d.recursive_refs > 0 && fixed.name instanceof AST_SymbolDefun) {\n value = fixed.clone(true);\n var defun_def = value.name.definition();\n var lambda_def = value.variables.get(value.name.name);\n var name = lambda_def && lambda_def.orig[0];\n if (!(name instanceof AST_SymbolLambda)) {\n name = make_node(AST_SymbolLambda, value.name, value.name);\n name.scope = value;\n value.name = name;\n lambda_def = value.def_function(name);\n }\n value.walk(new TreeWalker(function(node) {\n if (node instanceof AST_SymbolRef && node.definition() === defun_def) {\n node.thedef = lambda_def;\n lambda_def.references.push(node);\n }\n }));\n } else {\n value = fixed.optimize(compressor);\n if (value === fixed) value = fixed.clone(true);\n }\n return value;\n }\n if (fixed && d.should_replace === undefined) {\n var init;\n if (fixed instanceof AST_This) {\n if (!(d.orig[0] instanceof AST_SymbolFunarg)\n && all(d.references, function(ref) {\n return d.scope === ref.scope;\n })) {\n init = fixed;\n }\n } else {\n var ev = fixed.evaluate(compressor);\n if (ev !== fixed && (compressor.option(\"unsafe_regexp\") || !(ev instanceof RegExp))) {\n init = make_node_from_constant(ev, fixed);\n }\n }\n if (init) {\n var value_length = init.optimize(compressor).print_to_string().length;\n var fn;\n if (has_symbol_ref(fixed)) {\n fn = function() {\n var result = init.optimize(compressor);\n return result === init ? result.clone(true) : result;\n };\n } else {\n value_length = Math.min(value_length, fixed.print_to_string().length);\n fn = function() {\n var result = best_of_expression(init.optimize(compressor), fixed);\n return result === init || result === fixed ? result.clone(true) : result;\n };\n }\n var name_length = d.name.length;\n var overhead = 0;\n if (compressor.option(\"unused\") && !compressor.exposed(d)) {\n overhead = (name_length + 2 + value_length) / (d.references.length - d.assignments);\n }\n d.should_replace = value_length <= name_length + overhead ? fn : false;\n } else {\n d.should_replace = false;\n }\n }\n if (d.should_replace) {\n return d.should_replace();\n }\n }\n return self;\n\n function has_symbol_ref(value) {\n var found;\n value.walk(new TreeWalker(function(node) {\n if (node instanceof AST_SymbolRef) found = true;\n if (found) return true;\n }));\n return found;\n }\n });\n\n function is_atomic(lhs, self) {\n return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE;\n }\n\n OPT(AST_Undefined, function(self, compressor) {\n if (compressor.option(\"unsafe_undefined\")) {\n var undef = find_variable(compressor, \"undefined\");\n if (undef) {\n var ref = make_node(AST_SymbolRef, self, {\n name : \"undefined\",\n scope : undef.scope,\n thedef : undef\n });\n ref.is_undefined = true;\n return ref;\n }\n }\n var lhs = is_lhs(compressor.self(), compressor.parent());\n if (lhs && is_atomic(lhs, self)) return self;\n return make_node(AST_UnaryPrefix, self, {\n operator: \"void\",\n expression: make_node(AST_Number, self, {\n value: 0\n })\n });\n });\n\n OPT(AST_Infinity, function(self, compressor) {\n var lhs = is_lhs(compressor.self(), compressor.parent());\n if (lhs && is_atomic(lhs, self)) return self;\n if (compressor.option(\"keep_infinity\")\n && !(lhs && !is_atomic(lhs, self))\n && !find_variable(compressor, \"Infinity\"))\n return self;\n return make_node(AST_Binary, self, {\n operator: \"/\",\n left: make_node(AST_Number, self, {\n value: 1\n }),\n right: make_node(AST_Number, self, {\n value: 0\n })\n });\n });\n\n OPT(AST_NaN, function(self, compressor) {\n var lhs = is_lhs(compressor.self(), compressor.parent());\n if (lhs && !is_atomic(lhs, self)\n || find_variable(compressor, \"NaN\")) {\n return make_node(AST_Binary, self, {\n operator: \"/\",\n left: make_node(AST_Number, self, {\n value: 0\n }),\n right: make_node(AST_Number, self, {\n value: 0\n })\n });\n }\n return self;\n });\n\n function is_reachable(self, defs) {\n var reachable = false;\n var find_ref = new TreeWalker(function(node) {\n if (reachable) return true;\n if (node instanceof AST_SymbolRef && member(node.definition(), defs)) {\n return reachable = true;\n }\n });\n var scan_scope = new TreeWalker(function(node) {\n if (reachable) return true;\n if (node instanceof AST_Scope && node !== self) {\n var parent = scan_scope.parent();\n if (parent instanceof AST_Call && parent.expression === node) return;\n node.walk(find_ref);\n return true;\n }\n });\n self.walk(scan_scope);\n return reachable;\n }\n\n var ASSIGN_OPS = [ \"+\", \"-\", \"/\", \"*\", \"%\", \">>\", \"<<\", \">>>\", \"|\", \"^\", \"&\" ];\n var ASSIGN_OPS_COMMUTATIVE = [ \"*\", \"|\", \"^\", \"&\" ];\n OPT(AST_Assign, function(self, compressor) {\n var def;\n if (compressor.option(\"dead_code\")\n && self.left instanceof AST_SymbolRef\n && (def = self.left.definition()).scope === compressor.find_parent(AST_Lambda)) {\n var level = 0, node, parent = self;\n do {\n node = parent;\n parent = compressor.parent(level++);\n if (parent instanceof AST_Exit) {\n if (in_try(level, parent)) break;\n if (is_reachable(def.scope, [ def ])) break;\n if (self.operator == \"=\") return self.right;\n def.fixed = false;\n return make_node(AST_Binary, self, {\n operator: self.operator.slice(0, -1),\n left: self.left,\n right: self.right\n }).optimize(compressor);\n }\n } while (parent instanceof AST_Binary && parent.right === node\n || parent instanceof AST_Sequence && parent.tail_node() === node);\n }\n self = self.lift_sequences(compressor);\n if (self.operator == \"=\" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary) {\n // x = expr1 OP expr2\n if (self.right.left instanceof AST_SymbolRef\n && self.right.left.name == self.left.name\n && member(self.right.operator, ASSIGN_OPS)) {\n // x = x - 2 ---> x -= 2\n self.operator = self.right.operator + \"=\";\n self.right = self.right.right;\n } else if (self.right.right instanceof AST_SymbolRef\n && self.right.right.name == self.left.name\n && member(self.right.operator, ASSIGN_OPS_COMMUTATIVE)\n && !self.right.left.has_side_effects(compressor)) {\n // x = 2 & x ---> x &= 2\n self.operator = self.right.operator + \"=\";\n self.right = self.right.left;\n }\n }\n return self;\n\n function in_try(level, node) {\n var right = self.right;\n self.right = make_node(AST_Null, right);\n var may_throw = node.may_throw(compressor);\n self.right = right;\n var scope = self.left.definition().scope;\n var parent;\n while ((parent = compressor.parent(level++)) !== scope) {\n if (parent instanceof AST_Try) {\n if (parent.bfinally) return true;\n if (may_throw && parent.bcatch) return true;\n }\n }\n }\n });\n\n OPT(AST_DefaultAssign, function(self, compressor) {\n if (!compressor.option(\"evaluate\")) {\n return self;\n }\n var evaluateRight = self.right.evaluate(compressor);\n\n // `[x = undefined] = foo` ---> `[x] = foo`\n if (evaluateRight === undefined) {\n self = self.left;\n } else if (evaluateRight !== self.right) {\n evaluateRight = make_node_from_constant(evaluateRight, self.right);\n self.right = best_of_expression(evaluateRight, self.right);\n }\n\n return self;\n });\n\n OPT(AST_Conditional, function(self, compressor) {\n if (!compressor.option(\"conditionals\")) return self;\n // This looks like lift_sequences(), should probably be under \"sequences\"\n if (self.condition instanceof AST_Sequence) {\n var expressions = self.condition.expressions.slice();\n self.condition = expressions.pop();\n expressions.push(self);\n return make_sequence(self, expressions);\n }\n var cond = self.condition.evaluate(compressor);\n if (cond !== self.condition) {\n if (cond) {\n compressor.warn(\"Condition always true [{file}:{line},{col}]\", self.start);\n return maintain_this_binding(compressor.parent(), compressor.self(), self.consequent);\n } else {\n compressor.warn(\"Condition always false [{file}:{line},{col}]\", self.start);\n return maintain_this_binding(compressor.parent(), compressor.self(), self.alternative);\n }\n }\n var negated = cond.negate(compressor, first_in_statement(compressor));\n if (best_of(compressor, cond, negated) === negated) {\n self = make_node(AST_Conditional, self, {\n condition: negated,\n consequent: self.alternative,\n alternative: self.consequent\n });\n }\n var condition = self.condition;\n var consequent = self.consequent;\n var alternative = self.alternative;\n // x?x:y --> x||y\n if (condition instanceof AST_SymbolRef\n && consequent instanceof AST_SymbolRef\n && condition.definition() === consequent.definition()) {\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: condition,\n right: alternative\n });\n }\n // if (foo) exp = something; else exp = something_else;\n // |\n // v\n // exp = foo ? something : something_else;\n if (consequent instanceof AST_Assign\n && alternative instanceof AST_Assign\n && consequent.operator == alternative.operator\n && consequent.left.equivalent_to(alternative.left)\n && (!self.condition.has_side_effects(compressor)\n || consequent.operator == \"=\"\n && !consequent.left.has_side_effects(compressor))) {\n return make_node(AST_Assign, self, {\n operator: consequent.operator,\n left: consequent.left,\n right: make_node(AST_Conditional, self, {\n condition: self.condition,\n consequent: consequent.right,\n alternative: alternative.right\n })\n });\n }\n // x ? y(a) : y(b) --> y(x ? a : b)\n var arg_index;\n if (consequent instanceof AST_Call\n && alternative.TYPE === consequent.TYPE\n && consequent.args.length > 0\n && consequent.args.length == alternative.args.length\n && consequent.expression.equivalent_to(alternative.expression)\n && !self.condition.has_side_effects(compressor)\n && !consequent.expression.has_side_effects(compressor)\n && typeof (arg_index = single_arg_diff()) == \"number\") {\n var node = consequent.clone();\n node.args[arg_index] = make_node(AST_Conditional, self, {\n condition: self.condition,\n consequent: consequent.args[arg_index],\n alternative: alternative.args[arg_index]\n });\n return node;\n }\n // x?y?z:a:a --> x&&y?z:a\n if (consequent instanceof AST_Conditional\n && consequent.alternative.equivalent_to(alternative)) {\n return make_node(AST_Conditional, self, {\n condition: make_node(AST_Binary, self, {\n left: self.condition,\n operator: \"&&\",\n right: consequent.condition\n }),\n consequent: consequent.consequent,\n alternative: alternative\n });\n }\n // x ? y : y --> x, y\n if (consequent.equivalent_to(alternative)) {\n return make_sequence(self, [\n self.condition,\n consequent\n ]).optimize(compressor);\n }\n // x ? y || z : z --> x && y || z\n if (consequent instanceof AST_Binary\n && consequent.operator == \"||\"\n && consequent.right.equivalent_to(alternative)) {\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: make_node(AST_Binary, self, {\n operator: \"&&\",\n left: self.condition,\n right: consequent.left\n }),\n right: alternative\n }).optimize(compressor);\n }\n var in_bool = compressor.in_boolean_context();\n if (is_true(self.consequent)) {\n if (is_false(self.alternative)) {\n // c ? true : false ---> !!c\n return booleanize(self.condition);\n }\n // c ? true : x ---> !!c || x\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: booleanize(self.condition),\n right: self.alternative\n });\n }\n if (is_false(self.consequent)) {\n if (is_true(self.alternative)) {\n // c ? false : true ---> !c\n return booleanize(self.condition.negate(compressor));\n }\n // c ? false : x ---> !c && x\n return make_node(AST_Binary, self, {\n operator: \"&&\",\n left: booleanize(self.condition.negate(compressor)),\n right: self.alternative\n });\n }\n if (is_true(self.alternative)) {\n // c ? x : true ---> !c || x\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: booleanize(self.condition.negate(compressor)),\n right: self.consequent\n });\n }\n if (is_false(self.alternative)) {\n // c ? x : false ---> !!c && x\n return make_node(AST_Binary, self, {\n operator: \"&&\",\n left: booleanize(self.condition),\n right: self.consequent\n });\n }\n\n return self;\n\n function booleanize(node) {\n if (node.is_boolean()) return node;\n // !!expression\n return make_node(AST_UnaryPrefix, node, {\n operator: \"!\",\n expression: node.negate(compressor)\n });\n }\n\n // AST_True or !0\n function is_true(node) {\n return node instanceof AST_True\n || in_bool\n && node instanceof AST_Constant\n && node.getValue()\n || (node instanceof AST_UnaryPrefix\n && node.operator == \"!\"\n && node.expression instanceof AST_Constant\n && !node.expression.getValue());\n }\n // AST_False or !1\n function is_false(node) {\n return node instanceof AST_False\n || in_bool\n && node instanceof AST_Constant\n && !node.getValue()\n || (node instanceof AST_UnaryPrefix\n && node.operator == \"!\"\n && node.expression instanceof AST_Constant\n && node.expression.getValue());\n }\n\n function single_arg_diff() {\n var a = consequent.args;\n var b = alternative.args;\n for (var i = 0, len = a.length; i < len; i++) {\n if (a[i] instanceof AST_Expansion) return;\n if (!a[i].equivalent_to(b[i])) {\n if (b[i] instanceof AST_Expansion) return;\n for (var j = i + 1; j < len; j++) {\n if (a[j] instanceof AST_Expansion) return;\n if (!a[j].equivalent_to(b[j])) return;\n }\n return i;\n }\n }\n }\n });\n\n OPT(AST_Boolean, function(self, compressor) {\n if (compressor.in_boolean_context()) return make_node(AST_Number, self, {\n value: +self.value\n });\n var p = compressor.parent();\n if (compressor.option(\"booleans_as_integers\")) {\n if (p instanceof AST_Binary && (p.operator == \"===\" || p.operator == \"!==\")) {\n p.operator = p.operator.replace(/=$/, \"\");\n }\n return make_node(AST_Number, self, {\n value: +self.value\n });\n }\n if (compressor.option(\"booleans\")) {\n if (p instanceof AST_Binary && (p.operator == \"==\"\n || p.operator == \"!=\")) {\n compressor.warn(\"Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]\", {\n operator : p.operator,\n value : self.value,\n file : p.start.file,\n line : p.start.line,\n col : p.start.col,\n });\n return make_node(AST_Number, self, {\n value: +self.value\n });\n }\n return make_node(AST_UnaryPrefix, self, {\n operator: \"!\",\n expression: make_node(AST_Number, self, {\n value: 1 - self.value\n })\n });\n }\n return self;\n });\n\n function safe_to_flatten(value, compressor) {\n if (value instanceof AST_SymbolRef) {\n value = value.fixed_value();\n }\n if (!value) return false;\n return !(value instanceof AST_Lambda || value instanceof AST_Class)\n || compressor.parent() instanceof AST_New\n || !value.contains_this();\n }\n\n OPT(AST_Sub, function(self, compressor) {\n var expr = self.expression;\n var prop = self.property;\n if (compressor.option(\"properties\")) {\n var key = prop.evaluate(compressor);\n if (key !== prop) {\n if (typeof key == \"string\") {\n if (key == \"undefined\") {\n key = undefined;\n } else {\n var value = parseFloat(key);\n if (value.toString() == key) {\n key = value;\n }\n }\n }\n prop = self.property = best_of_expression(prop, make_node_from_constant(key, prop).transform(compressor));\n var property = \"\" + key;\n if (is_identifier_string(property)\n && property.length <= prop.print_to_string().length + 1) {\n return make_node(AST_Dot, self, {\n expression: expr,\n property: property\n }).optimize(compressor);\n }\n }\n }\n var fn;\n OPT_ARGUMENTS: if (compressor.option(\"arguments\")\n && expr instanceof AST_SymbolRef\n && expr.name == \"arguments\"\n && expr.definition().orig.length == 1\n && (fn = expr.scope) instanceof AST_Lambda\n && fn.uses_arguments\n && !(fn instanceof AST_Arrow)\n && prop instanceof AST_Number) {\n var index = prop.getValue();\n var params = Object.create(null);\n var argnames = fn.argnames;\n for (var n = 0; n < argnames.length; n++) {\n if (!(argnames[n] instanceof AST_SymbolFunarg)) {\n break OPT_ARGUMENTS; // destructuring parameter - bail\n }\n var param = argnames[n].name;\n if (param in params) {\n break OPT_ARGUMENTS; // duplicate parameter - bail\n }\n params[param] = true;\n }\n var argname = fn.argnames[index];\n if (argname && compressor.has_directive(\"use strict\")) {\n var def = argname.definition();\n if (!compressor.option(\"reduce_vars\") || def.assignments || def.orig.length > 1) {\n argname = null;\n }\n } else if (!argname && !compressor.option(\"keep_fargs\") && index < fn.argnames.length + 5) {\n while (index >= fn.argnames.length) {\n argname = make_node(AST_SymbolFunarg, fn, {\n name: fn.make_var_name(\"argument_\" + fn.argnames.length),\n scope: fn\n });\n fn.argnames.push(argname);\n fn.enclosed.push(fn.def_variable(argname));\n }\n }\n if (argname) {\n var sym = make_node(AST_SymbolRef, self, argname);\n sym.reference({});\n delete argname.__unused;\n return sym;\n }\n }\n if (is_lhs(self, compressor.parent())) return self;\n if (key !== prop) {\n var sub = self.flatten_object(property, compressor);\n if (sub) {\n expr = self.expression = sub.expression;\n prop = self.property = sub.property;\n }\n }\n if (compressor.option(\"properties\") && compressor.option(\"side_effects\")\n && prop instanceof AST_Number && expr instanceof AST_Array) {\n var index = prop.getValue();\n var elements = expr.elements;\n var retValue = elements[index];\n FLATTEN: if (safe_to_flatten(retValue, compressor)) {\n var flatten = true;\n var values = [];\n for (var i = elements.length; --i > index;) {\n var value = elements[i].drop_side_effect_free(compressor);\n if (value) {\n values.unshift(value);\n if (flatten && value.has_side_effects(compressor)) flatten = false;\n }\n }\n if (retValue instanceof AST_Expansion) break FLATTEN;\n retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue;\n if (!flatten) values.unshift(retValue);\n while (--i >= 0) {\n var value = elements[i];\n if (value instanceof AST_Expansion) break FLATTEN;\n value = value.drop_side_effect_free(compressor);\n if (value) values.unshift(value);\n else index--;\n }\n if (flatten) {\n values.push(retValue);\n return make_sequence(self, values).optimize(compressor);\n } else return make_node(AST_Sub, self, {\n expression: make_node(AST_Array, expr, {\n elements: values\n }),\n property: make_node(AST_Number, prop, {\n value: index\n })\n });\n }\n }\n var ev = self.evaluate(compressor);\n if (ev !== self) {\n ev = make_node_from_constant(ev, self).optimize(compressor);\n return best_of(compressor, ev, self);\n }\n return self;\n });\n\n AST_Lambda.DEFMETHOD(\"contains_this\", function() {\n var result;\n var self = this;\n self.walk(new TreeWalker(function(node) {\n if (result) return true;\n if (node instanceof AST_This) return result = true;\n if (node !== self && node instanceof AST_Scope && !(node instanceof AST_Arrow)) return true;\n }));\n return result;\n });\n\n AST_PropAccess.DEFMETHOD(\"flatten_object\", function(key, compressor) {\n if (!compressor.option(\"properties\")) return;\n var arrows = compressor.option(\"unsafe_arrows\") && compressor.option(\"ecma\") >= 6;\n var expr = this.expression;\n if (expr instanceof AST_Object) {\n var props = expr.properties;\n for (var i = props.length; --i >= 0;) {\n var prop = props[i];\n if (\"\" + (prop instanceof AST_ConciseMethod ? prop.key.name : prop.key) == key) {\n if (!all(props, function(prop) {\n return prop instanceof AST_ObjectKeyVal\n || arrows && prop instanceof AST_ConciseMethod && !prop.is_generator;\n })) break;\n if (!safe_to_flatten(prop.value, compressor)) break;\n return make_node(AST_Sub, this, {\n expression: make_node(AST_Array, expr, {\n elements: props.map(function(prop) {\n var v = prop.value;\n if (v instanceof AST_Accessor) v = make_node(AST_Function, v, v);\n var k = prop.key;\n if (k instanceof AST_Node && !(k instanceof AST_SymbolMethod)) {\n return make_sequence(prop, [ k, v ]);\n }\n return v;\n })\n }),\n property: make_node(AST_Number, this, {\n value: i\n })\n });\n }\n }\n }\n });\n\n OPT(AST_Dot, function(self, compressor) {\n if (self.property == \"arguments\" || self.property == \"caller\") {\n compressor.warn(\"Function.protoype.{prop} not supported [{file}:{line},{col}]\", {\n prop: self.property,\n file: self.start.file,\n line: self.start.line,\n col: self.start.col\n });\n }\n if (is_lhs(self, compressor.parent())) return self;\n if (compressor.option(\"unsafe_proto\")\n && self.expression instanceof AST_Dot\n && self.expression.property == \"prototype\") {\n var exp = self.expression.expression;\n if (is_undeclared_ref(exp)) switch (exp.name) {\n case \"Array\":\n self.expression = make_node(AST_Array, self.expression, {\n elements: []\n });\n break;\n case \"Function\":\n self.expression = make_node(AST_Function, self.expression, {\n argnames: [],\n body: []\n });\n break;\n case \"Number\":\n self.expression = make_node(AST_Number, self.expression, {\n value: 0\n });\n break;\n case \"Object\":\n self.expression = make_node(AST_Object, self.expression, {\n properties: []\n });\n break;\n case \"RegExp\":\n self.expression = make_node(AST_RegExp, self.expression, {\n value: /t/\n });\n break;\n case \"String\":\n self.expression = make_node(AST_String, self.expression, {\n value: \"\"\n });\n break;\n }\n }\n var sub = self.flatten_object(self.property, compressor);\n if (sub) return sub.optimize(compressor);\n var ev = self.evaluate(compressor);\n if (ev !== self) {\n ev = make_node_from_constant(ev, self).optimize(compressor);\n return best_of(compressor, ev, self);\n }\n return self;\n });\n\n function literals_in_boolean_context(self, compressor) {\n if (compressor.in_boolean_context()) {\n return best_of(compressor, self, make_sequence(self, [\n self,\n make_node(AST_True, self)\n ]).optimize(compressor));\n }\n return self;\n }\n OPT(AST_Array, literals_in_boolean_context);\n OPT(AST_Object, literals_in_boolean_context);\n OPT(AST_RegExp, literals_in_boolean_context);\n\n OPT(AST_Return, function(self, compressor) {\n if (self.value && is_undefined(self.value, compressor)) {\n self.value = null;\n }\n return self;\n });\n\n OPT(AST_Arrow, function(self, compressor) {\n if (!(self.body instanceof AST_Node)) {\n self = opt_AST_Lambda(self, compressor);\n }\n if (compressor.option(\"arrows\")\n && self.body.length == 1\n && self.body[0] instanceof AST_Return) {\n var value = self.body[0].value;\n self.body = value ? value : [];\n }\n return self;\n });\n\n OPT(AST_Function, function(self, compressor) {\n self = opt_AST_Lambda(self, compressor);\n if (compressor.option(\"unsafe_arrows\")\n && compressor.option(\"ecma\") >= 6\n && !self.name\n && !self.is_generator\n && !self.uses_arguments\n && !self.pinned()) {\n var has_special_symbol = false;\n self.walk(new TreeWalker(function(node) {\n if (has_special_symbol) return true;\n if (node instanceof AST_This) {\n has_special_symbol = true;\n return true;\n }\n }));\n if (!has_special_symbol) return make_node(AST_Arrow, self, self).optimize(compressor);\n }\n return self;\n });\n\n OPT(AST_Class, function(self, compressor) {\n // HACK to avoid compress failure.\n // AST_Class is not really an AST_Scope/AST_Block as it lacks a body.\n return self;\n });\n\n OPT(AST_Yield, function(self, compressor) {\n if (self.expression && !self.is_star && is_undefined(self.expression, compressor)) {\n self.expression = null;\n }\n return self;\n });\n\n OPT(AST_TemplateString, function(self, compressor) {\n if (!compressor.option(\"evaluate\")\n || compressor.parent() instanceof AST_PrefixedTemplateString)\n return self;\n\n var segments = [];\n for (var i = 0; i < self.segments.length; i++) {\n var segment = self.segments[i];\n if (segment instanceof AST_Node) {\n var result = segment.evaluate(compressor);\n // Evaluate to constant value\n // Constant value shorter than ${segment}\n if (result !== segment && (result + \"\").length <= segment.print_to_string().length + \"${}\".length) {\n // There should always be a previous and next segment if segment is a node\n segments[segments.length - 1].value = segments[segments.length - 1].value + result + self.segments[++i].value;\n continue;\n }\n }\n segments.push(segment);\n }\n self.segments = segments;\n\n return segments.length == 1 ? make_node(AST_String, self, segments[0]) : self;\n });\n\n OPT(AST_PrefixedTemplateString, function(self, compressor) {\n return self;\n });\n\n // [\"p\"]:1 ---> p:1\n // [42]:1 ---> 42:1\n function lift_key(self, compressor) {\n if (!compressor.option(\"computed_props\")) return self;\n // save a comparison in the typical case\n if (!(self.key instanceof AST_Constant)) return self;\n // whitelist acceptable props as not all AST_Constants are true constants\n if (self.key instanceof AST_String || self.key instanceof AST_Number) {\n if (self.key.value === \"__proto__\") return self;\n if (self.key.value == \"constructor\"\n && compressor.parent() instanceof AST_Class) return self;\n if (self instanceof AST_ObjectKeyVal) {\n self.key = self.key.value;\n } else {\n self.key = make_node(AST_SymbolMethod, self.key, {\n name: self.key.value\n });\n }\n }\n return self;\n }\n\n OPT(AST_ObjectProperty, lift_key);\n\n OPT(AST_ConciseMethod, function(self, compressor) {\n lift_key(self, compressor);\n // p(){return x;} ---> p:()=>x\n if (compressor.option(\"arrows\")\n && compressor.parent() instanceof AST_Object\n && !self.is_generator\n && !self.value.uses_arguments\n && !self.value.pinned()\n && self.value.body.length == 1\n && self.value.body[0] instanceof AST_Return\n && self.value.body[0].value\n && !self.value.contains_this()) {\n var arrow = make_node(AST_Arrow, self.value, self.value);\n arrow.async = self.async;\n arrow.is_generator = self.is_generator;\n return make_node(AST_ObjectKeyVal, self, {\n key: self.key instanceof AST_SymbolMethod ? self.key.name : self.key,\n value: arrow,\n quote: self.quote,\n });\n }\n return self;\n });\n\n OPT(AST_ObjectKeyVal, function(self, compressor) {\n lift_key(self, compressor);\n // p:function(){} ---> p(){}\n // p:function*(){} ---> *p(){}\n // p:async function(){} ---> async p(){}\n // p:()=>{} ---> p(){}\n // p:async()=>{} ---> async p(){}\n var unsafe_methods = compressor.option(\"unsafe_methods\");\n if (unsafe_methods\n && compressor.option(\"ecma\") >= 6\n && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + \"\"))) {\n var key = self.key;\n var value = self.value;\n var is_arrow_with_block = value instanceof AST_Arrow\n && Array.isArray(value.body)\n && !value.contains_this();\n if ((is_arrow_with_block || value instanceof AST_Function) && !value.name) {\n return make_node(AST_ConciseMethod, self, {\n async: value.async,\n is_generator: value.is_generator,\n key: key instanceof AST_Node ? key : make_node(AST_SymbolMethod, self, {\n name: key,\n }),\n value: make_node(AST_Accessor, value, value),\n quote: self.quote,\n });\n }\n }\n return self;\n });\n\n OPT(AST_Destructuring, function(self, compressor) {\n if (compressor.option(\"pure_getters\") == true\n && compressor.option(\"unused\")\n && !self.is_array\n && Array.isArray(self.names)\n && !is_destructuring_export_decl(compressor)) {\n var keep = [];\n for (var i = 0; i < self.names.length; i++) {\n var elem = self.names[i];\n if (!(elem instanceof AST_ObjectKeyVal\n && typeof elem.key == \"string\"\n && elem.value instanceof AST_SymbolDeclaration\n && !should_retain(compressor, elem.value.definition()))) {\n keep.push(elem);\n }\n }\n if (keep.length != self.names.length) {\n self.names = keep;\n }\n }\n return self;\n\n function is_destructuring_export_decl(compressor) {\n var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/];\n for (var a = 0, p = 0, len = ancestors.length; a < len; p++) {\n var parent = compressor.parent(p);\n if (!parent) return false;\n if (a === 0 && parent.TYPE == \"Destructuring\") continue;\n if (!ancestors[a].test(parent.TYPE)) {\n return false;\n }\n a++;\n }\n return true;\n }\n\n function should_retain(compressor, def) {\n if (def.references.length) return true;\n if (!def.global) return false;\n if (compressor.toplevel.vars) {\n if (compressor.top_retain) {\n return compressor.top_retain(def);\n }\n return false;\n }\n return true;\n }\n });\n})();\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction find_builtins(reserved) {\n reserved.push.apply(reserved, domprops);\n\n // Compatibility fix for some standard defined globals not defined on every js environment\n var new_globals = [\"Symbol\", \"Map\", \"Promise\", \"Proxy\", \"Reflect\", \"Set\", \"WeakMap\", \"WeakSet\"];\n var objects = {};\n var global_ref = typeof global === \"object\" ? global : self;\n\n new_globals.forEach(function (new_global) {\n objects[new_global] = global_ref[new_global] || new Function();\n });\n\n // NaN will be included due to Number.NaN\n [\n \"null\",\n \"true\",\n \"false\",\n \"Infinity\",\n \"-Infinity\",\n \"undefined\",\n ].forEach(add);\n [ Object, Array, Function, Number,\n String, Boolean, Error, Math,\n Date, RegExp, objects.Symbol, ArrayBuffer,\n DataView, decodeURI, decodeURIComponent,\n encodeURI, encodeURIComponent, eval, EvalError,\n Float32Array, Float64Array, Int8Array, Int16Array,\n Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat,\n parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError,\n objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array,\n Uint8ClampedArray, Uint16Array, Uint32Array, URIError,\n objects.WeakMap, objects.WeakSet\n ].forEach(function(ctor) {\n Object.getOwnPropertyNames(ctor).map(add);\n if (ctor.prototype) {\n Object.getOwnPropertyNames(ctor.prototype).map(add);\n }\n });\n function add(name) {\n push_uniq(reserved, name);\n }\n}\n\nfunction reserve_quoted_keys(ast, reserved) {\n function add(name) {\n push_uniq(reserved, name);\n }\n\n ast.walk(new TreeWalker(function(node) {\n if (node instanceof AST_ObjectKeyVal && node.quote) {\n add(node.key);\n } else if (node instanceof AST_ObjectProperty && node.quote) {\n add(node.key.name);\n } else if (node instanceof AST_Sub) {\n addStrings(node.property, add);\n }\n }));\n}\n\nfunction addStrings(node, add) {\n node.walk(new TreeWalker(function(node) {\n if (node instanceof AST_Sequence) {\n addStrings(node.tail_node(), add);\n } else if (node instanceof AST_String) {\n add(node.value);\n } else if (node instanceof AST_Conditional) {\n addStrings(node.consequent, add);\n addStrings(node.alternative, add);\n }\n return true;\n }));\n}\n\nfunction mangle_properties(ast, options) {\n options = defaults(options, {\n builtins: false,\n cache: null,\n debug: false,\n keep_quoted: false,\n only_cache: false,\n regex: null,\n reserved: null,\n }, true);\n\n var reserved = options.reserved;\n if (!Array.isArray(reserved)) reserved = [reserved];\n if (!options.builtins) find_builtins(reserved);\n\n var cname = -1;\n var cache;\n if (options.cache) {\n cache = options.cache.props;\n cache.each(function(mangled_name) {\n push_uniq(reserved, mangled_name);\n });\n } else {\n cache = new Dictionary();\n }\n\n var regex = options.regex;\n\n // note debug is either false (disabled), or a string of the debug suffix to use (enabled).\n // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true'\n // the same as passing an empty string.\n var debug = options.debug !== false;\n var debug_name_suffix;\n if (debug) {\n debug_name_suffix = (options.debug === true ? \"\" : options.debug);\n }\n\n var names_to_mangle = [];\n var unmangleable = [];\n\n // step 1: find candidates to mangle\n ast.walk(new TreeWalker(function(node) {\n if (node instanceof AST_ObjectKeyVal) {\n if (typeof node.key == \"string\") {\n add(node.key);\n }\n } else if (node instanceof AST_ObjectProperty) {\n // setter or getter, since KeyVal is handled above\n add(node.key.name);\n } else if (node instanceof AST_Dot) {\n var root = node;\n while (root.expression) {\n root = root.expression;\n }\n if (!(root.thedef && root.thedef.undeclared)) add(node.property);\n } else if (node instanceof AST_Sub) {\n addStrings(node.property, add);\n } else if (node instanceof AST_Call\n && node.expression.print_to_string() == \"Object.defineProperty\") {\n addStrings(node.args[1], add);\n }\n }));\n\n // step 2: transform the tree, renaming properties\n return ast.transform(new TreeTransformer(function(node) {\n if (node instanceof AST_ObjectKeyVal) {\n if (typeof node.key == \"string\") {\n node.key = mangle(node.key);\n }\n } else if (node instanceof AST_ObjectProperty) {\n // setter or getter\n node.key.name = mangle(node.key.name);\n } else if (node instanceof AST_Dot) {\n node.property = mangle(node.property);\n } else if (!options.keep_quoted && node instanceof AST_Sub) {\n node.property = mangleStrings(node.property);\n } else if (node instanceof AST_Call\n && node.expression.print_to_string() == \"Object.defineProperty\") {\n node.args[1] = mangleStrings(node.args[1]);\n }\n }));\n\n // only function declarations after this line\n\n function can_mangle(name) {\n if (unmangleable.indexOf(name) >= 0) return false;\n if (reserved.indexOf(name) >= 0) return false;\n if (options.only_cache) {\n return cache.has(name);\n }\n if (/^-?[0-9]+(\\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false;\n return true;\n }\n\n function should_mangle(name) {\n if (regex && !regex.test(name)) return false;\n if (reserved.indexOf(name) >= 0) return false;\n return cache.has(name)\n || names_to_mangle.indexOf(name) >= 0;\n }\n\n function add(name) {\n if (can_mangle(name))\n push_uniq(names_to_mangle, name);\n\n if (!should_mangle(name)) {\n push_uniq(unmangleable, name);\n }\n }\n\n function mangle(name) {\n if (!should_mangle(name)) {\n return name;\n }\n\n var mangled = cache.get(name);\n if (!mangled) {\n if (debug) {\n // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo -> o._$foo$NNN_.\n var debug_mangled = \"_$\" + name + \"$\" + debug_name_suffix + \"_\";\n\n if (can_mangle(debug_mangled)) {\n mangled = debug_mangled;\n }\n }\n\n // either debug mode is off, or it is on and we could not use the mangled name\n if (!mangled) {\n do {\n mangled = base54(++cname);\n } while (!can_mangle(mangled));\n }\n\n cache.set(name, mangled);\n }\n return mangled;\n }\n\n function mangleStrings(node) {\n return node.transform(new TreeTransformer(function(node) {\n if (node instanceof AST_Sequence) {\n var last = node.expressions.length - 1;\n node.expressions[last] = mangleStrings(node.expressions[last]);\n } else if (node instanceof AST_String) {\n node.value = mangle(node.value);\n } else if (node instanceof AST_Conditional) {\n node.consequent = mangleStrings(node.consequent);\n node.alternative = mangleStrings(node.alternative);\n }\n return node;\n }));\n }\n}\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n(function() {\n\n var normalize_directives = function(body) {\n var in_directive = true;\n\n for (var i = 0; i < body.length; i++) {\n if (in_directive && body[i] instanceof AST_Statement && body[i].body instanceof AST_String) {\n body[i] = new AST_Directive({\n start: body[i].start,\n end: body[i].end,\n value: body[i].body.value\n });\n } else if (in_directive && !(body[i] instanceof AST_Statement && body[i].body instanceof AST_String)) {\n in_directive = false;\n }\n }\n\n return body;\n };\n\n var MOZ_TO_ME = {\n Program: function(M) {\n return new AST_Toplevel({\n start: my_start_token(M),\n end: my_end_token(M),\n body: normalize_directives(M.body.map(from_moz))\n });\n },\n ArrayPattern: function(M) {\n return new AST_Destructuring({\n start: my_start_token(M),\n end: my_end_token(M),\n names: M.elements.map(function(elm) {\n if (elm === null) {\n return new AST_Hole();\n }\n return from_moz(elm);\n }),\n is_array: true\n });\n },\n ObjectPattern: function(M) {\n return new AST_Destructuring({\n start: my_start_token(M),\n end: my_end_token(M),\n names: M.properties.map(from_moz),\n is_array: false\n });\n },\n AssignmentPattern: function(M) {\n return new AST_Binary({\n start: my_start_token(M),\n end: my_end_token(M),\n left: from_moz(M.left),\n operator: \"=\",\n right: from_moz(M.right)\n });\n },\n SpreadElement: function(M) {\n return new AST_Expansion({\n start: my_start_token(M),\n end: my_end_token(M),\n expression: from_moz(M.argument)\n });\n },\n RestElement: function(M) {\n return new AST_Expansion({\n start: my_start_token(M),\n end: my_end_token(M),\n expression: from_moz(M.argument)\n });\n },\n TemplateElement: function(M) {\n return new AST_TemplateSegment({\n start: my_start_token(M),\n end: my_end_token(M),\n value: M.value.cooked,\n raw: M.value.raw\n });\n },\n TemplateLiteral: function(M) {\n var segments = [];\n for (var i = 0; i < M.quasis.length; i++) {\n segments.push(from_moz(M.quasis[i]));\n if (M.expressions[i]) {\n segments.push(from_moz(M.expressions[i]));\n }\n }\n return new AST_TemplateString({\n start: my_start_token(M),\n end: my_end_token(M),\n segments: segments\n });\n },\n TaggedTemplateExpression: function(M) {\n return new AST_PrefixedTemplateString({\n start: my_start_token(M),\n end: my_end_token(M),\n template_string: from_moz(M.quasi),\n prefix: from_moz(M.tag)\n });\n },\n FunctionDeclaration: function(M) {\n return new AST_Defun({\n start: my_start_token(M),\n end: my_end_token(M),\n name: from_moz(M.id),\n argnames: M.params.map(from_moz),\n is_generator: M.generator,\n async: M.async,\n body: normalize_directives(from_moz(M.body).body)\n });\n },\n FunctionExpression: function(M) {\n return new AST_Function({\n start: my_start_token(M),\n end: my_end_token(M),\n name: from_moz(M.id),\n argnames: M.params.map(from_moz),\n is_generator: M.generator,\n async: M.async,\n body: normalize_directives(from_moz(M.body).body)\n });\n },\n ArrowFunctionExpression: function(M) {\n return new AST_Arrow({\n start: my_start_token(M),\n end: my_end_token(M),\n argnames: M.params.map(from_moz),\n body: from_moz(M.body),\n async: M.async,\n });\n },\n ExpressionStatement: function(M) {\n return new AST_SimpleStatement({\n start: my_start_token(M),\n end: my_end_token(M),\n body: from_moz(M.expression)\n });\n },\n TryStatement: function(M) {\n var handlers = M.handlers || [M.handler];\n if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) {\n throw new Error(\"Multiple catch clauses are not supported.\");\n }\n return new AST_Try({\n start : my_start_token(M),\n end : my_end_token(M),\n body : from_moz(M.block).body,\n bcatch : from_moz(handlers[0]),\n bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null\n });\n },\n Property: function(M) {\n var key = M.key;\n var args = {\n start : my_start_token(key || M.value),\n end : my_end_token(M.value),\n key : key.type == \"Identifier\" ? key.name : key.value,\n value : from_moz(M.value)\n };\n if (M.computed) {\n args.key = from_moz(M.key);\n }\n if (M.method) {\n args.is_generator = M.value.generator;\n args.async = M.value.async;\n if (!M.computed) {\n args.key = new AST_SymbolMethod({ name: args.key });\n } else {\n args.key = from_moz(M.key);\n }\n return new AST_ConciseMethod(args);\n }\n if (M.kind == \"init\") {\n if (key.type != \"Identifier\" && key.type != \"Literal\") {\n args.key = from_moz(key);\n }\n return new AST_ObjectKeyVal(args);\n }\n if (typeof args.key === \"string\" || typeof args.key === \"number\") {\n args.key = new AST_SymbolMethod({\n name: args.key\n });\n }\n args.value = new AST_Accessor(args.value);\n if (M.kind == \"get\") return new AST_ObjectGetter(args);\n if (M.kind == \"set\") return new AST_ObjectSetter(args);\n if (M.kind == \"method\") {\n args.async = M.value.async;\n args.is_generator = M.value.generator;\n args.quote = M.computed ? \"\\\"\" : null;\n return new AST_ConciseMethod(args);\n }\n },\n MethodDefinition: function(M) {\n var args = {\n start : my_start_token(M),\n end : my_end_token(M),\n key : M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }),\n value : from_moz(M.value),\n static : M.static,\n };\n if (M.kind == \"get\") {\n return new AST_ObjectGetter(args);\n }\n if (M.kind == \"set\") {\n return new AST_ObjectSetter(args);\n }\n args.is_generator = M.value.generator;\n args.async = M.value.async;\n return new AST_ConciseMethod(args);\n },\n ArrayExpression: function(M) {\n return new AST_Array({\n start : my_start_token(M),\n end : my_end_token(M),\n elements : M.elements.map(function(elem) {\n return elem === null ? new AST_Hole() : from_moz(elem);\n })\n });\n },\n ObjectExpression: function(M) {\n return new AST_Object({\n start : my_start_token(M),\n end : my_end_token(M),\n properties : M.properties.map(function(prop) {\n if (prop.type === \"SpreadElement\") {\n return from_moz(prop);\n }\n prop.type = \"Property\";\n return from_moz(prop);\n })\n });\n },\n SequenceExpression: function(M) {\n return new AST_Sequence({\n start : my_start_token(M),\n end : my_end_token(M),\n expressions: M.expressions.map(from_moz)\n });\n },\n MemberExpression: function(M) {\n return new (M.computed ? AST_Sub : AST_Dot)({\n start : my_start_token(M),\n end : my_end_token(M),\n property : M.computed ? from_moz(M.property) : M.property.name,\n expression : from_moz(M.object)\n });\n },\n SwitchCase: function(M) {\n return new (M.test ? AST_Case : AST_Default)({\n start : my_start_token(M),\n end : my_end_token(M),\n expression : from_moz(M.test),\n body : M.consequent.map(from_moz)\n });\n },\n VariableDeclaration: function(M) {\n return new (M.kind === \"const\" ? AST_Const :\n M.kind === \"let\" ? AST_Let : AST_Var)({\n start : my_start_token(M),\n end : my_end_token(M),\n definitions : M.declarations.map(from_moz)\n });\n },\n \n ImportDeclaration: function(M) {\n var imported_name = null;\n var imported_names = null;\n M.specifiers.forEach(function (specifier) {\n if (specifier.type === \"ImportSpecifier\") {\n if (!imported_names) { imported_names = []; }\n imported_names.push(new AST_NameMapping({\n start: my_start_token(specifier),\n end: my_end_token(specifier),\n foreign_name: from_moz(specifier.imported),\n name: from_moz(specifier.local)\n }));\n } else if (specifier.type === \"ImportDefaultSpecifier\") {\n imported_name = from_moz(specifier.local);\n } else if (specifier.type === \"ImportNamespaceSpecifier\") {\n if (!imported_names) { imported_names = []; }\n imported_names.push(new AST_NameMapping({\n start: my_start_token(specifier),\n end: my_end_token(specifier),\n foreign_name: new AST_SymbolImportForeign({ name: \"*\" }),\n name: from_moz(specifier.local)\n }));\n }\n });\n return new AST_Import({\n start : my_start_token(M),\n end : my_end_token(M),\n imported_name: imported_name,\n imported_names : imported_names,\n module_name : from_moz(M.source)\n });\n },\n ExportAllDeclaration: function(M) {\n return new AST_Export({\n start: my_start_token(M),\n end: my_end_token(M),\n exported_names: [\n new AST_NameMapping({\n name: new AST_SymbolExportForeign({ name: \"*\" }),\n foreign_name: new AST_SymbolExportForeign({ name: \"*\" })\n })\n ],\n module_name: from_moz(M.source)\n });\n },\n ExportNamedDeclaration: function(M) {\n return new AST_Export({\n start: my_start_token(M),\n end: my_end_token(M),\n exported_definition: from_moz(M.declaration),\n exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(function (specifier) {\n return new AST_NameMapping({\n foreign_name: from_moz(specifier.exported),\n name: from_moz(specifier.local)\n });\n }) : null,\n module_name: from_moz(M.source)\n });\n },\n ExportDefaultDeclaration: function(M) {\n return new AST_Export({\n start: my_start_token(M),\n end: my_end_token(M),\n exported_value: from_moz(M.declaration),\n is_default: true\n });\n },\n Literal: function(M) {\n var val = M.value, args = {\n start : my_start_token(M),\n end : my_end_token(M)\n };\n if (val === null) return new AST_Null(args);\n var rx = M.regex;\n if (rx && rx.pattern) {\n // RegExpLiteral as per ESTree AST spec\n args.value = new RegExp(rx.pattern, rx.flags);\n var raw = args.value.toString();\n args.value.raw_source = rx.flags\n ? raw.substring(0, raw.length - rx.flags.length) + rx.flags\n : raw;\n return new AST_RegExp(args);\n } else if (rx) {\n // support legacy RegExp\n args.value = M.regex && M.raw ? M.raw : val;\n return new AST_RegExp(args);\n }\n switch (typeof val) {\n case \"string\":\n args.value = val;\n return new AST_String(args);\n case \"number\":\n args.value = val;\n return new AST_Number(args);\n case \"boolean\":\n return new (val ? AST_True : AST_False)(args);\n }\n },\n MetaProperty: function(M) {\n if (M.meta.name === \"new\" && M.property.name === \"target\") {\n return new AST_NewTarget({\n start: my_start_token(M),\n end: my_end_token(M)\n });\n }\n },\n Identifier: function(M) {\n var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2];\n return new ( p.type == \"LabeledStatement\" ? AST_Label\n : p.type == \"VariableDeclarator\" && p.id === M ? (p.kind == \"const\" ? AST_SymbolConst : p.kind == \"let\" ? AST_SymbolLet : AST_SymbolVar)\n : /Import.*Specifier/.test(p.type) ? (p.local === M ? AST_SymbolImport : AST_SymbolImportForeign)\n : p.type == \"ExportSpecifier\" ? (p.local === M ? AST_SymbolExport : AST_SymbolExportForeign)\n : p.type == \"FunctionExpression\" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg)\n : p.type == \"FunctionDeclaration\" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg)\n : p.type == \"ArrowFunctionExpression\" ? (p.params.indexOf(M) !== -1) ? AST_SymbolFunarg : AST_SymbolRef\n : p.type == \"ClassExpression\" ? (p.id === M ? AST_SymbolClass : AST_SymbolRef)\n : p.type == \"Property\" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolMethod)\n : p.type == \"ClassDeclaration\" ? (p.id === M ? AST_SymbolDefClass : AST_SymbolRef)\n : p.type == \"MethodDefinition\" ? (p.computed ? AST_SymbolRef : AST_SymbolMethod)\n : p.type == \"CatchClause\" ? AST_SymbolCatch\n : p.type == \"BreakStatement\" || p.type == \"ContinueStatement\" ? AST_LabelRef\n : AST_SymbolRef)({\n start : my_start_token(M),\n end : my_end_token(M),\n name : M.name\n });\n }\n };\n\n MOZ_TO_ME.UpdateExpression =\n MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) {\n var prefix = \"prefix\" in M ? M.prefix\n : M.type == \"UnaryExpression\" ? true : false;\n return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({\n start : my_start_token(M),\n end : my_end_token(M),\n operator : M.operator,\n expression : from_moz(M.argument)\n });\n };\n\n MOZ_TO_ME.ClassDeclaration =\n MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) {\n return new (M.type === \"ClassDeclaration\" ? AST_DefClass : AST_ClassExpression)({\n start : my_start_token(M),\n end : my_end_token(M),\n name : from_moz(M.id),\n extends : from_moz(M.superClass),\n properties: M.body.body.map(from_moz)\n });\n };\n\n map(\"EmptyStatement\", AST_EmptyStatement);\n map(\"BlockStatement\", AST_BlockStatement, \"body@body\");\n map(\"IfStatement\", AST_If, \"test>condition, consequent>body, alternate>alternative\");\n map(\"LabeledStatement\", AST_LabeledStatement, \"label>label, body>body\");\n map(\"BreakStatement\", AST_Break, \"label>label\");\n map(\"ContinueStatement\", AST_Continue, \"label>label\");\n map(\"WithStatement\", AST_With, \"object>expression, body>body\");\n map(\"SwitchStatement\", AST_Switch, \"discriminant>expression, cases@body\");\n map(\"ReturnStatement\", AST_Return, \"argument>value\");\n map(\"ThrowStatement\", AST_Throw, \"argument>value\");\n map(\"WhileStatement\", AST_While, \"test>condition, body>body\");\n map(\"DoWhileStatement\", AST_Do, \"test>condition, body>body\");\n map(\"ForStatement\", AST_For, \"init>init, test>condition, update>step, body>body\");\n map(\"ForInStatement\", AST_ForIn, \"left>init, right>object, body>body\");\n map(\"ForOfStatement\", AST_ForOf, \"left>init, right>object, body>body, await=await\");\n map(\"AwaitExpression\", AST_Await, \"argument>expression\");\n map(\"YieldExpression\", AST_Yield, \"argument>expression, delegate=is_star\");\n map(\"DebuggerStatement\", AST_Debugger);\n map(\"VariableDeclarator\", AST_VarDef, \"id>name, init>value\");\n map(\"CatchClause\", AST_Catch, \"param>argname, body%body\");\n\n map(\"ThisExpression\", AST_This);\n map(\"Super\", AST_Super);\n map(\"BinaryExpression\", AST_Binary, \"operator=operator, left>left, right>right\");\n map(\"LogicalExpression\", AST_Binary, \"operator=operator, left>left, right>right\");\n map(\"AssignmentExpression\", AST_Assign, \"operator=operator, left>left, right>right\");\n map(\"ConditionalExpression\", AST_Conditional, \"test>condition, consequent>consequent, alternate>alternative\");\n map(\"NewExpression\", AST_New, \"callee>expression, arguments@args\");\n map(\"CallExpression\", AST_Call, \"callee>expression, arguments@args\");\n\n def_to_moz(AST_Toplevel, function To_Moz_Program(M) {\n return to_moz_scope(\"Program\", M);\n });\n\n def_to_moz(AST_Expansion, function To_Moz_Spread(M, parent) {\n return {\n type: to_moz_in_destructuring() ? \"RestElement\" : \"SpreadElement\",\n argument: to_moz(M.expression)\n };\n });\n\n def_to_moz(AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) {\n return {\n type: \"TaggedTemplateExpression\",\n tag: to_moz(M.prefix),\n quasi: to_moz(M.template_string)\n };\n });\n\n def_to_moz(AST_TemplateString, function To_Moz_TemplateLiteral(M) {\n var quasis = [];\n var expressions = [];\n for (var i = 0; i < M.segments.length; i++) {\n if (i % 2 !== 0) {\n expressions.push(to_moz(M.segments[i]));\n } else {\n quasis.push({\n type: \"TemplateElement\",\n value: {\n raw: M.segments[i].raw,\n cooked: M.segments[i].value\n },\n tail: i === M.segments.length - 1\n });\n }\n }\n return {\n type: \"TemplateLiteral\",\n quasis: quasis,\n expressions: expressions\n };\n });\n\n def_to_moz(AST_Defun, function To_Moz_FunctionDeclaration(M) {\n return {\n type: \"FunctionDeclaration\",\n id: to_moz(M.name),\n params: M.argnames.map(to_moz),\n generator: M.is_generator,\n async: M.async,\n body: to_moz_scope(\"BlockStatement\", M)\n };\n });\n\n def_to_moz(AST_Function, function To_Moz_FunctionExpression(M, parent) {\n var is_generator = parent.is_generator !== undefined ?\n parent.is_generator : M.is_generator;\n return {\n type: \"FunctionExpression\",\n id: to_moz(M.name),\n params: M.argnames.map(to_moz),\n generator: is_generator,\n async: M.async,\n body: to_moz_scope(\"BlockStatement\", M)\n };\n });\n\n def_to_moz(AST_Arrow, function To_Moz_ArrowFunctionExpression(M) {\n var body = M.body instanceof Array ? {\n type: \"BlockStatement\",\n body: M.body.map(to_moz)\n } : to_moz(M.body);\n return {\n type: \"ArrowFunctionExpression\",\n params: M.argnames.map(to_moz),\n async: M.async,\n body: body\n };\n });\n\n def_to_moz(AST_Destructuring, function To_Moz_ObjectPattern(M) {\n if (M.is_array) {\n return {\n type: \"ArrayPattern\",\n elements: M.names.map(to_moz)\n };\n }\n return {\n type: \"ObjectPattern\",\n properties: M.names.map(to_moz)\n };\n });\n\n def_to_moz(AST_Directive, function To_Moz_Directive(M) {\n return {\n type: \"ExpressionStatement\",\n expression: {\n type: \"Literal\",\n value: M.value\n }\n };\n });\n\n def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) {\n return {\n type: \"ExpressionStatement\",\n expression: to_moz(M.body)\n };\n });\n\n def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) {\n return {\n type: \"SwitchCase\",\n test: to_moz(M.expression),\n consequent: M.body.map(to_moz)\n };\n });\n\n def_to_moz(AST_Try, function To_Moz_TryStatement(M) {\n return {\n type: \"TryStatement\",\n block: to_moz_block(M),\n handler: to_moz(M.bcatch),\n guardedHandlers: [],\n finalizer: to_moz(M.bfinally)\n };\n });\n\n def_to_moz(AST_Catch, function To_Moz_CatchClause(M) {\n return {\n type: \"CatchClause\",\n param: to_moz(M.argname),\n guard: null,\n body: to_moz_block(M)\n };\n });\n\n def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) {\n return {\n type: \"VariableDeclaration\",\n kind:\n M instanceof AST_Const ? \"const\" :\n M instanceof AST_Let ? \"let\" : \"var\",\n declarations: M.definitions.map(to_moz)\n };\n });\n\n def_to_moz(AST_Export, function To_Moz_ExportDeclaration(M) {\n if (M.exported_names) {\n if (M.exported_names[0].name.name === \"*\") {\n return {\n type: \"ExportAllDeclaration\",\n source: to_moz(M.module_name)\n };\n }\n return {\n type: \"ExportNamedDeclaration\",\n specifiers: M.exported_names.map(function (name_mapping) {\n return {\n type: \"ExportSpecifier\",\n exported: to_moz(name_mapping.foreign_name),\n local: to_moz(name_mapping.name)\n };\n }),\n declaration: to_moz(M.exported_definition),\n source: to_moz(M.module_name)\n };\n }\n return {\n type: M.is_default ? \"ExportDefaultDeclaration\" : \"ExportNamedDeclaration\",\n declaration: to_moz(M.exported_value || M.exported_definition)\n };\n });\n\n def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) {\n var specifiers = [];\n if (M.imported_name) {\n specifiers.push({\n type: \"ImportDefaultSpecifier\",\n local: to_moz(M.imported_name)\n });\n }\n if (M.imported_names && M.imported_names[0].foreign_name.name === \"*\") {\n specifiers.push({\n type: \"ImportNamespaceSpecifier\",\n local: to_moz(M.imported_names[0].name)\n });\n } else if (M.imported_names) {\n M.imported_names.forEach(function(name_mapping) {\n specifiers.push({\n type: \"ImportSpecifier\",\n local: to_moz(name_mapping.name),\n imported: to_moz(name_mapping.foreign_name)\n });\n });\n }\n return {\n type: \"ImportDeclaration\",\n specifiers: specifiers,\n source: to_moz(M.module_name)\n };\n });\n\n def_to_moz(AST_Sequence, function To_Moz_SequenceExpression(M) {\n return {\n type: \"SequenceExpression\",\n expressions: M.expressions.map(to_moz)\n };\n });\n\n def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) {\n var isComputed = M instanceof AST_Sub;\n return {\n type: \"MemberExpression\",\n object: to_moz(M.expression),\n computed: isComputed,\n property: isComputed ? to_moz(M.property) : {type: \"Identifier\", name: M.property}\n };\n });\n\n def_to_moz(AST_Unary, function To_Moz_Unary(M) {\n return {\n type: M.operator == \"++\" || M.operator == \"--\" ? \"UpdateExpression\" : \"UnaryExpression\",\n operator: M.operator,\n prefix: M instanceof AST_UnaryPrefix,\n argument: to_moz(M.expression)\n };\n });\n\n def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) {\n if (M.operator == \"=\" && to_moz_in_destructuring()) {\n return {\n type: \"AssignmentPattern\",\n left: to_moz(M.left),\n right: to_moz(M.right)\n };\n }\n return {\n type: M.operator == \"&&\" || M.operator == \"||\" ? \"LogicalExpression\" : \"BinaryExpression\",\n left: to_moz(M.left),\n operator: M.operator,\n right: to_moz(M.right)\n };\n });\n\n def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) {\n return {\n type: \"ArrayExpression\",\n elements: M.elements.map(to_moz)\n };\n });\n\n def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) {\n return {\n type: \"ObjectExpression\",\n properties: M.properties.map(to_moz)\n };\n });\n\n def_to_moz(AST_ObjectProperty, function To_Moz_Property(M, parent) {\n var key = M.key instanceof AST_Node ? to_moz(M.key) : {\n type: \"Identifier\",\n value: M.key\n };\n if (typeof M.key === \"number\") {\n key = {\n type: \"Literal\",\n value: Number(M.key)\n };\n }\n if (typeof M.key === \"string\") {\n key = {\n type: \"Identifier\",\n name: M.key\n };\n }\n var kind;\n var string_or_num = typeof M.key === \"string\" || typeof M.key === \"number\";\n var computed = string_or_num ? false : !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef;\n if (M instanceof AST_ObjectKeyVal) {\n kind = \"init\";\n computed = !string_or_num;\n } else\n if (M instanceof AST_ObjectGetter) {\n kind = \"get\";\n } else\n if (M instanceof AST_ObjectSetter) {\n kind = \"set\";\n }\n if (parent instanceof AST_Class) {\n return {\n type: \"MethodDefinition\",\n computed: computed,\n kind: kind,\n static: M.static,\n key: to_moz(M.key),\n value: to_moz(M.value)\n };\n }\n return {\n type: \"Property\",\n computed: computed,\n kind: kind,\n key: key,\n value: to_moz(M.value)\n };\n });\n\n def_to_moz(AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) {\n if (parent instanceof AST_Object) {\n return {\n type: \"Property\",\n computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef,\n kind: \"init\",\n method: true,\n shorthand: false,\n key: to_moz(M.key),\n value: to_moz(M.value)\n };\n }\n return {\n type: \"MethodDefinition\",\n computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef,\n kind: M.key === \"constructor\" ? \"constructor\" : \"method\",\n static: M.static,\n key: to_moz(M.key),\n value: to_moz(M.value)\n };\n });\n\n def_to_moz(AST_Class, function To_Moz_Class(M) {\n var type = M instanceof AST_ClassExpression ? \"ClassExpression\" : \"ClassDeclaration\";\n return {\n type: type,\n superClass: to_moz(M.extends),\n id: M.name ? to_moz(M.name) : null,\n body: {\n type: \"ClassBody\",\n body: M.properties.map(to_moz)\n }\n };\n });\n\n def_to_moz(AST_NewTarget, function To_Moz_MetaProperty(M) {\n return {\n type: \"MetaProperty\",\n meta: {\n type: \"Identifier\",\n name: \"new\"\n },\n property: {\n type: \"Identifier\",\n name: \"target\"\n }\n };\n });\n\n def_to_moz(AST_Symbol, function To_Moz_Identifier(M, parent) {\n if (M instanceof AST_SymbolMethod && parent.quote) {\n return {\n type: \"Literal\",\n value: M.name\n };\n }\n var def = M.definition();\n return {\n type: \"Identifier\",\n name: def ? def.mangled_name || def.name : M.name\n };\n });\n\n def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) {\n var pattern = M.value.source;\n var flags = M.value.toString().match(/[gimuys]*$/)[0];\n return {\n type: \"Literal\",\n value: new RegExp(pattern, flags),\n raw: M.value.raw_source,\n regex: {\n pattern: pattern,\n flags: flags,\n }\n };\n });\n\n def_to_moz(AST_Constant, function To_Moz_Literal(M) {\n var value = M.value;\n if (typeof value === \"number\" && (value < 0 || (value === 0 && 1 / value < 0))) {\n return {\n type: \"UnaryExpression\",\n operator: \"-\",\n prefix: true,\n argument: {\n type: \"Literal\",\n value: -value,\n raw: M.start.raw\n }\n };\n }\n return {\n type: \"Literal\",\n value: value,\n raw: M.start.raw\n };\n });\n\n def_to_moz(AST_Atom, function To_Moz_Atom(M) {\n return {\n type: \"Identifier\",\n name: String(M.value)\n };\n });\n\n AST_Boolean.DEFMETHOD(\"to_mozilla_ast\", AST_Constant.prototype.to_mozilla_ast);\n AST_Null.DEFMETHOD(\"to_mozilla_ast\", AST_Constant.prototype.to_mozilla_ast);\n AST_Hole.DEFMETHOD(\"to_mozilla_ast\", function To_Moz_ArrayHole() { return null; });\n\n AST_Block.DEFMETHOD(\"to_mozilla_ast\", AST_BlockStatement.prototype.to_mozilla_ast);\n AST_Lambda.DEFMETHOD(\"to_mozilla_ast\", AST_Function.prototype.to_mozilla_ast);\n\n /* -----[ tools ]----- */\n\n function raw_token(moznode) {\n if (moznode.type == \"Literal\") {\n return moznode.raw != null ? moznode.raw : moznode.value + \"\";\n }\n }\n\n function my_start_token(moznode) {\n var loc = moznode.loc, start = loc && loc.start;\n var range = moznode.range;\n return new AST_Token({\n file : loc && loc.source,\n line : start && start.line,\n col : start && start.column,\n pos : range ? range[0] : moznode.start,\n endline : start && start.line,\n endcol : start && start.column,\n endpos : range ? range[0] : moznode.start,\n raw : raw_token(moznode),\n });\n }\n\n function my_end_token(moznode) {\n var loc = moznode.loc, end = loc && loc.end;\n var range = moznode.range;\n return new AST_Token({\n file : loc && loc.source,\n line : end && end.line,\n col : end && end.column,\n pos : range ? range[1] : moznode.end,\n endline : end && end.line,\n endcol : end && end.column,\n endpos : range ? range[1] : moznode.end,\n raw : raw_token(moznode),\n });\n }\n\n function map(moztype, mytype, propmap) {\n var moz_to_me = \"function From_Moz_\" + moztype + \"(M){\\n\";\n moz_to_me += \"return new U2.\" + mytype.name + \"({\\n\" +\n \"start: my_start_token(M),\\n\" +\n \"end: my_end_token(M)\";\n\n var me_to_moz = \"function To_Moz_\" + moztype + \"(M){\\n\";\n me_to_moz += \"return {\\n\" +\n \"type: \" + JSON.stringify(moztype);\n\n if (propmap) propmap.split(/\\s*,\\s*/).forEach(function(prop) {\n var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop);\n if (!m) throw new Error(\"Can't understand property map: \" + prop);\n var moz = m[1], how = m[2], my = m[3];\n moz_to_me += \",\\n\" + my + \": \";\n me_to_moz += \",\\n\" + moz + \": \";\n switch (how) {\n case \"@\":\n moz_to_me += \"M.\" + moz + \".map(from_moz)\";\n me_to_moz += \"M.\" + my + \".map(to_moz)\";\n break;\n case \">\":\n moz_to_me += \"from_moz(M.\" + moz + \")\";\n me_to_moz += \"to_moz(M.\" + my + \")\";\n break;\n case \"=\":\n moz_to_me += \"M.\" + moz;\n me_to_moz += \"M.\" + my;\n break;\n case \"%\":\n moz_to_me += \"from_moz(M.\" + moz + \").body\";\n me_to_moz += \"to_moz_block(M)\";\n break;\n default:\n throw new Error(\"Can't understand operator in propmap: \" + prop);\n }\n });\n\n moz_to_me += \"\\n})\\n}\";\n me_to_moz += \"\\n}\\n}\";\n\n //moz_to_me = parse(moz_to_me).print_to_string({ beautify: true });\n //me_to_moz = parse(me_to_moz).print_to_string({ beautify: true });\n //console.log(moz_to_me);\n\n moz_to_me = new Function(\"U2\", \"my_start_token\", \"my_end_token\", \"from_moz\", \"return(\" + moz_to_me + \")\")(\n exports, my_start_token, my_end_token, from_moz\n );\n me_to_moz = new Function(\"to_moz\", \"to_moz_block\", \"to_moz_scope\", \"return(\" + me_to_moz + \")\")(\n to_moz, to_moz_block, to_moz_scope\n );\n MOZ_TO_ME[moztype] = moz_to_me;\n def_to_moz(mytype, me_to_moz);\n }\n\n var FROM_MOZ_STACK = null;\n\n function from_moz(node) {\n FROM_MOZ_STACK.push(node);\n var ret = node != null ? MOZ_TO_ME[node.type](node) : null;\n FROM_MOZ_STACK.pop();\n return ret;\n }\n\n AST_Node.from_mozilla_ast = function(node) {\n var save_stack = FROM_MOZ_STACK;\n FROM_MOZ_STACK = [];\n var ast = from_moz(node);\n FROM_MOZ_STACK = save_stack;\n return ast;\n };\n\n function set_moz_loc(mynode, moznode, myparent) {\n var start = mynode.start;\n var end = mynode.end;\n if (start.pos != null && end.endpos != null) {\n moznode.range = [start.pos, end.endpos];\n }\n if (start.line) {\n moznode.loc = {\n start: {line: start.line, column: start.col},\n end: end.endline ? {line: end.endline, column: end.endcol} : null\n };\n if (start.file) {\n moznode.loc.source = start.file;\n }\n }\n return moznode;\n }\n\n function def_to_moz(mytype, handler) {\n mytype.DEFMETHOD(\"to_mozilla_ast\", function(parent) {\n return set_moz_loc(this, handler(this, parent));\n });\n }\n\n var TO_MOZ_STACK = null;\n\n function to_moz(node) {\n if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; }\n TO_MOZ_STACK.push(node);\n var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null;\n TO_MOZ_STACK.pop();\n if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; }\n return ast;\n }\n\n function to_moz_in_destructuring() {\n var i = TO_MOZ_STACK.length;\n while (i--) {\n if (TO_MOZ_STACK[i] instanceof AST_Destructuring) {\n return true;\n }\n }\n return false;\n }\n\n function to_moz_block(node) {\n return {\n type: \"BlockStatement\",\n body: node.body.map(to_moz)\n };\n }\n\n function to_moz_scope(type, node) {\n var body = node.body.map(to_moz);\n if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) {\n body.unshift(to_moz(new AST_EmptyStatement(node.body[0])));\n }\n return {\n type: type,\n body: body\n };\n }\n})();\n","\"use strict\";\n\nvar to_ascii = typeof atob == \"undefined\" ? function(b64) {\n if (Buffer.from && Buffer.from !== Uint8Array.from) {\n // Node >= 4.5.0\n return Buffer.from(b64, \"base64\").toString();\n } else {\n // Node < 4.5.0, old API, manual safeguards\n if (typeof b64 !== \"string\") throw new Errror(\"\\\"b64\\\" must be a string\");\n return new Buffer(b64, \"base64\").toString();\n }\n} : atob;\nvar to_base64 = typeof btoa == \"undefined\" ? function(str) {\n if (Buffer.from && Buffer.from !== Uint8Array.from) {\n // Node >= 4.5.0\n return Buffer.from(str).toString(\"base64\");\n } else {\n // Node < 4.5.0, old API, manual safeguards\n if (typeof str !== \"string\") throw new Errror(\"\\\"str\\\" must be a string\");\n return new Buffer(str).toString(\"base64\");\n }\n} : btoa;\n\nfunction read_source_map(code) {\n var match = /\\n\\/\\/# sourceMappingURL=data:application\\/json(;.*?)?;base64,(.*)/.exec(code);\n if (!match) {\n AST_Node.warn(\"inline source map not found\");\n return null;\n }\n return to_ascii(match[2]);\n}\n\nfunction set_shorthand(name, options, keys) {\n if (options[name]) {\n keys.forEach(function(key) {\n if (options[key]) {\n if (typeof options[key] != \"object\") options[key] = {};\n if (!(name in options[key])) options[key][name] = options[name];\n }\n });\n }\n}\n\nfunction init_cache(cache) {\n if (!cache) return;\n if (!(\"props\" in cache)) {\n cache.props = new Dictionary();\n } else if (!(cache.props instanceof Dictionary)) {\n cache.props = Dictionary.fromObject(cache.props);\n }\n}\n\nfunction to_json(cache) {\n return {\n props: cache.props.toObject()\n };\n}\n\nfunction minify(files, options) {\n var warn_function = AST_Node.warn_function;\n try {\n options = defaults(options, {\n compress: {},\n ecma: undefined,\n enclose: false,\n ie8: false,\n keep_classnames: undefined,\n keep_fnames: false,\n mangle: {},\n module: false,\n nameCache: null,\n output: {},\n parse: {},\n rename: undefined,\n safari10: false,\n sourceMap: false,\n timings: false,\n toplevel: false,\n warnings: false,\n wrap: false,\n }, true);\n var timings = options.timings && {\n start: Date.now()\n };\n if (options.keep_classnames === undefined) {\n options.keep_classnames = options.keep_fnames;\n }\n if (options.rename === undefined) {\n options.rename = options.compress && options.mangle;\n }\n set_shorthand(\"ecma\", options, [ \"parse\", \"compress\", \"output\" ]);\n set_shorthand(\"ie8\", options, [ \"compress\", \"mangle\", \"output\" ]);\n set_shorthand(\"keep_classnames\", options, [ \"compress\", \"mangle\" ]);\n set_shorthand(\"keep_fnames\", options, [ \"compress\", \"mangle\" ]);\n set_shorthand(\"module\", options, [ \"parse\", \"compress\", \"mangle\" ]);\n set_shorthand(\"safari10\", options, [ \"mangle\", \"output\" ]);\n set_shorthand(\"toplevel\", options, [ \"compress\", \"mangle\" ]);\n set_shorthand(\"warnings\", options, [ \"compress\" ]);\n var quoted_props;\n if (options.mangle) {\n options.mangle = defaults(options.mangle, {\n cache: options.nameCache && (options.nameCache.vars || {}),\n eval: false,\n ie8: false,\n keep_classnames: false,\n keep_fnames: false,\n module: false,\n properties: false,\n reserved: [],\n safari10: false,\n toplevel: false,\n }, true);\n if (options.mangle.properties) {\n if (typeof options.mangle.properties != \"object\") {\n options.mangle.properties = {};\n }\n if (options.mangle.properties.keep_quoted) {\n quoted_props = options.mangle.properties.reserved;\n if (!Array.isArray(quoted_props)) quoted_props = [];\n options.mangle.properties.reserved = quoted_props;\n }\n if (options.nameCache && !(\"cache\" in options.mangle.properties)) {\n options.mangle.properties.cache = options.nameCache.props || {};\n }\n }\n init_cache(options.mangle.cache);\n init_cache(options.mangle.properties.cache);\n }\n if (options.sourceMap) {\n options.sourceMap = defaults(options.sourceMap, {\n content: null,\n filename: null,\n includeSources: false,\n root: null,\n url: null,\n }, true);\n }\n var warnings = [];\n if (options.warnings && !AST_Node.warn_function) {\n AST_Node.warn_function = function(warning) {\n warnings.push(warning);\n };\n }\n if (timings) timings.parse = Date.now();\n var toplevel;\n if (files instanceof AST_Toplevel) {\n toplevel = files;\n } else {\n if (typeof files == \"string\") {\n files = [ files ];\n }\n options.parse = options.parse || {};\n options.parse.toplevel = null;\n for (var name in files) if (HOP(files, name)) {\n options.parse.filename = name;\n options.parse.toplevel = parse(files[name], options.parse);\n if (options.sourceMap && options.sourceMap.content == \"inline\") {\n if (Object.keys(files).length > 1)\n throw new Error(\"inline source map only works with singular input\");\n options.sourceMap.content = read_source_map(files[name]);\n }\n }\n toplevel = options.parse.toplevel;\n }\n if (quoted_props) {\n reserve_quoted_keys(toplevel, quoted_props);\n }\n if (options.wrap) {\n toplevel = toplevel.wrap_commonjs(options.wrap);\n }\n if (options.enclose) {\n toplevel = toplevel.wrap_enclose(options.enclose);\n }\n if (timings) timings.rename = Date.now();\n // disable rename on harmony due to expand_names bug in for-of loops\n // https://github.com/mishoo/UglifyJS2/issues/2794\n if (0 && options.rename) {\n toplevel.figure_out_scope(options.mangle);\n toplevel.expand_names(options.mangle);\n }\n if (timings) timings.compress = Date.now();\n if (options.compress) toplevel = new Compressor(options.compress).compress(toplevel);\n if (timings) timings.scope = Date.now();\n if (options.mangle) toplevel.figure_out_scope(options.mangle);\n if (timings) timings.mangle = Date.now();\n if (options.mangle) {\n base54.reset();\n toplevel.compute_char_frequency(options.mangle);\n toplevel.mangle_names(options.mangle);\n }\n if (timings) timings.properties = Date.now();\n if (options.mangle && options.mangle.properties) {\n toplevel = mangle_properties(toplevel, options.mangle.properties);\n }\n if (timings) timings.output = Date.now();\n var result = {};\n if (options.output.ast) {\n result.ast = toplevel;\n }\n if (!HOP(options.output, \"code\") || options.output.code) {\n if (options.sourceMap) {\n if (typeof options.sourceMap.content == \"string\") {\n options.sourceMap.content = JSON.parse(options.sourceMap.content);\n }\n options.output.source_map = SourceMap({\n file: options.sourceMap.filename,\n orig: options.sourceMap.content,\n root: options.sourceMap.root\n });\n if (options.sourceMap.includeSources) {\n if (files instanceof AST_Toplevel) {\n throw new Error(\"original source content unavailable\");\n } else for (var name in files) if (HOP(files, name)) {\n options.output.source_map.get().setSourceContent(name, files[name]);\n }\n }\n }\n delete options.output.ast;\n delete options.output.code;\n var stream = OutputStream(options.output);\n toplevel.print(stream);\n result.code = stream.get();\n if (options.sourceMap) {\n result.map = options.output.source_map.toString();\n if (options.sourceMap.url == \"inline\") {\n result.code += \"\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,\" + to_base64(result.map);\n } else if (options.sourceMap.url) {\n result.code += \"\\n//# sourceMappingURL=\" + options.sourceMap.url;\n }\n }\n }\n if (options.nameCache && options.mangle) {\n if (options.mangle.cache) options.nameCache.vars = to_json(options.mangle.cache);\n if (options.mangle.properties && options.mangle.properties.cache) {\n options.nameCache.props = to_json(options.mangle.properties.cache);\n }\n }\n if (timings) {\n timings.end = Date.now();\n result.timings = {\n parse: 1e-3 * (timings.rename - timings.parse),\n rename: 1e-3 * (timings.compress - timings.rename),\n compress: 1e-3 * (timings.scope - timings.compress),\n scope: 1e-3 * (timings.mangle - timings.scope),\n mangle: 1e-3 * (timings.properties - timings.mangle),\n properties: 1e-3 * (timings.output - timings.properties),\n output: 1e-3 * (timings.end - timings.output),\n total: 1e-3 * (timings.end - timings.start)\n };\n }\n if (warnings.length) {\n result.warnings = warnings;\n }\n return result;\n } catch (ex) {\n return { error: ex };\n } finally {\n AST_Node.warn_function = warn_function;\n }\n}\n","exports[\"Dictionary\"] = Dictionary;\nexports[\"minify\"] = minify;\nexports[\"parse\"] = parse;\nexports[\"push_uniq\"] = push_uniq;\nexports[\"OutputStream\"] = OutputStream;\nexports[\"TreeTransformer\"] = TreeTransformer;\nexports[\"TreeWalker\"] = TreeWalker;\nexports[\"string_template\"] = string_template;\nexports[\"Compressor\"] = Compressor;\nexports[\"defaults\"] = defaults;\nexports[\"base54\"] = base54;\nexports[\"mangle_properties\"] = mangle_properties;\nexports[\"reserve_quoted_keys\"] = reserve_quoted_keys;\nexports[\"to_ascii\"] = to_ascii;\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n// a small wrapper around fitzgen's source-map library\nfunction SourceMap(options) {\n options = defaults(options, {\n file : null,\n root : null,\n orig : null,\n\n orig_line_diff : 0,\n dest_line_diff : 0,\n });\n var generator = new MOZ_SourceMap.SourceMapGenerator({\n file : options.file,\n sourceRoot : options.root\n });\n var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);\n\n if (orig_map && Array.isArray(options.orig.sources)) {\n orig_map._sources.toArray().forEach(function(source) {\n var sourceContent = orig_map.sourceContentFor(source, true);\n if (sourceContent) {\n generator.setSourceContent(source, sourceContent);\n }\n });\n }\n\n function add(source, gen_line, gen_col, orig_line, orig_col, name) {\n if (orig_map) {\n var info = orig_map.originalPositionFor({\n line: orig_line,\n column: orig_col\n });\n if (info.source === null) {\n return;\n }\n source = info.source;\n orig_line = info.line;\n orig_col = info.column;\n name = info.name || name;\n }\n generator.addMapping({\n generated : { line: gen_line + options.dest_line_diff, column: gen_col },\n original : { line: orig_line + options.orig_line_diff, column: orig_col },\n source : source,\n name : name\n });\n }\n return {\n add : add,\n get : function() { return generator; },\n toString : function() { return JSON.stringify(generator.toJSON()); }\n };\n}\n",null]} \ No newline at end of file diff --git a/tools/node_modules/terser/lib/ast.js b/tools/node_modules/terser/lib/ast.js new file mode 100644 index 000000000000..ae804de50fbe --- /dev/null +++ b/tools/node_modules/terser/lib/ast.js @@ -0,0 +1,1260 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function DEFNODE(type, props, methods, base) { + if (arguments.length < 4) base = AST_Node; + if (!props) props = []; + else props = props.split(/\s+/); + var self_props = props; + if (base && base.PROPS) + props = props.concat(base.PROPS); + var code = "return function AST_" + type + "(props){ if (props) { "; + for (var i = props.length; --i >= 0;) { + code += "this." + props[i] + " = props." + props[i] + ";"; + } + var proto = base && new base; + if (proto && proto.initialize || (methods && methods.initialize)) + code += "this.initialize();"; + code += "}}"; + var ctor = new Function(code)(); + if (proto) { + ctor.prototype = proto; + ctor.BASE = base; + } + if (base) base.SUBCLASSES.push(ctor); + ctor.prototype.CTOR = ctor; + ctor.PROPS = props || null; + ctor.SELF_PROPS = self_props; + ctor.SUBCLASSES = []; + if (type) { + ctor.prototype.TYPE = ctor.TYPE = type; + } + if (methods) for (i in methods) if (HOP(methods, i)) { + if (/^\$/.test(i)) { + ctor[i.substr(1)] = methods[i]; + } else { + ctor.prototype[i] = methods[i]; + } + } + ctor.DEFMETHOD = function(name, method) { + this.prototype[name] = method; + }; + if (typeof exports !== "undefined") { + exports["AST_" + type] = ctor; + } + return ctor; +} + +var AST_Token = DEFNODE("Token", "type value line col pos endline endcol endpos nlb comments_before comments_after file raw", { +}, null); + +var AST_Node = DEFNODE("Node", "start end", { + _clone: function(deep) { + if (deep) { + var self = this.clone(); + return self.transform(new TreeTransformer(function(node) { + if (node !== self) { + return node.clone(true); + } + })); + } + return new this.CTOR(this); + }, + clone: function(deep) { + return this._clone(deep); + }, + $documentation: "Base class of all AST nodes", + $propdoc: { + start: "[AST_Token] The first token of this node", + end: "[AST_Token] The last token of this node" + }, + _walk: function(visitor) { + return visitor._visit(this); + }, + walk: function(visitor) { + return this._walk(visitor); // not sure the indirection will be any help + } +}, null); + +AST_Node.warn_function = null; +AST_Node.warn = function(txt, props) { + if (AST_Node.warn_function) + AST_Node.warn_function(string_template(txt, props)); +}; + +/* -----[ statements ]----- */ + +var AST_Statement = DEFNODE("Statement", null, { + $documentation: "Base class of all statements", +}); + +var AST_Debugger = DEFNODE("Debugger", null, { + $documentation: "Represents a debugger statement", +}, AST_Statement); + +var AST_Directive = DEFNODE("Directive", "value quote", { + $documentation: "Represents a directive, like \"use strict\";", + $propdoc: { + value: "[string] The value of this directive as a plain string (it's not an AST_String!)", + quote: "[string] the original quote character" + }, +}, AST_Statement); + +var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", { + $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", + $propdoc: { + body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.body._walk(visitor); + }); + } +}, AST_Statement); + +function walk_body(node, visitor) { + var body = node.body; + if (body instanceof AST_Node) { + body._walk(visitor); + } else for (var i = 0, len = body.length; i < len; i++) { + body[i]._walk(visitor); + } +} + +function clone_block_scope(deep) { + var clone = this._clone(deep); + if (this.block_scope) { + // TODO this is sometimes undefined during compression. + // But it should always have a value! + clone.block_scope = this.block_scope.clone(); + } + return clone; +} + +var AST_Block = DEFNODE("Block", "body block_scope", { + $documentation: "A body of statements (usually braced)", + $propdoc: { + body: "[AST_Statement*] an array of statements", + block_scope: "[AST_Scope] the block scope" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + walk_body(this, visitor); + }); + }, + clone: clone_block_scope +}, AST_Statement); + +var AST_BlockStatement = DEFNODE("BlockStatement", null, { + $documentation: "A block statement", +}, AST_Block); + +var AST_EmptyStatement = DEFNODE("EmptyStatement", null, { + $documentation: "The empty statement (empty block or simply a semicolon)" +}, AST_Statement); + +var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", { + $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", + $propdoc: { + body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" + } +}, AST_Statement); + +var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", { + $documentation: "Statement with a label", + $propdoc: { + label: "[AST_Label] a label definition" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.label._walk(visitor); + this.body._walk(visitor); + }); + }, + clone: function(deep) { + var node = this._clone(deep); + if (deep) { + var label = node.label; + var def = this.label; + node.walk(new TreeWalker(function(node) { + if (node instanceof AST_LoopControl + && node.label && node.label.thedef === def) { + node.label.thedef = label; + label.references.push(node); + } + })); + } + return node; + } +}, AST_StatementWithBody); + +var AST_IterationStatement = DEFNODE("IterationStatement", "block_scope", { + $documentation: "Internal class. All loops inherit from it.", + $propdoc: { + block_scope: "[AST_Scope] the block scope for this iteration statement." + }, + clone: clone_block_scope +}, AST_StatementWithBody); + +var AST_DWLoop = DEFNODE("DWLoop", "condition", { + $documentation: "Base class for do/while statements", + $propdoc: { + condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" + } +}, AST_IterationStatement); + +var AST_Do = DEFNODE("Do", null, { + $documentation: "A `do` statement", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.body._walk(visitor); + this.condition._walk(visitor); + }); + } +}, AST_DWLoop); + +var AST_While = DEFNODE("While", null, { + $documentation: "A `while` statement", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.condition._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_DWLoop); + +var AST_For = DEFNODE("For", "init condition step", { + $documentation: "A `for` statement", + $propdoc: { + init: "[AST_Node?] the `for` initialization code, or null if empty", + condition: "[AST_Node?] the `for` termination clause, or null if empty", + step: "[AST_Node?] the `for` update clause, or null if empty" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.init) this.init._walk(visitor); + if (this.condition) this.condition._walk(visitor); + if (this.step) this.step._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_IterationStatement); + +var AST_ForIn = DEFNODE("ForIn", "init object", { + $documentation: "A `for ... in` statement", + $propdoc: { + init: "[AST_Node] the `for/in` initialization code", + object: "[AST_Node] the object that we're looping through" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.init._walk(visitor); + this.object._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_IterationStatement); + +var AST_ForOf = DEFNODE("ForOf", "await", { + $documentation: "A `for ... of` statement", +}, AST_ForIn); + +var AST_With = DEFNODE("With", "expression", { + $documentation: "A `with` statement", + $propdoc: { + expression: "[AST_Node] the `with` expression" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_StatementWithBody); + +/* -----[ scope and functions ]----- */ + +var AST_Scope = DEFNODE("Scope", "variables functions uses_with uses_eval parent_scope enclosed cname", { + $documentation: "Base class for all statements introducing a lexical scope", + $propdoc: { + variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope", + functions: "[Object/S] like `variables`, but only lists function declarations", + uses_with: "[boolean/S] tells whether this scope uses the `with` statement", + uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", + parent_scope: "[AST_Scope?/S] link to the parent scope", + enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", + cname: "[integer/S] current index for mangling variables (used internally by the mangler)", + }, + get_defun_scope: function() { + var self = this; + while (self.is_block_scope()) { + self = self.parent_scope; + } + return self; + }, + clone: function(deep) { + var node = this._clone(deep); + if (this.variables) node.variables = this.variables.clone(); + if (this.functions) node.functions = this.functions.clone(); + if (this.enclosed) node.enclosed = this.enclosed.slice(); + return node; + }, + pinned: function() { + return this.uses_eval || this.uses_with; + } +}, AST_Block); + +var AST_Toplevel = DEFNODE("Toplevel", "globals", { + $documentation: "The toplevel scope", + $propdoc: { + globals: "[Object/S] a map of name -> SymbolDef for all undeclared names", + }, + wrap_commonjs: function(name) { + var body = this.body; + var wrapped_tl = "(function(exports){'$ORIG';})(typeof " + name + "=='undefined'?(" + name + "={}):" + name + ");"; + wrapped_tl = parse(wrapped_tl); + wrapped_tl = wrapped_tl.transform(new TreeTransformer(function(node) { + if (node instanceof AST_Directive && node.value == "$ORIG") { + return MAP.splice(body); + } + })); + return wrapped_tl; + }, + wrap_enclose: function(args_values) { + if (typeof args_values != "string") args_values = ""; + var index = args_values.indexOf(":"); + if (index < 0) index = args_values.length; + var body = this.body; + return parse([ + "(function(", + args_values.slice(0, index), + '){"$ORIG"})(', + args_values.slice(index + 1), + ")" + ].join("")).transform(new TreeTransformer(function(node) { + if (node instanceof AST_Directive && node.value == "$ORIG") { + return MAP.splice(body); + } + })); + } +}, AST_Scope); + +var AST_Expansion = DEFNODE("Expansion", "expression", { + $documentation: "An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list", + $propdoc: { + expression: "[AST_Node] the thing to be expanded" + }, + _walk: function(visitor) { + var self = this; + return visitor._visit(this, function() { + self.expression.walk(visitor); + }); + } +}); + +var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments is_generator async", { + $documentation: "Base class for functions", + $propdoc: { + name: "[AST_SymbolDeclaration?] the name of this function", + argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments", + uses_arguments: "[boolean/S] tells whether this function accesses the arguments array", + is_generator: "[boolean] is this a generator method", + async: "[boolean] is this method async", + }, + args_as_names: function () { + var out = []; + for (var i = 0; i < this.argnames.length; i++) { + if (this.argnames[i] instanceof AST_Destructuring) { + out = out.concat(this.argnames[i].all_symbols()); + } else { + out.push(this.argnames[i]); + } + } + return out; + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.name) this.name._walk(visitor); + var argnames = this.argnames; + for (var i = 0, len = argnames.length; i < len; i++) { + argnames[i]._walk(visitor); + } + walk_body(this, visitor); + }); + } +}, AST_Scope); + +var AST_Accessor = DEFNODE("Accessor", null, { + $documentation: "A setter/getter function. The `name` property is always null." +}, AST_Lambda); + +var AST_Function = DEFNODE("Function", "inlined", { + $documentation: "A function expression" +}, AST_Lambda); + +var AST_Arrow = DEFNODE("Arrow", "inlined", { + $documentation: "An ES6 Arrow function ((a) => b)" +}, AST_Lambda); + +var AST_Defun = DEFNODE("Defun", "inlined", { + $documentation: "A function definition" +}, AST_Lambda); + +/* -----[ DESTRUCTURING ]----- */ +var AST_Destructuring = DEFNODE("Destructuring", "names is_array", { + $documentation: "A destructuring of several names. Used in destructuring assignment and with destructuring function argument names", + $propdoc: { + "names": "[AST_Node*] Array of properties or elements", + "is_array": "[Boolean] Whether the destructuring represents an object or array" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.names.forEach(function(name) { + name._walk(visitor); + }); + }); + }, + all_symbols: function() { + var out = []; + this.walk(new TreeWalker(function (node) { + if (node instanceof AST_Symbol) { + out.push(node); + } + if (node instanceof AST_Expansion) { + out.push(node.expression); + } + })); + return out; + } +}); + +var AST_PrefixedTemplateString = DEFNODE("PrefixedTemplateString", "template_string prefix", { + $documentation: "A templatestring with a prefix, such as String.raw`foobarbaz`", + $propdoc: { + template_string: "[AST_TemplateString] The template string", + prefix: "[AST_SymbolRef|AST_PropAccess] The prefix, which can be a symbol such as `foo` or a dotted expression such as `String.raw`." + }, + _walk: function(visitor) { + this.prefix._walk(visitor); + this.template_string._walk(visitor); + } +}); + +var AST_TemplateString = DEFNODE("TemplateString", "segments", { + $documentation: "A template string literal", + $propdoc: { + segments: "[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment." + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.segments.forEach(function(seg) { + seg._walk(visitor); + }); + }); + } +}); + +var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", { + $documentation: "A segment of a template string literal", + $propdoc: { + value: "Content of the segment", + raw: "Raw content of the segment" + } +}); + +/* -----[ JUMPS ]----- */ + +var AST_Jump = DEFNODE("Jump", null, { + $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)" +}, AST_Statement); + +var AST_Exit = DEFNODE("Exit", "value", { + $documentation: "Base class for “exits” (`return` and `throw`)", + $propdoc: { + value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" + }, + _walk: function(visitor) { + return visitor._visit(this, this.value && function() { + this.value._walk(visitor); + }); + } +}, AST_Jump); + +var AST_Return = DEFNODE("Return", null, { + $documentation: "A `return` statement" +}, AST_Exit); + +var AST_Throw = DEFNODE("Throw", null, { + $documentation: "A `throw` statement" +}, AST_Exit); + +var AST_LoopControl = DEFNODE("LoopControl", "label", { + $documentation: "Base class for loop control statements (`break` and `continue`)", + $propdoc: { + label: "[AST_LabelRef?] the label, or null if none", + }, + _walk: function(visitor) { + return visitor._visit(this, this.label && function() { + this.label._walk(visitor); + }); + } +}, AST_Jump); + +var AST_Break = DEFNODE("Break", null, { + $documentation: "A `break` statement" +}, AST_LoopControl); + +var AST_Continue = DEFNODE("Continue", null, { + $documentation: "A `continue` statement" +}, AST_LoopControl); + +/* -----[ IF ]----- */ + +var AST_If = DEFNODE("If", "condition alternative", { + $documentation: "A `if` statement", + $propdoc: { + condition: "[AST_Node] the `if` condition", + alternative: "[AST_Statement?] the `else` part, or null if not present" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.condition._walk(visitor); + this.body._walk(visitor); + if (this.alternative) this.alternative._walk(visitor); + }); + } +}, AST_StatementWithBody); + +/* -----[ SWITCH ]----- */ + +var AST_Switch = DEFNODE("Switch", "expression", { + $documentation: "A `switch` statement", + $propdoc: { + expression: "[AST_Node] the `switch` “discriminant”" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + walk_body(this, visitor); + }); + } +}, AST_Block); + +var AST_SwitchBranch = DEFNODE("SwitchBranch", null, { + $documentation: "Base class for `switch` branches", +}, AST_Block); + +var AST_Default = DEFNODE("Default", null, { + $documentation: "A `default` switch branch", +}, AST_SwitchBranch); + +var AST_Case = DEFNODE("Case", "expression", { + $documentation: "A `case` switch branch", + $propdoc: { + expression: "[AST_Node] the `case` expression" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + walk_body(this, visitor); + }); + } +}, AST_SwitchBranch); + +/* -----[ EXCEPTIONS ]----- */ + +var AST_Try = DEFNODE("Try", "bcatch bfinally", { + $documentation: "A `try` statement", + $propdoc: { + bcatch: "[AST_Catch?] the catch block, or null if not present", + bfinally: "[AST_Finally?] the finally block, or null if not present" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + walk_body(this, visitor); + if (this.bcatch) this.bcatch._walk(visitor); + if (this.bfinally) this.bfinally._walk(visitor); + }); + } +}, AST_Block); + +var AST_Catch = DEFNODE("Catch", "argname", { + $documentation: "A `catch` node; only makes sense as part of a `try` statement", + $propdoc: { + argname: "[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.argname) this.argname._walk(visitor); + walk_body(this, visitor); + }); + } +}, AST_Block); + +var AST_Finally = DEFNODE("Finally", null, { + $documentation: "A `finally` node; only makes sense as part of a `try` statement" +}, AST_Block); + +/* -----[ VAR/CONST ]----- */ + +var AST_Definitions = DEFNODE("Definitions", "definitions", { + $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", + $propdoc: { + definitions: "[AST_VarDef*] array of variable definitions" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var definitions = this.definitions; + for (var i = 0, len = definitions.length; i < len; i++) { + definitions[i]._walk(visitor); + } + }); + } +}, AST_Statement); + +var AST_Var = DEFNODE("Var", null, { + $documentation: "A `var` statement" +}, AST_Definitions); + +var AST_Let = DEFNODE("Let", null, { + $documentation: "A `let` statement" +}, AST_Definitions); + +var AST_Const = DEFNODE("Const", null, { + $documentation: "A `const` statement" +}, AST_Definitions); + +var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", { + $documentation: "The part of the export/import statement that declare names from a module.", + $propdoc: { + foreign_name: "[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)", + name: "[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module." + }, + _walk: function (visitor) { + return visitor._visit(this, function() { + this.foreign_name._walk(visitor); + this.name._walk(visitor); + }); + } +}); + +var AST_Import = DEFNODE("Import", "imported_name imported_names module_name", { + $documentation: "An `import` statement", + $propdoc: { + imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.", + imported_names: "[AST_NameMapping*] The names of non-default imported variables", + module_name: "[AST_String] String literal describing where this module came from", + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.imported_name) { + this.imported_name._walk(visitor); + } + if (this.imported_names) { + this.imported_names.forEach(function(name_import) { + name_import._walk(visitor); + }); + } + this.module_name._walk(visitor); + }); + } +}); + +var AST_Export = DEFNODE("Export", "exported_definition exported_value is_default exported_names module_name", { + $documentation: "An `export` statement", + $propdoc: { + exported_definition: "[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition", + exported_value: "[AST_Node?] An exported value", + exported_names: "[AST_NameMapping*?] List of exported names", + module_name: "[AST_String?] Name of the file to load exports from", + is_default: "[Boolean] Whether this is the default exported value of this module" + }, + _walk: function (visitor) { + visitor._visit(this, function () { + if (this.exported_definition) { + this.exported_definition._walk(visitor); + } + if (this.exported_value) { + this.exported_value._walk(visitor); + } + if (this.exported_names) { + this.exported_names.forEach(function(name_export) { + name_export._walk(visitor); + }); + } + if (this.module_name) { + this.module_name._walk(visitor); + } + }); + } +}, AST_Statement); + +var AST_VarDef = DEFNODE("VarDef", "name value", { + $documentation: "A variable declaration; only appears in a AST_Definitions node", + $propdoc: { + name: "[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable", + value: "[AST_Node?] initializer, or null of there's no initializer" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.name._walk(visitor); + if (this.value) this.value._walk(visitor); + }); + } +}); + +/* -----[ OTHER ]----- */ + +var AST_Call = DEFNODE("Call", "expression args", { + $documentation: "A function call expression", + $propdoc: { + expression: "[AST_Node] expression to invoke as function", + args: "[AST_Node*] array of arguments" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var args = this.args; + for (var i = 0, len = args.length; i < len; i++) { + args[i]._walk(visitor); + } + this.expression._walk(visitor); + }); + } +}); + +var AST_New = DEFNODE("New", null, { + $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" +}, AST_Call); + +var AST_Sequence = DEFNODE("Sequence", "expressions", { + $documentation: "A sequence expression (comma-separated expressions)", + $propdoc: { + expressions: "[AST_Node*] array of expressions (at least two)" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expressions.forEach(function(node) { + node._walk(visitor); + }); + }); + } +}); + +var AST_PropAccess = DEFNODE("PropAccess", "expression property", { + $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`", + $propdoc: { + expression: "[AST_Node] the “container” expression", + property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node" + } +}); + +var AST_Dot = DEFNODE("Dot", null, { + $documentation: "A dotted property access expression", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + }); + } +}, AST_PropAccess); + +var AST_Sub = DEFNODE("Sub", null, { + $documentation: "Index-style property access, i.e. `a[\"foo\"]`", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + this.property._walk(visitor); + }); + } +}, AST_PropAccess); + +var AST_Unary = DEFNODE("Unary", "operator expression", { + $documentation: "Base class for unary expressions", + $propdoc: { + operator: "[string] the operator", + expression: "[AST_Node] expression that this unary operator applies to" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + }); + } +}); + +var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, { + $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" +}, AST_Unary); + +var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, { + $documentation: "Unary postfix expression, i.e. `i++`" +}, AST_Unary); + +var AST_Binary = DEFNODE("Binary", "operator left right", { + $documentation: "Binary expression, i.e. `a + b`", + $propdoc: { + left: "[AST_Node] left-hand side expression", + operator: "[string] the operator", + right: "[AST_Node] right-hand side expression" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.left._walk(visitor); + this.right._walk(visitor); + }); + } +}); + +var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", { + $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", + $propdoc: { + condition: "[AST_Node]", + consequent: "[AST_Node]", + alternative: "[AST_Node]" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.condition._walk(visitor); + this.consequent._walk(visitor); + this.alternative._walk(visitor); + }); + } +}); + +var AST_Assign = DEFNODE("Assign", null, { + $documentation: "An assignment expression — `a = b + 5`", +}, AST_Binary); + +var AST_DefaultAssign = DEFNODE("DefaultAssign", null, { + $documentation: "A default assignment expression like in `(a = 3) => a`" +}, AST_Binary); + +/* -----[ LITERALS ]----- */ + +var AST_Array = DEFNODE("Array", "elements", { + $documentation: "An array literal", + $propdoc: { + elements: "[AST_Node*] array of elements" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var elements = this.elements; + for (var i = 0, len = elements.length; i < len; i++) { + elements[i]._walk(visitor); + } + }); + } +}); + +var AST_Object = DEFNODE("Object", "properties", { + $documentation: "An object literal", + $propdoc: { + properties: "[AST_ObjectProperty*] array of properties" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var properties = this.properties; + for (var i = 0, len = properties.length; i < len; i++) { + properties[i]._walk(visitor); + } + }); + } +}); + +var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", { + $documentation: "Base class for literal object properties", + $propdoc: { + key: "[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.", + value: "[AST_Node] property value. For getters and setters this is an AST_Accessor." + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.key instanceof AST_Node) + this.key._walk(visitor); + this.value._walk(visitor); + }); + } +}); + +var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", "quote", { + $documentation: "A key: value object property", + $propdoc: { + quote: "[string] the original quote character" + } +}, AST_ObjectProperty); + +var AST_ObjectSetter = DEFNODE("ObjectSetter", "quote static", { + $propdoc: { + quote: "[string|undefined] the original quote character, if any", + static: "[boolean] whether this is a static setter (classes only)" + }, + $documentation: "An object setter property", +}, AST_ObjectProperty); + +var AST_ObjectGetter = DEFNODE("ObjectGetter", "quote static", { + $propdoc: { + quote: "[string|undefined] the original quote character, if any", + static: "[boolean] whether this is a static getter (classes only)" + }, + $documentation: "An object getter property", +}, AST_ObjectProperty); + +var AST_ConciseMethod = DEFNODE("ConciseMethod", "quote static is_generator async", { + $propdoc: { + quote: "[string|undefined] the original quote character, if any", + static: "[boolean] is this method static (classes only)", + is_generator: "[boolean] is this a generator method", + async: "[boolean] is this method async", + }, + $documentation: "An ES6 concise method inside an object or class" +}, AST_ObjectProperty); + +var AST_Class = DEFNODE("Class", "name extends properties inlined", { + $propdoc: { + name: "[AST_SymbolClass|AST_SymbolDefClass?] optional class name.", + extends: "[AST_Node]? optional parent class", + properties: "[AST_ObjectProperty*] array of properties" + }, + $documentation: "An ES6 class", + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.name) { + this.name._walk(visitor); + } + if (this.extends) { + this.extends._walk(visitor); + } + this.properties.forEach(function(prop) { + prop._walk(visitor); + }); + }); + }, +}, AST_Scope); + +var AST_DefClass = DEFNODE("DefClass", null, { + $documentation: "A class definition", +}, AST_Class); + +var AST_ClassExpression = DEFNODE("ClassExpression", null, { + $documentation: "A class expression." +}, AST_Class); + +var AST_Symbol = DEFNODE("Symbol", "scope name thedef", { + $propdoc: { + name: "[string] name of this symbol", + scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", + thedef: "[SymbolDef/S] the definition of this symbol" + }, + $documentation: "Base class for all symbols" +}); + +var AST_NewTarget = DEFNODE("NewTarget", null, { + $documentation: "A reference to new.target" +}); + +var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", { + $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)", +}, AST_Symbol); + +var AST_SymbolVar = DEFNODE("SymbolVar", null, { + $documentation: "Symbol defining a variable", +}, AST_SymbolDeclaration); + +var AST_SymbolBlockDeclaration = DEFNODE("SymbolBlockDeclaration", null, { + $documentation: "Base class for block-scoped declaration symbols" +}, AST_SymbolDeclaration); + +var AST_SymbolConst = DEFNODE("SymbolConst", null, { + $documentation: "A constant declaration" +}, AST_SymbolBlockDeclaration); + +var AST_SymbolLet = DEFNODE("SymbolLet", null, { + $documentation: "A block-scoped `let` declaration" +}, AST_SymbolBlockDeclaration); + +var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, { + $documentation: "Symbol naming a function argument", +}, AST_SymbolVar); + +var AST_SymbolDefun = DEFNODE("SymbolDefun", null, { + $documentation: "Symbol defining a function", +}, AST_SymbolDeclaration); + +var AST_SymbolMethod = DEFNODE("SymbolMethod", null, { + $documentation: "Symbol in an object defining a method", +}, AST_Symbol); + +var AST_SymbolLambda = DEFNODE("SymbolLambda", null, { + $documentation: "Symbol naming a function expression", +}, AST_SymbolDeclaration); + +var AST_SymbolDefClass = DEFNODE("SymbolDefClass", null, { + $documentation: "Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class." +}, AST_SymbolBlockDeclaration); + +var AST_SymbolClass = DEFNODE("SymbolClass", null, { + $documentation: "Symbol naming a class's name. Lexically scoped to the class." +}, AST_SymbolDeclaration); + +var AST_SymbolCatch = DEFNODE("SymbolCatch", null, { + $documentation: "Symbol naming the exception in catch", +}, AST_SymbolBlockDeclaration); + +var AST_SymbolImport = DEFNODE("SymbolImport", null, { + $documentation: "Symbol referring to an imported name", +}, AST_SymbolBlockDeclaration); + +var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign", null, { + $documentation: "A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes", +}, AST_Symbol); + +var AST_Label = DEFNODE("Label", "references", { + $documentation: "Symbol naming a label (declaration)", + $propdoc: { + references: "[AST_LoopControl*] a list of nodes referring to this label" + }, + initialize: function() { + this.references = []; + this.thedef = this; + } +}, AST_Symbol); + +var AST_SymbolRef = DEFNODE("SymbolRef", null, { + $documentation: "Reference to some symbol (not definition/declaration)", +}, AST_Symbol); + +var AST_SymbolExport = DEFNODE("SymbolExport", null, { + $documentation: "Symbol referring to a name to export", +}, AST_SymbolRef); + +var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign", null, { + $documentation: "A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes", +}, AST_Symbol); + +var AST_LabelRef = DEFNODE("LabelRef", null, { + $documentation: "Reference to a label symbol", +}, AST_Symbol); + +var AST_This = DEFNODE("This", null, { + $documentation: "The `this` symbol", +}, AST_Symbol); + +var AST_Super = DEFNODE("Super", null, { + $documentation: "The `super` symbol", +}, AST_This); + +var AST_Constant = DEFNODE("Constant", null, { + $documentation: "Base class for all constants", + getValue: function() { + return this.value; + } +}); + +var AST_String = DEFNODE("String", "value quote", { + $documentation: "A string literal", + $propdoc: { + value: "[string] the contents of this string", + quote: "[string] the original quote character" + } +}, AST_Constant); + +var AST_Number = DEFNODE("Number", "value literal", { + $documentation: "A number literal", + $propdoc: { + value: "[number] the numeric value", + literal: "[string] numeric value as string (optional)" + } +}, AST_Constant); + +var AST_RegExp = DEFNODE("RegExp", "value", { + $documentation: "A regexp literal", + $propdoc: { + value: "[RegExp] the actual regexp", + } +}, AST_Constant); + +var AST_Atom = DEFNODE("Atom", null, { + $documentation: "Base class for atoms", +}, AST_Constant); + +var AST_Null = DEFNODE("Null", null, { + $documentation: "The `null` atom", + value: null +}, AST_Atom); + +var AST_NaN = DEFNODE("NaN", null, { + $documentation: "The impossible value", + value: 0/0 +}, AST_Atom); + +var AST_Undefined = DEFNODE("Undefined", null, { + $documentation: "The `undefined` value", + value: (function() {}()) +}, AST_Atom); + +var AST_Hole = DEFNODE("Hole", null, { + $documentation: "A hole in an array", + value: (function() {}()) +}, AST_Atom); + +var AST_Infinity = DEFNODE("Infinity", null, { + $documentation: "The `Infinity` value", + value: 1/0 +}, AST_Atom); + +var AST_Boolean = DEFNODE("Boolean", null, { + $documentation: "Base class for booleans", +}, AST_Atom); + +var AST_False = DEFNODE("False", null, { + $documentation: "The `false` atom", + value: false +}, AST_Boolean); + +var AST_True = DEFNODE("True", null, { + $documentation: "The `true` atom", + value: true +}, AST_Boolean); + +var AST_Await = DEFNODE("Await", "expression", { + $documentation: "An `await` statement", + $propdoc: { + expression: "[AST_Node] the mandatory expression being awaited", + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + }); + } +}); + +var AST_Yield = DEFNODE("Yield", "expression is_star", { + $documentation: "A `yield` statement", + $propdoc: { + expression: "[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false", + is_star: "[Boolean] Whether this is a yield or yield* statement" + }, + _walk: function(visitor) { + return visitor._visit(this, this.expression && function() { + this.expression._walk(visitor); + }); + } +}); + +/* -----[ TreeWalker ]----- */ + +function TreeWalker(callback) { + this.visit = callback; + this.stack = []; + this.directives = Object.create(null); +} +TreeWalker.prototype = { + _visit: function(node, descend) { + this.push(node); + var ret = this.visit(node, descend ? function() { + descend.call(node); + } : noop); + if (!ret && descend) { + descend.call(node); + } + this.pop(); + return ret; + }, + parent: function(n) { + return this.stack[this.stack.length - 2 - (n || 0)]; + }, + push: function(node) { + if (node instanceof AST_Lambda) { + this.directives = Object.create(this.directives); + } else if (node instanceof AST_Directive && !this.directives[node.value]) { + this.directives[node.value] = node; + } else if (node instanceof AST_Class) { + this.directives = Object.create(this.directives); + if (!this.directives["use strict"]) { + this.directives["use strict"] = node; + } + } + this.stack.push(node); + }, + pop: function() { + var node = this.stack.pop(); + if (node instanceof AST_Lambda || node instanceof AST_Class) { + this.directives = Object.getPrototypeOf(this.directives); + } + }, + self: function() { + return this.stack[this.stack.length - 1]; + }, + find_parent: function(type) { + var stack = this.stack; + for (var i = stack.length; --i >= 0;) { + var x = stack[i]; + if (x instanceof type) return x; + } + }, + has_directive: function(type) { + var dir = this.directives[type]; + if (dir) return dir; + var node = this.stack[this.stack.length - 1]; + if (node instanceof AST_Scope && node.body) { + for (var i = 0; i < node.body.length; ++i) { + var st = node.body[i]; + if (!(st instanceof AST_Directive)) break; + if (st.value == type) return st; + } + } + }, + loopcontrol_target: function(node) { + var stack = this.stack; + if (node.label) for (var i = stack.length; --i >= 0;) { + var x = stack[i]; + if (x instanceof AST_LabeledStatement && x.label.name == node.label.name) + return x.body; + } else for (var i = stack.length; --i >= 0;) { + var x = stack[i]; + if (x instanceof AST_IterationStatement + || node instanceof AST_Break && x instanceof AST_Switch) + return x; + } + } +}; diff --git a/tools/node_modules/terser/lib/compress.js b/tools/node_modules/terser/lib/compress.js new file mode 100644 index 000000000000..564ca33f9423 --- /dev/null +++ b/tools/node_modules/terser/lib/compress.js @@ -0,0 +1,6801 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function Compressor(options, false_by_default) { + if (!(this instanceof Compressor)) + return new Compressor(options, false_by_default); + TreeTransformer.call(this, this.before, this.after); + if (options.defaults !== undefined && !options.defaults) false_by_default = true; + this.options = defaults(options, { + arguments : false, + arrows : !false_by_default, + booleans : !false_by_default, + booleans_as_integers : false, + collapse_vars : !false_by_default, + comparisons : !false_by_default, + computed_props: !false_by_default, + conditionals : !false_by_default, + dead_code : !false_by_default, + defaults : true, + directives : !false_by_default, + drop_console : false, + drop_debugger : !false_by_default, + ecma : 5, + evaluate : !false_by_default, + expression : false, + global_defs : false, + hoist_funs : false, + hoist_props : !false_by_default, + hoist_vars : false, + ie8 : false, + if_return : !false_by_default, + inline : !false_by_default, + join_vars : !false_by_default, + keep_classnames: false, + keep_fargs : true, + keep_fnames : false, + keep_infinity : false, + loops : !false_by_default, + module : false, + negate_iife : !false_by_default, + passes : 1, + properties : !false_by_default, + pure_getters : !false_by_default && "strict", + pure_funcs : null, + reduce_funcs : !false_by_default, + reduce_vars : !false_by_default, + sequences : !false_by_default, + side_effects : !false_by_default, + switches : !false_by_default, + top_retain : null, + toplevel : !!(options && options["top_retain"]), + typeofs : !false_by_default, + unsafe : false, + unsafe_arrows : false, + unsafe_comps : false, + unsafe_Function: false, + unsafe_math : false, + unsafe_methods: false, + unsafe_proto : false, + unsafe_regexp : false, + unsafe_undefined: false, + unused : !false_by_default, + warnings : false, + }, true); + var global_defs = this.options["global_defs"]; + if (typeof global_defs == "object") for (var key in global_defs) { + if (/^@/.test(key) && HOP(global_defs, key)) { + global_defs[key.slice(1)] = parse(global_defs[key], { + expression: true + }); + } + } + if (this.options["inline"] === true) this.options["inline"] = 3; + var pure_funcs = this.options["pure_funcs"]; + if (typeof pure_funcs == "function") { + this.pure_funcs = pure_funcs; + } else { + this.pure_funcs = pure_funcs ? function(node) { + return pure_funcs.indexOf(node.expression.print_to_string()) < 0; + } : return_true; + } + var top_retain = this.options["top_retain"]; + if (top_retain instanceof RegExp) { + this.top_retain = function(def) { + return top_retain.test(def.name); + }; + } else if (typeof top_retain == "function") { + this.top_retain = top_retain; + } else if (top_retain) { + if (typeof top_retain == "string") { + top_retain = top_retain.split(/,/); + } + this.top_retain = function(def) { + return top_retain.indexOf(def.name) >= 0; + }; + } + if (this.options["module"]) { + this.directives["use strict"] = true; + this.options["toplevel"] = true; + } + var toplevel = this.options["toplevel"]; + this.toplevel = typeof toplevel == "string" ? { + funcs: /funcs/.test(toplevel), + vars: /vars/.test(toplevel) + } : { + funcs: toplevel, + vars: toplevel + }; + var sequences = this.options["sequences"]; + this.sequences_limit = sequences == 1 ? 800 : sequences | 0; + this.warnings_produced = {}; +} + +Compressor.prototype = new TreeTransformer; +merge(Compressor.prototype, { + option: function(key) { return this.options[key]; }, + exposed: function(def) { + if (def.export) return true; + if (def.global) for (var i = 0, len = def.orig.length; i < len; i++) + if (!this.toplevel[def.orig[i] instanceof AST_SymbolDefun ? "funcs" : "vars"]) + return true; + return false; + }, + in_boolean_context: function() { + if (!this.option("booleans")) return false; + var self = this.self(); + for (var i = 0, p; p = this.parent(i); i++) { + if (p instanceof AST_SimpleStatement + || p instanceof AST_Conditional && p.condition === self + || p instanceof AST_DWLoop && p.condition === self + || p instanceof AST_For && p.condition === self + || p instanceof AST_If && p.condition === self + || p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self) { + return true; + } + if (p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||") + || p instanceof AST_Conditional + || p.tail_node() === self) { + self = p; + } else { + return false; + } + } + }, + compress: function(node) { + node = node.resolve_defines(this); + if (this.option("expression")) { + node.process_expression(true); + } + var passes = +this.options.passes || 1; + var min_count = 1 / 0; + var stopping = false; + var mangle = { ie8: this.option("ie8") }; + for (var pass = 0; pass < passes; pass++) { + node.figure_out_scope(mangle); + if (pass === 0 && this.option("drop_console")) { + // must be run before reduce_vars and compress pass + node = node.drop_console(); + } + if (pass > 0 || this.option("reduce_vars")) + node.reset_opt_flags(this); + node = node.transform(this); + if (passes > 1) { + var count = 0; + node.walk(new TreeWalker(function() { + count++; + })); + this.info("pass " + pass + ": last_count: " + min_count + ", count: " + count); + if (count < min_count) { + min_count = count; + stopping = false; + } else if (stopping) { + break; + } else { + stopping = true; + } + } + } + if (this.option("expression")) { + node.process_expression(false); + } + return node; + }, + info: function() { + if (this.options.warnings == "verbose") { + AST_Node.warn.apply(AST_Node, arguments); + } + }, + warn: function(text, props) { + if (this.options.warnings) { + // only emit unique warnings + var message = string_template(text, props); + if (!(message in this.warnings_produced)) { + this.warnings_produced[message] = true; + AST_Node.warn.apply(AST_Node, arguments); + } + } + }, + clear_warnings: function() { + this.warnings_produced = {}; + }, + before: function(node, descend, in_list) { + if (node._squeezed) return node; + var was_scope = false; + if (node instanceof AST_Scope) { + node = node.hoist_properties(this); + node = node.hoist_declarations(this); + was_scope = true; + } + // Before https://github.com/mishoo/UglifyJS2/pull/1602 AST_Node.optimize() + // would call AST_Node.transform() if a different instance of AST_Node is + // produced after OPT(). + // This corrupts TreeWalker.stack, which cause AST look-ups to malfunction. + // Migrate and defer all children's AST_Node.transform() to below, which + // will now happen after this parent AST_Node has been properly substituted + // thus gives a consistent AST snapshot. + descend(node, this); + // Existing code relies on how AST_Node.optimize() worked, and omitting the + // following replacement call would result in degraded efficiency of both + // output and performance. + descend(node, this); + var opt = node.optimize(this); + if (was_scope && opt instanceof AST_Scope) { + opt.drop_unused(this); + descend(opt, this); + } + if (opt === node) opt._squeezed = true; + return opt; + } +}); + +(function() { + + function OPT(node, optimizer) { + node.DEFMETHOD("optimize", function(compressor) { + var self = this; + if (self._optimized) return self; + if (compressor.has_directive("use asm")) return self; + var opt = optimizer(self, compressor); + opt._optimized = true; + return opt; + }); + } + + OPT(AST_Node, function(self, compressor) { + return self; + }); + + AST_Toplevel.DEFMETHOD("drop_console", function() { + return this.transform(new TreeTransformer(function(self) { + if (self.TYPE == "Call") { + var exp = self.expression; + if (exp instanceof AST_PropAccess) { + var name = exp.expression; + while (name.expression) { + name = name.expression; + } + if (is_undeclared_ref(name) && name.name == "console") { + return make_node(AST_Undefined, self); + } + } + } + })); + }); + + AST_Node.DEFMETHOD("equivalent_to", function(node) { + return this.TYPE == node.TYPE && this.print_to_string() == node.print_to_string(); + }); + + AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) { + var self = this; + var tt = new TreeTransformer(function(node) { + if (insert && node instanceof AST_SimpleStatement) { + return make_node(AST_Return, node, { + value: node.body + }); + } + if (!insert && node instanceof AST_Return) { + if (compressor) { + var value = node.value && node.value.drop_side_effect_free(compressor, true); + return value ? make_node(AST_SimpleStatement, node, { + body: value + }) : make_node(AST_EmptyStatement, node); + } + return make_node(AST_SimpleStatement, node, { + body: node.value || make_node(AST_UnaryPrefix, node, { + operator: "void", + expression: make_node(AST_Number, node, { + value: 0 + }) + }) + }); + } + if (node instanceof AST_Class || node instanceof AST_Lambda && node !== self) { + return node; + } + if (node instanceof AST_Block) { + var index = node.body.length - 1; + if (index >= 0) { + node.body[index] = node.body[index].transform(tt); + } + } else if (node instanceof AST_If) { + node.body = node.body.transform(tt); + if (node.alternative) { + node.alternative = node.alternative.transform(tt); + } + } else if (node instanceof AST_With) { + node.body = node.body.transform(tt); + } + return node; + }); + self.transform(tt); + }); + + function read_property(obj, key) { + key = get_value(key); + if (key instanceof AST_Node) return; + var value; + if (obj instanceof AST_Array) { + var elements = obj.elements; + if (key == "length") return make_node_from_constant(elements.length, obj); + if (typeof key == "number" && key in elements) value = elements[key]; + } else if (obj instanceof AST_Object) { + key = "" + key; + var props = obj.properties; + for (var i = props.length; --i >= 0;) { + var prop = props[i]; + if (!(prop instanceof AST_ObjectKeyVal)) return; + if (!value && props[i].key === key) value = props[i].value; + } + } + return value instanceof AST_SymbolRef && value.fixed_value() || value; + } + + function is_modified(compressor, tw, node, value, level, immutable) { + var parent = tw.parent(level); + var lhs = is_lhs(node, parent); + if (lhs) return lhs; + if (!immutable + && parent instanceof AST_Call + && parent.expression === node + && !(value instanceof AST_Arrow) + && !(value instanceof AST_Class) + && !parent.is_expr_pure(compressor) + && (!(value instanceof AST_Function) + || !(parent instanceof AST_New) && value.contains_this())) { + return true; + } + if (parent instanceof AST_Array) { + return is_modified(compressor, tw, parent, parent, level + 1); + } + if (parent instanceof AST_ObjectKeyVal && node === parent.value) { + var obj = tw.parent(level + 1); + return is_modified(compressor, tw, obj, obj, level + 2); + } + if (parent instanceof AST_PropAccess && parent.expression === node) { + var prop = read_property(value, parent.property); + return !immutable && is_modified(compressor, tw, parent, prop, level + 1); + } + } + + (function(def) { + def(AST_Node, noop); + + function reset_def(compressor, def) { + def.assignments = 0; + def.chained = false; + def.direct_access = false; + def.escaped = false; + if (def.scope.pinned()) { + def.fixed = false; + } else if (def.orig[0] instanceof AST_SymbolConst || !compressor.exposed(def)) { + def.fixed = def.init; + } else { + def.fixed = false; + } + def.recursive_refs = 0; + def.references = []; + def.should_replace = undefined; + def.single_use = undefined; + } + + function reset_variables(tw, compressor, node) { + node.variables.each(function(def) { + reset_def(compressor, def); + if (def.fixed === null) { + def.safe_ids = tw.safe_ids; + mark(tw, def, true); + } else if (def.fixed) { + tw.loop_ids[def.id] = tw.in_loop; + mark(tw, def, true); + } + }); + } + + function reset_block_variables(compressor, node) { + if (node.block_scope) node.block_scope.variables.each(function(def) { + reset_def(compressor, def); + }); + } + + function push(tw) { + tw.safe_ids = Object.create(tw.safe_ids); + } + + function pop(tw) { + tw.safe_ids = Object.getPrototypeOf(tw.safe_ids); + } + + function mark(tw, def, safe) { + tw.safe_ids[def.id] = safe; + } + + function safe_to_read(tw, def) { + if (def.single_use == "m") return false; + if (tw.safe_ids[def.id]) { + if (def.fixed == null) { + var orig = def.orig[0]; + if (orig instanceof AST_SymbolFunarg || orig.name == "arguments") return false; + def.fixed = make_node(AST_Undefined, orig); + } + return true; + } + return def.fixed instanceof AST_Defun; + } + + function safe_to_assign(tw, def, value) { + if (def.fixed === undefined) return true; + if (def.fixed === null && def.safe_ids) { + def.safe_ids[def.id] = false; + delete def.safe_ids; + return true; + } + if (!HOP(tw.safe_ids, def.id)) return false; + if (!safe_to_read(tw, def)) return false; + if (def.fixed === false) return false; + if (def.fixed != null && (!value || def.references.length > def.assignments)) return false; + return all(def.orig, function(sym) { + return !(sym instanceof AST_SymbolConst + || sym instanceof AST_SymbolDefun + || sym instanceof AST_SymbolLambda); + }); + } + + function ref_once(tw, compressor, def) { + return compressor.option("unused") + && !def.scope.pinned() + && def.references.length - def.recursive_refs == 1 + && tw.loop_ids[def.id] === tw.in_loop; + } + + function is_immutable(value) { + if (!value) return false; + return value.is_constant() + || value instanceof AST_Lambda + || value instanceof AST_This; + } + + function mark_escaped(tw, d, scope, node, value, level, depth) { + var parent = tw.parent(level); + if (value) { + if (value.is_constant()) return; + if (value instanceof AST_ClassExpression) return; + } + if (parent instanceof AST_Assign && parent.operator == "=" && node === parent.right + || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New) + || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope + || parent instanceof AST_VarDef && node === parent.value + || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope) { + if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; + if (!d.escaped || d.escaped > depth) d.escaped = depth; + return; + } else if (parent instanceof AST_Array + || parent instanceof AST_Await + || parent instanceof AST_Binary && lazy_op(parent.operator) + || parent instanceof AST_Conditional && node !== parent.condition + || parent instanceof AST_Expansion + || parent instanceof AST_Sequence && node === parent.tail_node()) { + mark_escaped(tw, d, scope, parent, parent, level + 1, depth); + } else if (parent instanceof AST_ObjectKeyVal && node === parent.value) { + var obj = tw.parent(level + 1); + mark_escaped(tw, d, scope, obj, obj, level + 2, depth); + } else if (parent instanceof AST_PropAccess && node === parent.expression) { + value = read_property(value, parent.property); + mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); + if (value) return; + } + if (level > 0) return; + if (parent instanceof AST_Sequence && node !== parent.tail_node()) return; + if (parent instanceof AST_SimpleStatement) return; + d.direct_access = true; + } + + var suppressor = new TreeWalker(function(node) { + if (!(node instanceof AST_Symbol)) return; + var d = node.definition(); + if (!d) return; + if (node instanceof AST_SymbolRef) d.references.push(node); + d.fixed = false; + }); + def(AST_Accessor, function(tw, descend, compressor) { + push(tw); + reset_variables(tw, compressor, this); + descend(); + pop(tw); + return true; + }); + def(AST_Arrow, mark_func_expr); + def(AST_Assign, function(tw, descend, compressor) { + var node = this; + if (node.left instanceof AST_Destructuring) { + node.left.walk(suppressor); + return; + } + var sym = node.left; + if (!(sym instanceof AST_SymbolRef)) return; + var d = sym.definition(); + var safe = safe_to_assign(tw, d, sym.scope, node.right); + d.assignments++; + if (!safe) return; + var fixed = d.fixed; + if (!fixed && node.operator != "=") return; + var eq = node.operator == "="; + var value = eq ? node.right : node; + if (is_modified(compressor, tw, node, value, 0)) return; + d.references.push(sym); + if (!eq) d.chained = true; + d.fixed = eq ? function() { + return node.right; + } : function() { + return make_node(AST_Binary, node, { + operator: node.operator.slice(0, -1), + left: fixed instanceof AST_Node ? fixed : fixed(), + right: node.right + }); + }; + mark(tw, d, false); + node.right.walk(tw); + mark(tw, d, true); + mark_escaped(tw, d, sym.scope, node, value, 0, 1); + return true; + }); + def(AST_Binary, function(tw) { + if (!lazy_op(this.operator)) return; + this.left.walk(tw); + push(tw); + this.right.walk(tw); + pop(tw); + return true; + }); + def(AST_Block, function(tw, descend, compressor) { + reset_block_variables(compressor, this); + }); + def(AST_Case, function(tw) { + push(tw); + this.expression.walk(tw); + pop(tw); + push(tw); + walk_body(this, tw); + pop(tw); + return true; + }); + def(AST_ClassExpression, function(tw, descend) { + this.inlined = false; + push(tw); + descend(); + pop(tw); + return true; + }); + def(AST_Conditional, function(tw) { + this.condition.walk(tw); + push(tw); + this.consequent.walk(tw); + pop(tw); + push(tw); + this.alternative.walk(tw); + pop(tw); + return true; + }); + def(AST_Default, function(tw, descend) { + push(tw); + descend(); + pop(tw); + return true; + }); + + function mark_def_node(tw, descend, compressor) { + this.inlined = false; + var save_ids = tw.safe_ids; + tw.safe_ids = Object.create(null); + reset_variables(tw, compressor, this); + descend(); + tw.safe_ids = save_ids; + return true; + } + + def(AST_DefClass, mark_def_node); + def(AST_Defun, mark_def_node); + def(AST_Do, function(tw, descend, compressor) { + reset_block_variables(compressor, this); + var saved_loop = tw.in_loop; + tw.in_loop = this; + push(tw); + this.body.walk(tw); + if (has_break_or_continue(this)) { + pop(tw); + push(tw); + } + this.condition.walk(tw); + pop(tw); + tw.in_loop = saved_loop; + return true; + }); + def(AST_For, function(tw, descend, compressor) { + reset_block_variables(compressor, this); + if (this.init) this.init.walk(tw); + var saved_loop = tw.in_loop; + tw.in_loop = this; + push(tw); + if (this.condition) this.condition.walk(tw); + this.body.walk(tw); + if (this.step) { + if (has_break_or_continue(this)) { + pop(tw); + push(tw); + } + this.step.walk(tw); + } + pop(tw); + tw.in_loop = saved_loop; + return true; + }); + def(AST_ForIn, function(tw, descend, compressor) { + reset_block_variables(compressor, this); + this.init.walk(suppressor); + this.object.walk(tw); + var saved_loop = tw.in_loop; + tw.in_loop = this; + push(tw); + this.body.walk(tw); + pop(tw); + tw.in_loop = saved_loop; + return true; + }); + + function mark_func_expr(tw, descend, compressor) { + var node = this; + node.inlined = false; + push(tw); + reset_variables(tw, compressor, node); + var iife; + if (!node.name + && (iife = tw.parent()) instanceof AST_Call + && iife.expression === node) { + // Virtually turn IIFE parameters into variable definitions: + // (function(a,b) {...})(c,d) => (function() {var a=c,b=d; ...})() + // So existing transformation rules can work on them. + node.argnames.forEach(function(arg, i) { + if (!arg.definition) return; + var d = arg.definition(); + if (d.fixed === undefined && (!node.uses_arguments || tw.has_directive("use strict"))) { + d.fixed = function() { + return iife.args[i] || make_node(AST_Undefined, iife); + }; + tw.loop_ids[d.id] = tw.in_loop; + mark(tw, d, true); + } else { + d.fixed = false; + } + }); + } + descend(); + pop(tw); + return true; + } + + def(AST_Function, mark_func_expr); + def(AST_If, function(tw) { + this.condition.walk(tw); + push(tw); + this.body.walk(tw); + pop(tw); + if (this.alternative) { + push(tw); + this.alternative.walk(tw); + pop(tw); + } + return true; + }); + def(AST_LabeledStatement, function(tw) { + push(tw); + this.body.walk(tw); + pop(tw); + return true; + }); + def(AST_SymbolCatch, function() { + this.definition().fixed = false; + }); + def(AST_SymbolRef, function(tw, descend, compressor) { + var d = this.definition(); + d.references.push(this); + if (d.references.length == 1 + && !d.fixed + && d.orig[0] instanceof AST_SymbolDefun) { + tw.loop_ids[d.id] = tw.in_loop; + } + var value; + if (d.fixed === undefined || !safe_to_read(tw, d)) { + d.fixed = false; + } else if (d.fixed) { + value = this.fixed_value(); + if (value instanceof AST_Lambda && recursive_ref(tw, d)) { + d.recursive_refs++; + } else if (value && !compressor.exposed(d) && ref_once(tw, compressor, d)) { + d.single_use = value instanceof AST_Lambda && !value.pinned() + || value instanceof AST_Class + || d.scope === this.scope && value.is_constant_expression(); + } else { + d.single_use = false; + } + if (is_modified(compressor, tw, this, value, 0, is_immutable(value))) { + if (d.single_use) { + d.single_use = "m"; + } else { + d.fixed = false; + } + } + } + mark_escaped(tw, d, this.scope, this, value, 0, 1); + }); + def(AST_Toplevel, function(tw, descend, compressor) { + this.globals.each(function(def) { + reset_def(compressor, def); + }); + reset_variables(tw, compressor, this); + }); + def(AST_Try, function(tw, descend, compressor) { + reset_block_variables(compressor, this); + push(tw); + walk_body(this, tw); + pop(tw); + if (this.bcatch) { + push(tw); + this.bcatch.walk(tw); + pop(tw); + } + if (this.bfinally) this.bfinally.walk(tw); + return true; + }); + def(AST_Unary, function(tw, descend) { + var node = this; + if (node.operator != "++" && node.operator != "--") return; + var exp = node.expression; + if (!(exp instanceof AST_SymbolRef)) return; + var d = exp.definition(); + var safe = safe_to_assign(tw, d, true); + d.assignments++; + if (!safe) return; + var fixed = d.fixed; + if (!fixed) return; + d.references.push(exp); + d.chained = true; + d.fixed = function() { + return make_node(AST_Binary, node, { + operator: node.operator.slice(0, -1), + left: make_node(AST_UnaryPrefix, node, { + operator: "+", + expression: fixed instanceof AST_Node ? fixed : fixed() + }), + right: make_node(AST_Number, node, { + value: 1 + }) + }); + }; + mark(tw, d, true); + return true; + }); + def(AST_VarDef, function(tw, descend) { + var node = this; + if (node.name instanceof AST_Destructuring) { + node.name.walk(suppressor); + return; + } + var d = node.name.definition(); + if (node.value) { + if (safe_to_assign(tw, d, node.value)) { + d.fixed = function() { + return node.value; + }; + tw.loop_ids[d.id] = tw.in_loop; + mark(tw, d, false); + descend(); + mark(tw, d, true); + return true; + } else { + d.fixed = false; + } + } + }); + def(AST_While, function(tw, descend, compressor) { + reset_block_variables(compressor, this); + var saved_loop = tw.in_loop; + tw.in_loop = this; + push(tw); + descend(); + pop(tw); + tw.in_loop = saved_loop; + return true; + }); + })(function(node, func) { + node.DEFMETHOD("reduce_vars", func); + }); + + AST_Toplevel.DEFMETHOD("reset_opt_flags", function(compressor) { + var self = this; + var reduce_vars = compressor.option("reduce_vars"); + var tw = new TreeWalker(function(node, descend) { + node._squeezed = false; + node._optimized = false; + if (reduce_vars) { + if (compressor.top_retain) { + if (tw.parent() === self) + node._top = true; + else + delete node._top; + } + return node.reduce_vars(tw, descend, compressor); + } + }); + // Stack of look-up tables to keep track of whether a `SymbolDef` has been + // properly assigned before use: + // - `push()` & `pop()` when visiting conditional branches + // - backup & restore via `save_ids` when visiting out-of-order sections + tw.safe_ids = Object.create(null); + tw.in_loop = null; + tw.loop_ids = Object.create(null); + self.walk(tw); + }); + + AST_Symbol.DEFMETHOD("fixed_value", function() { + var fixed = this.definition().fixed; + if (!fixed || fixed instanceof AST_Node) return fixed; + return fixed(); + }); + + AST_SymbolRef.DEFMETHOD("is_immutable", function() { + var orig = this.definition().orig; + return orig.length == 1 && orig[0] instanceof AST_SymbolLambda; + }); + + function is_func_expr(node) { + return node instanceof AST_Arrow || node instanceof AST_Function; + } + + function is_lhs_read_only(lhs) { + if (lhs instanceof AST_This) return true; + if (lhs instanceof AST_SymbolRef) return lhs.definition().orig[0] instanceof AST_SymbolLambda; + if (lhs instanceof AST_PropAccess) { + lhs = lhs.expression; + if (lhs instanceof AST_SymbolRef) { + if (lhs.is_immutable()) return false; + lhs = lhs.fixed_value(); + } + if (!lhs) return true; + if (lhs instanceof AST_RegExp) return false; + if (lhs instanceof AST_Constant) return true; + return is_lhs_read_only(lhs); + } + return false; + } + + function is_ref_of(ref, type) { + if (!(ref instanceof AST_SymbolRef)) return false; + var orig = ref.definition().orig; + for (var i = orig.length; --i >= 0;) { + if (orig[i] instanceof type) return true; + } + } + + function find_variable(compressor, name) { + var scope, i = 0; + while (scope = compressor.parent(i++)) { + if (scope instanceof AST_Scope) break; + if (scope instanceof AST_Catch && scope.argname) { + scope = scope.argname.definition().scope; + break; + } + } + return scope.find_variable(name); + } + + function make_node(ctor, orig, props) { + if (!props) props = {}; + if (orig) { + if (!props.start) props.start = orig.start; + if (!props.end) props.end = orig.end; + } + return new ctor(props); + } + + function make_sequence(orig, expressions) { + if (expressions.length == 1) return expressions[0]; + return make_node(AST_Sequence, orig, { + expressions: expressions.reduce(merge_sequence, []) + }); + } + + function make_node_from_constant(val, orig) { + switch (typeof val) { + case "string": + return make_node(AST_String, orig, { + value: val + }); + case "number": + if (isNaN(val)) return make_node(AST_NaN, orig); + if (isFinite(val)) { + return 1 / val < 0 ? make_node(AST_UnaryPrefix, orig, { + operator: "-", + expression: make_node(AST_Number, orig, { value: -val }) + }) : make_node(AST_Number, orig, { value: val }); + } + return val < 0 ? make_node(AST_UnaryPrefix, orig, { + operator: "-", + expression: make_node(AST_Infinity, orig) + }) : make_node(AST_Infinity, orig); + case "boolean": + return make_node(val ? AST_True : AST_False, orig); + case "undefined": + return make_node(AST_Undefined, orig); + default: + if (val === null) { + return make_node(AST_Null, orig, { value: null }); + } + if (val instanceof RegExp) { + return make_node(AST_RegExp, orig, { value: val }); + } + throw new Error(string_template("Can't handle constant of type: {type}", { + type: typeof val + })); + } + } + + // we shouldn't compress (1,func)(something) to + // func(something) because that changes the meaning of + // the func (becomes lexical instead of global). + function maintain_this_binding(parent, orig, val) { + if (parent instanceof AST_UnaryPrefix && parent.operator == "delete" + || parent instanceof AST_Call && parent.expression === orig + && (val instanceof AST_PropAccess || val instanceof AST_SymbolRef && val.name == "eval")) { + return make_sequence(orig, [ make_node(AST_Number, orig, { value: 0 }), val ]); + } + return val; + } + + function merge_sequence(array, node) { + if (node instanceof AST_Sequence) { + array.push.apply(array, node.expressions); + } else { + array.push(node); + } + return array; + } + + function as_statement_array(thing) { + if (thing === null) return []; + if (thing instanceof AST_BlockStatement) return thing.body; + if (thing instanceof AST_EmptyStatement) return []; + if (thing instanceof AST_Statement) return [ thing ]; + throw new Error("Can't convert thing to statement array"); + } + + function is_empty(thing) { + if (thing === null) return true; + if (thing instanceof AST_EmptyStatement) return true; + if (thing instanceof AST_BlockStatement) return thing.body.length == 0; + return false; + } + + function can_be_evicted_from_block(node) { + return !( + node instanceof AST_DefClass || + node instanceof AST_Defun || + node instanceof AST_Let || + node instanceof AST_Const || + node instanceof AST_Export || + node instanceof AST_Import + ); + } + + function loop_body(x) { + if (x instanceof AST_IterationStatement) { + return x.body instanceof AST_BlockStatement ? x.body : x; + } + return x; + } + + function is_iife_call(node) { + if (node.TYPE != "Call") return false; + return node.expression instanceof AST_Function || is_iife_call(node.expression); + } + + function is_undeclared_ref(node) { + return node instanceof AST_SymbolRef && node.definition().undeclared; + } + + var global_names = makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError"); + AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) { + return !this.definition().undeclared + || compressor.option("unsafe") && global_names(this.name); + }); + + var identifier_atom = makePredicate("Infinity NaN undefined"); + function is_identifier_atom(node) { + return node instanceof AST_Infinity + || node instanceof AST_NaN + || node instanceof AST_Undefined; + } + + function tighten_body(statements, compressor) { + var in_loop, in_try; + var scope = compressor.find_parent(AST_Scope).get_defun_scope(); + find_loop_scope_try(); + var CHANGED, max_iter = 10; + do { + CHANGED = false; + eliminate_spurious_blocks(statements); + if (compressor.option("dead_code")) { + eliminate_dead_code(statements, compressor); + } + if (compressor.option("if_return")) { + handle_if_return(statements, compressor); + } + if (compressor.sequences_limit > 0) { + sequencesize(statements, compressor); + sequencesize_2(statements, compressor); + } + if (compressor.option("join_vars")) { + join_consecutive_vars(statements); + } + if (compressor.option("collapse_vars")) { + collapse(statements, compressor); + } + } while (CHANGED && max_iter-- > 0); + + function find_loop_scope_try() { + var node = compressor.self(), level = 0; + do { + if (node instanceof AST_Catch || node instanceof AST_Finally) { + level++; + } else if (node instanceof AST_IterationStatement) { + in_loop = true; + } else if (node instanceof AST_Scope) { + scope = node; + break; + } else if (node instanceof AST_Try) { + in_try = true; + } + } while (node = compressor.parent(level++)); + } + + // Search from right to left for assignment-like expressions: + // - `var a = x;` + // - `a = x;` + // - `++a` + // For each candidate, scan from left to right for first usage, then try + // to fold assignment into the site for compression. + // Will not attempt to collapse assignments into or past code blocks + // which are not sequentially executed, e.g. loops and conditionals. + function collapse(statements, compressor) { + if (scope.pinned()) return statements; + var args; + var candidates = []; + var stat_index = statements.length; + var scanner = new TreeTransformer(function(node, descend) { + if (abort) return node; + // Skip nodes before `candidate` as quickly as possible + if (!hit) { + if (node !== hit_stack[hit_index]) return node; + hit_index++; + if (hit_index < hit_stack.length) return handle_custom_scan_order(node); + hit = true; + stop_after = find_stop(node, 0); + if (stop_after === node) abort = true; + return node; + } + // Stop immediately if these node types are encountered + var parent = scanner.parent(); + if (node instanceof AST_Assign && node.operator != "=" && lhs.equivalent_to(node.left) + || node instanceof AST_Await + || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression) + || node instanceof AST_Debugger + || node instanceof AST_Destructuring + || node instanceof AST_Expansion + && node.expression instanceof AST_Symbol + && node.expression.definition().references.length > 1 + || node instanceof AST_IterationStatement && !(node instanceof AST_For) + || node instanceof AST_LoopControl + || node instanceof AST_Try + || node instanceof AST_With + || node instanceof AST_Yield + || parent instanceof AST_For && node !== parent.init + || !replace_all + && (node instanceof AST_SymbolRef && !node.is_declared(compressor))) { + abort = true; + return node; + } + // Stop only if candidate is found within conditional branches + if (!stop_if_hit && (!lhs_local || !replace_all) + && (parent instanceof AST_Binary && lazy_op(parent.operator) && parent.left !== node + || parent instanceof AST_Conditional && parent.condition !== node + || parent instanceof AST_If && parent.condition !== node)) { + stop_if_hit = parent; + } + // Replace variable with assignment when found + if (can_replace + && !(node instanceof AST_SymbolDeclaration) + && lhs.equivalent_to(node)) { + if (stop_if_hit) { + abort = true; + return node; + } + if (is_lhs(node, parent)) { + if (value_def) replaced++; + return node; + } + CHANGED = abort = true; + replaced++; + compressor.info("Collapsing {name} [{file}:{line},{col}]", { + name: node.print_to_string(), + file: node.start.file, + line: node.start.line, + col: node.start.col + }); + if (candidate instanceof AST_UnaryPostfix) { + return make_node(AST_UnaryPrefix, candidate, candidate); + } + if (candidate instanceof AST_VarDef) { + if (value_def) { + abort = false; + return node; + } + var def = candidate.name.definition(); + var value = candidate.value; + if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) { + def.replaced++; + if (funarg && is_identifier_atom(value)) { + return value.transform(compressor); + } else { + return maintain_this_binding(parent, node, value); + } + } + return make_node(AST_Assign, candidate, { + operator: "=", + left: make_node(AST_SymbolRef, candidate.name, candidate.name), + right: value + }); + } + candidate.write_only = false; + return candidate; + } + // These node types have child nodes that execute sequentially, + // but are otherwise not safe to scan into or beyond them. + var sym; + if (node instanceof AST_Call + || node instanceof AST_Exit + && (side_effects || lhs instanceof AST_PropAccess || may_modify(lhs)) + || node instanceof AST_PropAccess + && (side_effects || node.expression.may_throw_on_access(compressor)) + || node instanceof AST_SymbolRef + && (lvalues[node.name] || side_effects && may_modify(node)) + || node instanceof AST_VarDef && node.value + && (node.name.name in lvalues || side_effects && may_modify(node.name)) + || (sym = is_lhs(node.left, node)) + && (sym instanceof AST_PropAccess || sym.name in lvalues) + || may_throw + && (in_try ? node.has_side_effects(compressor) : side_effects_external(node))) { + stop_after = node; + if (node instanceof AST_Scope) abort = true; + } + return handle_custom_scan_order(node); + }, function(node) { + if (abort) return; + if (stop_after === node) abort = true; + if (stop_if_hit === node) stop_if_hit = null; + }); + var multi_replacer = new TreeTransformer(function(node) { + if (abort) return node; + // Skip nodes before `candidate` as quickly as possible + if (!hit) { + if (node !== hit_stack[hit_index]) return node; + hit_index++; + if (hit_index < hit_stack.length) return; + hit = true; + return node; + } + // Replace variable when found + if (node instanceof AST_SymbolRef + && node.name == def.name) { + if (!--replaced) abort = true; + if (is_lhs(node, multi_replacer.parent())) return node; + def.replaced++; + value_def.replaced--; + return candidate.value; + } + // Skip (non-executed) functions and (leading) default case in switch statements + if (node instanceof AST_Default || node instanceof AST_Scope) return node; + }); + while (--stat_index >= 0) { + // Treat parameters as collapsible in IIFE, i.e. + // function(a, b){ ... }(x()); + // would be translated into equivalent assignments: + // var a = x(), b = undefined; + if (stat_index == 0 && compressor.option("unused")) extract_args(); + // Find collapsible assignments + var hit_stack = []; + extract_candidates(statements[stat_index]); + while (candidates.length > 0) { + hit_stack = candidates.pop(); + var hit_index = 0; + var candidate = hit_stack[hit_stack.length - 1]; + var value_def = null; + var stop_after = null; + var stop_if_hit = null; + var lhs = get_lhs(candidate); + if (!lhs || is_lhs_read_only(lhs) || lhs.has_side_effects(compressor)) continue; + // Locate symbols which may execute code outside of scanning range + var lvalues = get_lvalues(candidate); + var lhs_local = is_lhs_local(lhs); + if (lhs instanceof AST_SymbolRef) lvalues[lhs.name] = false; + var side_effects = value_has_side_effects(candidate); + var replace_all = replace_all_symbols(); + var may_throw = candidate.may_throw(compressor); + var funarg = candidate.name instanceof AST_SymbolFunarg; + var hit = funarg; + var abort = false, replaced = 0, can_replace = !args || !hit; + if (!can_replace) { + for (var j = compressor.self().argnames.lastIndexOf(candidate.name) + 1; !abort && j < args.length; j++) { + args[j].transform(scanner); + } + can_replace = true; + } + for (var i = stat_index; !abort && i < statements.length; i++) { + statements[i].transform(scanner); + } + if (value_def) { + var def = candidate.name.definition(); + if (abort && def.references.length - def.replaced > replaced) replaced = false; + else { + abort = false; + hit_index = 0; + hit = funarg; + for (var i = stat_index; !abort && i < statements.length; i++) { + statements[i].transform(multi_replacer); + } + value_def.single_use = false; + } + } + if (replaced && !remove_candidate(candidate)) statements.splice(stat_index, 1); + } + } + + function handle_custom_scan_order(node) { + // Skip (non-executed) functions + if (node instanceof AST_Scope) return node; + // Scan case expressions first in a switch statement + if (node instanceof AST_Switch) { + node.expression = node.expression.transform(scanner); + for (var i = 0, len = node.body.length; !abort && i < len; i++) { + var branch = node.body[i]; + if (branch instanceof AST_Case) { + if (!hit) { + if (branch !== hit_stack[hit_index]) continue; + hit_index++; + } + branch.expression = branch.expression.transform(scanner); + if (!replace_all) break; + } + } + abort = true; + return node; + } + } + + function has_overlapping_symbol(fn, arg, fn_strict) { + var found = false, scan_this = !(fn instanceof AST_Arrow); + arg.walk(new TreeWalker(function(node, descend) { + if (found) return true; + if (node instanceof AST_SymbolRef && fn.variables.has(node.name)) { + var s = node.definition().scope; + if (s !== scope) while (s = s.parent_scope) { + if (s === scope) return true; + } + return found = true; + } + if ((fn_strict || scan_this) && node instanceof AST_This) { + return found = true; + } + if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) { + var prev = scan_this; + scan_this = false; + descend(); + scan_this = prev; + return true; + } + })); + return found; + } + + function extract_args() { + var iife, fn = compressor.self(); + if (is_func_expr(fn) + && !fn.name + && !fn.uses_arguments + && !fn.pinned() + && (iife = compressor.parent()) instanceof AST_Call + && iife.expression === fn + && all(iife.args, function(arg) { + return !(arg instanceof AST_Expansion); + })) { + var fn_strict = compressor.has_directive("use strict"); + if (fn_strict && !member(fn_strict, fn.body)) fn_strict = false; + var len = fn.argnames.length; + args = iife.args.slice(len); + var names = Object.create(null); + for (var i = len; --i >= 0;) { + var sym = fn.argnames[i]; + var arg = iife.args[i]; + args.unshift(make_node(AST_VarDef, sym, { + name: sym, + value: arg + })); + if (sym.name in names) continue; + names[sym.name] = true; + if (sym instanceof AST_Expansion) { + var elements = iife.args.slice(i); + if (all(elements, function(arg) { + return !has_overlapping_symbol(fn, arg, fn_strict); + })) { + candidates.unshift([ make_node(AST_VarDef, sym, { + name: sym.expression, + value: make_node(AST_Array, iife, { + elements: elements + }) + }) ]); + } + } else { + if (!arg) { + arg = make_node(AST_Undefined, sym).transform(compressor); + } else if (arg instanceof AST_Lambda && arg.pinned() + || has_overlapping_symbol(fn, arg, fn_strict)) { + arg = null; + } + if (arg) candidates.unshift([ make_node(AST_VarDef, sym, { + name: sym, + value: arg + }) ]); + } + } + } + } + + function extract_candidates(expr) { + hit_stack.push(expr); + if (expr instanceof AST_Assign) { + if (!expr.left.has_side_effects(compressor)) { + candidates.push(hit_stack.slice()); + } + extract_candidates(expr.right); + } else if (expr instanceof AST_Binary) { + extract_candidates(expr.left); + extract_candidates(expr.right); + } else if (expr instanceof AST_Call) { + extract_candidates(expr.expression); + expr.args.forEach(extract_candidates); + } else if (expr instanceof AST_Case) { + extract_candidates(expr.expression); + } else if (expr instanceof AST_Conditional) { + extract_candidates(expr.condition); + extract_candidates(expr.consequent); + extract_candidates(expr.alternative); + } else if (expr instanceof AST_Definitions + && (compressor.option("unused") || !(expr instanceof AST_Const))) { + var len = expr.definitions.length; + // limit number of trailing variable definitions for consideration + var i = len - 200; + if (i < 0) i = 0; + for (; i < len; i++) { + extract_candidates(expr.definitions[i]); + } + } else if (expr instanceof AST_DWLoop) { + extract_candidates(expr.condition); + if (!(expr.body instanceof AST_Block)) { + extract_candidates(expr.body); + } + } else if (expr instanceof AST_Exit) { + if (expr.value) extract_candidates(expr.value); + } else if (expr instanceof AST_For) { + if (expr.init) extract_candidates(expr.init); + if (expr.condition) extract_candidates(expr.condition); + if (expr.step) extract_candidates(expr.step); + if (!(expr.body instanceof AST_Block)) { + extract_candidates(expr.body); + } + } else if (expr instanceof AST_ForIn) { + extract_candidates(expr.object); + if (!(expr.body instanceof AST_Block)) { + extract_candidates(expr.body); + } + } else if (expr instanceof AST_If) { + extract_candidates(expr.condition); + if (!(expr.body instanceof AST_Block)) { + extract_candidates(expr.body); + } + if (expr.alternative && !(expr.alternative instanceof AST_Block)) { + extract_candidates(expr.alternative); + } + } else if (expr instanceof AST_Sequence) { + expr.expressions.forEach(extract_candidates); + } else if (expr instanceof AST_SimpleStatement) { + extract_candidates(expr.body); + } else if (expr instanceof AST_Switch) { + extract_candidates(expr.expression); + expr.body.forEach(extract_candidates); + } else if (expr instanceof AST_Unary) { + if (expr.operator == "++" || expr.operator == "--") { + candidates.push(hit_stack.slice()); + } + } else if (expr instanceof AST_VarDef) { + if (expr.value) { + candidates.push(hit_stack.slice()); + extract_candidates(expr.value); + } + } + hit_stack.pop(); + } + + function find_stop(node, level, write_only) { + var parent = scanner.parent(level); + if (parent instanceof AST_Assign) { + if (write_only + && !(parent.left instanceof AST_PropAccess + || parent.left.name in lvalues)) { + return find_stop(parent, level + 1, write_only); + } + return node; + } + if (parent instanceof AST_Binary) { + if (write_only && (!lazy_op(parent.operator) || parent.left === node)) { + return find_stop(parent, level + 1, write_only); + } + return node; + } + if (parent instanceof AST_Call) return node; + if (parent instanceof AST_Case) return node; + if (parent instanceof AST_Conditional) { + if (write_only && parent.condition === node) { + return find_stop(parent, level + 1, write_only); + } + return node; + } + if (parent instanceof AST_Definitions) { + return find_stop(parent, level + 1, true); + } + if (parent instanceof AST_Exit) { + return write_only ? find_stop(parent, level + 1, write_only) : node; + } + if (parent instanceof AST_If) { + if (write_only && parent.condition === node) { + return find_stop(parent, level + 1, write_only); + } + return node; + } + if (parent instanceof AST_IterationStatement) return node; + if (parent instanceof AST_Sequence) { + return find_stop(parent, level + 1, parent.tail_node() !== node); + } + if (parent instanceof AST_SimpleStatement) { + return find_stop(parent, level + 1, true); + } + if (parent instanceof AST_Switch) return node; + if (parent instanceof AST_VarDef) return node; + return null; + } + + function mangleable_var(var_def) { + var value = var_def.value; + if (!(value instanceof AST_SymbolRef)) return; + if (value.name == "arguments") return; + var def = value.definition(); + if (def.undeclared) return; + return value_def = def; + } + + function get_lhs(expr) { + if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { + var def = expr.name.definition(); + if (!member(expr.name, def.orig)) return; + var referenced = def.references.length - def.replaced; + if (!referenced) return; + var declared = def.orig.length - def.eliminated; + if (declared > 1 && !(expr.name instanceof AST_SymbolFunarg) + || (referenced > 1 ? mangleable_var(expr) : !compressor.exposed(def))) { + return make_node(AST_SymbolRef, expr.name, expr.name); + } + } else { + var lhs = expr[expr instanceof AST_Assign ? "left" : "expression"]; + return !is_ref_of(lhs, AST_SymbolConst) && lhs; + } + } + + function get_rvalue(expr) { + return expr[expr instanceof AST_Assign ? "right" : "value"]; + } + + function get_lvalues(expr) { + var lvalues = Object.create(null); + if (expr instanceof AST_Unary) return lvalues; + var tw = new TreeWalker(function(node, descend) { + var sym = node; + while (sym instanceof AST_PropAccess) sym = sym.expression; + if (sym instanceof AST_SymbolRef || sym instanceof AST_This) { + lvalues[sym.name] = lvalues[sym.name] || is_modified(compressor, tw, node, node, 0); + } + }); + get_rvalue(expr).walk(tw); + return lvalues; + } + + function remove_candidate(expr) { + if (expr.name instanceof AST_SymbolFunarg) { + var iife = compressor.parent(), argnames = compressor.self().argnames; + var index = argnames.indexOf(expr.name); + if (index < 0) { + iife.args.length = Math.min(iife.args.length, argnames.length - 1); + } else { + var args = iife.args; + if (args[index]) args[index] = make_node(AST_Number, args[index], { + value: 0 + }); + } + return true; + } + var found = false; + return statements[stat_index].transform(new TreeTransformer(function(node, descend, in_list) { + if (found) return node; + if (node === expr || node.body === expr) { + found = true; + if (node instanceof AST_VarDef) { + node.value = null; + return node; + } + return in_list ? MAP.skip : null; + } + }, function(node) { + if (node instanceof AST_Sequence) switch (node.expressions.length) { + case 0: return null; + case 1: return node.expressions[0]; + } + })); + } + + function is_lhs_local(lhs) { + while (lhs instanceof AST_PropAccess) lhs = lhs.expression; + return lhs instanceof AST_SymbolRef + && lhs.definition().scope === scope + && !(in_loop + && (lhs.name in lvalues + || candidate instanceof AST_Unary + || candidate instanceof AST_Assign && candidate.operator != "=")); + } + + function value_has_side_effects(expr) { + if (expr instanceof AST_Unary) return false; + return get_rvalue(expr).has_side_effects(compressor); + } + + function replace_all_symbols() { + if (side_effects) return false; + if (value_def) return true; + if (lhs instanceof AST_SymbolRef) { + var def = lhs.definition(); + if (def.references.length - def.replaced == (candidate instanceof AST_VarDef ? 1 : 2)) { + return true; + } + } + return false; + } + + function may_modify(sym) { + if (!sym.definition) return true; // AST_Destructuring + var def = sym.definition(); + if (def.orig.length == 1 && def.orig[0] instanceof AST_SymbolDefun) return false; + if (def.scope.get_defun_scope() !== scope) return true; + return !all(def.references, function(ref) { + var s = ref.scope.get_defun_scope(); + // "block" scope within AST_Catch + if (s.TYPE == "Scope") s = s.parent_scope; + return s === scope; + }); + } + + function side_effects_external(node, lhs) { + if (node instanceof AST_Assign) return side_effects_external(node.left, true); + if (node instanceof AST_Unary) return side_effects_external(node.expression, true); + if (node instanceof AST_VarDef) return node.value && side_effects_external(node.value); + if (lhs) { + if (node instanceof AST_Dot) return side_effects_external(node.expression, true); + if (node instanceof AST_Sub) return side_effects_external(node.expression, true); + if (node instanceof AST_SymbolRef) return node.definition().scope !== scope; + } + return false; + } + } + + function eliminate_spurious_blocks(statements) { + var seen_dirs = []; + for (var i = 0; i < statements.length;) { + var stat = statements[i]; + if (stat instanceof AST_BlockStatement && all(stat.body, can_be_evicted_from_block)) { + CHANGED = true; + eliminate_spurious_blocks(stat.body); + [].splice.apply(statements, [i, 1].concat(stat.body)); + i += stat.body.length; + } else if (stat instanceof AST_EmptyStatement) { + CHANGED = true; + statements.splice(i, 1); + } else if (stat instanceof AST_Directive) { + if (seen_dirs.indexOf(stat.value) < 0) { + i++; + seen_dirs.push(stat.value); + } else { + CHANGED = true; + statements.splice(i, 1); + } + } else i++; + } + } + + function handle_if_return(statements, compressor) { + var self = compressor.self(); + var multiple_if_returns = has_multiple_if_returns(statements); + var in_lambda = self instanceof AST_Lambda; + for (var i = statements.length; --i >= 0;) { + var stat = statements[i]; + var j = next_index(i); + var next = statements[j]; + + if (in_lambda && !next && stat instanceof AST_Return) { + if (!stat.value) { + CHANGED = true; + statements.splice(i, 1); + continue; + } + if (stat.value instanceof AST_UnaryPrefix && stat.value.operator == "void") { + CHANGED = true; + statements[i] = make_node(AST_SimpleStatement, stat, { + body: stat.value.expression + }); + continue; + } + } + + if (stat instanceof AST_If) { + var ab = aborts(stat.body); + if (can_merge_flow(ab)) { + if (ab.label) { + remove(ab.label.thedef.references, ab); + } + CHANGED = true; + stat = stat.clone(); + stat.condition = stat.condition.negate(compressor); + var body = as_statement_array_with_return(stat.body, ab); + stat.body = make_node(AST_BlockStatement, stat, { + body: as_statement_array(stat.alternative).concat(extract_functions()) + }); + stat.alternative = make_node(AST_BlockStatement, stat, { + body: body + }); + statements[i] = stat.transform(compressor); + continue; + } + + var ab = aborts(stat.alternative); + if (can_merge_flow(ab)) { + if (ab.label) { + remove(ab.label.thedef.references, ab); + } + CHANGED = true; + stat = stat.clone(); + stat.body = make_node(AST_BlockStatement, stat.body, { + body: as_statement_array(stat.body).concat(extract_functions()) + }); + var body = as_statement_array_with_return(stat.alternative, ab); + stat.alternative = make_node(AST_BlockStatement, stat.alternative, { + body: body + }); + statements[i] = stat.transform(compressor); + continue; + } + } + + if (stat instanceof AST_If && stat.body instanceof AST_Return) { + var value = stat.body.value; + //--- + // pretty silly case, but: + // if (foo()) return; return; ==> foo(); return; + if (!value && !stat.alternative + && (in_lambda && !next || next instanceof AST_Return && !next.value)) { + CHANGED = true; + statements[i] = make_node(AST_SimpleStatement, stat.condition, { + body: stat.condition + }); + continue; + } + //--- + // if (foo()) return x; return y; ==> return foo() ? x : y; + if (value && !stat.alternative && next instanceof AST_Return && next.value) { + CHANGED = true; + stat = stat.clone(); + stat.alternative = next; + statements.splice(i, 1, stat.transform(compressor)); + statements.splice(j, 1); + continue; + } + //--- + // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined; + if (value && !stat.alternative + && (!next && in_lambda && multiple_if_returns + || next instanceof AST_Return)) { + CHANGED = true; + stat = stat.clone(); + stat.alternative = next || make_node(AST_Return, stat, { + value: null + }); + statements.splice(i, 1, stat.transform(compressor)); + if (next) statements.splice(j, 1); + continue; + } + //--- + // if (a) return b; if (c) return d; e; ==> return a ? b : c ? d : void e; + // + // if sequences is not enabled, this can lead to an endless loop (issue #866). + // however, with sequences on this helps producing slightly better output for + // the example code. + var prev = statements[prev_index(i)]; + if (compressor.option("sequences") && in_lambda && !stat.alternative + && prev instanceof AST_If && prev.body instanceof AST_Return + && next_index(j) == statements.length && next instanceof AST_SimpleStatement) { + CHANGED = true; + stat = stat.clone(); + stat.alternative = make_node(AST_BlockStatement, next, { + body: [ + next, + make_node(AST_Return, next, { + value: null + }) + ] + }); + statements.splice(i, 1, stat.transform(compressor)); + statements.splice(j, 1); + continue; + } + } + } + + function has_multiple_if_returns(statements) { + var n = 0; + for (var i = statements.length; --i >= 0;) { + var stat = statements[i]; + if (stat instanceof AST_If && stat.body instanceof AST_Return) { + if (++n > 1) return true; + } + } + return false; + } + + function is_return_void(value) { + return !value || value instanceof AST_UnaryPrefix && value.operator == "void"; + } + + function can_merge_flow(ab) { + if (!ab) return false; + for (var j = i + 1, len = statements.length; j < len; j++) { + var stat = statements[j]; + if (stat instanceof AST_Const || stat instanceof AST_Let) return false; + } + var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab) : null; + return ab instanceof AST_Return && in_lambda && is_return_void(ab.value) + || ab instanceof AST_Continue && self === loop_body(lct) + || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct; + } + + function extract_functions() { + var tail = statements.slice(i + 1); + statements.length = i + 1; + return tail.filter(function(stat) { + if (stat instanceof AST_Defun) { + statements.push(stat); + return false; + } + return true; + }); + } + + function as_statement_array_with_return(node, ab) { + var body = as_statement_array(node).slice(0, -1); + if (ab.value) { + body.push(make_node(AST_SimpleStatement, ab.value, { + body: ab.value.expression + })); + } + return body; + } + + function next_index(i) { + for (var j = i + 1, len = statements.length; j < len; j++) { + var stat = statements[j]; + if (!(stat instanceof AST_Var && declarations_only(stat))) { + break; + } + } + return j; + } + + function prev_index(i) { + for (var j = i; --j >= 0;) { + var stat = statements[j]; + if (!(stat instanceof AST_Var && declarations_only(stat))) { + break; + } + } + return j; + } + } + + function eliminate_dead_code(statements, compressor) { + var has_quit; + var self = compressor.self(); + for (var i = 0, n = 0, len = statements.length; i < len; i++) { + var stat = statements[i]; + if (stat instanceof AST_LoopControl) { + var lct = compressor.loopcontrol_target(stat); + if (stat instanceof AST_Break + && !(lct instanceof AST_IterationStatement) + && loop_body(lct) === self + || stat instanceof AST_Continue + && loop_body(lct) === self) { + if (stat.label) { + remove(stat.label.thedef.references, stat); + } + } else { + statements[n++] = stat; + } + } else { + statements[n++] = stat; + } + if (aborts(stat)) { + has_quit = statements.slice(i + 1); + break; + } + } + statements.length = n; + CHANGED = n != len; + if (has_quit) has_quit.forEach(function(stat) { + extract_declarations_from_unreachable_code(compressor, stat, statements); + }); + } + + function declarations_only(node) { + return all(node.definitions, function(var_def) { + return !var_def.value; + }); + } + + function sequencesize(statements, compressor) { + if (statements.length < 2) return; + var seq = [], n = 0; + function push_seq() { + if (!seq.length) return; + var body = make_sequence(seq[0], seq); + statements[n++] = make_node(AST_SimpleStatement, body, { body: body }); + seq = []; + } + for (var i = 0, len = statements.length; i < len; i++) { + var stat = statements[i]; + if (stat instanceof AST_SimpleStatement) { + if (seq.length >= compressor.sequences_limit) push_seq(); + var body = stat.body; + if (seq.length > 0) body = body.drop_side_effect_free(compressor); + if (body) merge_sequence(seq, body); + } else if (stat instanceof AST_Definitions && declarations_only(stat) + || stat instanceof AST_Defun) { + statements[n++] = stat; + } else { + push_seq(); + statements[n++] = stat; + } + } + push_seq(); + statements.length = n; + if (n != len) CHANGED = true; + } + + function to_simple_statement(block, decls) { + if (!(block instanceof AST_BlockStatement)) return block; + var stat = null; + for (var i = 0, len = block.body.length; i < len; i++) { + var line = block.body[i]; + if (line instanceof AST_Var && declarations_only(line)) { + decls.push(line); + } else if (stat) { + return false; + } else { + stat = line; + } + } + return stat; + } + + function sequencesize_2(statements, compressor) { + function cons_seq(right) { + n--; + CHANGED = true; + var left = prev.body; + return make_sequence(left, [ left, right ]).transform(compressor); + } + var n = 0, prev; + for (var i = 0; i < statements.length; i++) { + var stat = statements[i]; + if (prev) { + if (stat instanceof AST_Exit) { + stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor)); + } else if (stat instanceof AST_For) { + if (!(stat.init instanceof AST_Definitions)) { + var abort = false; + prev.body.walk(new TreeWalker(function(node) { + if (abort || node instanceof AST_Scope) return true; + if (node instanceof AST_Binary && node.operator == "in") { + abort = true; + return true; + } + })); + if (!abort) { + if (stat.init) stat.init = cons_seq(stat.init); + else { + stat.init = prev.body; + n--; + CHANGED = true; + } + } + } + } else if (stat instanceof AST_ForIn) { + if (!(stat.init instanceof AST_Const) && !(stat.init instanceof AST_Let)) { + stat.object = cons_seq(stat.object); + } + } else if (stat instanceof AST_If) { + stat.condition = cons_seq(stat.condition); + } else if (stat instanceof AST_Switch) { + stat.expression = cons_seq(stat.expression); + } else if (stat instanceof AST_With) { + stat.expression = cons_seq(stat.expression); + } + } + if (compressor.option("conditionals") && stat instanceof AST_If) { + var decls = []; + var body = to_simple_statement(stat.body, decls); + var alt = to_simple_statement(stat.alternative, decls); + if (body !== false && alt !== false && decls.length > 0) { + var len = decls.length; + decls.push(make_node(AST_If, stat, { + condition: stat.condition, + body: body || make_node(AST_EmptyStatement, stat.body), + alternative: alt + })); + decls.unshift(n, 1); + [].splice.apply(statements, decls); + i += len; + n += len + 1; + prev = null; + CHANGED = true; + continue; + } + } + statements[n++] = stat; + prev = stat instanceof AST_SimpleStatement ? stat : null; + } + statements.length = n; + } + + function join_object_assignments(defn, body) { + if (!(defn instanceof AST_Definitions)) return; + var def = defn.definitions[defn.definitions.length - 1]; + if (!(def.value instanceof AST_Object)) return; + var exprs; + if (body instanceof AST_Assign) { + exprs = [ body ]; + } else if (body instanceof AST_Sequence) { + exprs = body.expressions.slice(); + } + if (!exprs) return; + var trimmed = false; + do { + var node = exprs[0]; + if (!(node instanceof AST_Assign)) break; + if (node.operator != "=") break; + if (!(node.left instanceof AST_PropAccess)) break; + var sym = node.left.expression; + if (!(sym instanceof AST_SymbolRef)) break; + if (def.name.name != sym.name) break; + if (!node.right.is_constant_expression(scope)) break; + var prop = node.left.property; + if (prop instanceof AST_Node) { + prop = prop.evaluate(compressor); + } + if (prop instanceof AST_Node) break; + prop = "" + prop; + var diff = compressor.option("ecma") < 6 + && compressor.has_directive("use strict") ? function(node) { + return node.key != prop && node.key.name != prop; + } : function(node) { + return node.key.name != prop; + }; + if (!all(def.value.properties, diff)) break; + var p = def.value.properties.filter(function (p) { return p.key === prop; })[0]; + if (!p) { + def.value.properties.push(make_node(AST_ObjectKeyVal, node, { + key: prop, + value: node.right + })); + } else { + p.value = new AST_Sequence({ + start: p.start, + expressions: [p.value.clone(), node.right.clone()], + end: p.end + }); + } + exprs.shift(); + trimmed = true; + } while (exprs.length); + return trimmed && exprs; + } + + function join_consecutive_vars(statements) { + var defs; + for (var i = 0, j = -1, len = statements.length; i < len; i++) { + var stat = statements[i]; + var prev = statements[j]; + if (stat instanceof AST_Definitions) { + if (prev && prev.TYPE == stat.TYPE) { + prev.definitions = prev.definitions.concat(stat.definitions); + CHANGED = true; + } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) { + defs.definitions = defs.definitions.concat(stat.definitions); + CHANGED = true; + } else { + statements[++j] = stat; + defs = stat; + } + } else if (stat instanceof AST_Exit) { + stat.value = extract_object_assignments(stat.value); + } else if (stat instanceof AST_For) { + var exprs = join_object_assignments(prev, stat.init); + if (exprs) { + CHANGED = true; + stat.init = exprs.length ? make_sequence(stat.init, exprs) : null; + statements[++j] = stat; + } else if (prev instanceof AST_Var && (!stat.init || stat.init.TYPE == prev.TYPE)) { + if (stat.init) { + prev.definitions = prev.definitions.concat(stat.init.definitions); + } + stat.init = prev; + statements[j] = stat; + CHANGED = true; + } else if (defs && stat.init && defs.TYPE == stat.init.TYPE && declarations_only(stat.init)) { + defs.definitions = defs.definitions.concat(stat.init.definitions); + stat.init = null; + statements[++j] = stat; + CHANGED = true; + } else { + statements[++j] = stat; + } + } else if (stat instanceof AST_ForIn) { + stat.object = extract_object_assignments(stat.object); + } else if (stat instanceof AST_If) { + stat.condition = extract_object_assignments(stat.condition); + } else if (stat instanceof AST_SimpleStatement) { + var exprs = join_object_assignments(prev, stat.body); + if (exprs) { + CHANGED = true; + if (!exprs.length) continue; + stat.body = make_sequence(stat.body, exprs); + } + statements[++j] = stat; + } else if (stat instanceof AST_Switch) { + stat.expression = extract_object_assignments(stat.expression); + } else if (stat instanceof AST_With) { + stat.expression = extract_object_assignments(stat.expression); + } else { + statements[++j] = stat; + } + } + statements.length = j + 1; + + function extract_object_assignments(value) { + statements[++j] = stat; + var exprs = join_object_assignments(prev, value); + if (exprs) { + CHANGED = true; + if (exprs.length) { + return make_sequence(value, exprs); + } else if (value instanceof AST_Sequence) { + return value.tail_node().left; + } else { + return value.left; + } + } + return value; + } + } + } + + function extract_declarations_from_unreachable_code(compressor, stat, target) { + if (!(stat instanceof AST_Defun)) { + compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start); + } + stat.walk(new TreeWalker(function(node) { + if (node instanceof AST_Var) { + compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start); + node.remove_initializers(); + target.push(node); + return true; + } + if (node instanceof AST_Defun && (node === stat || !compressor.has_directive("use strict"))) { + target.push(node === stat ? node : make_node(AST_Var, node, { + definitions: [ + make_node(AST_VarDef, node, { + name: make_node(AST_SymbolVar, node.name, node.name), + value: null + }) + ] + })); + return true; + } + if (node instanceof AST_Scope) { + return true; + } + })); + } + + function get_value(key) { + if (key instanceof AST_Constant) { + return key.getValue(); + } + if (key instanceof AST_UnaryPrefix + && key.operator == "void" + && key.expression instanceof AST_Constant) { + return; + } + return key; + } + + function is_undefined(node, compressor) { + return node.is_undefined + || node instanceof AST_Undefined + || node instanceof AST_UnaryPrefix + && node.operator == "void" + && !node.expression.has_side_effects(compressor); + } + + // may_throw_on_access() + // returns true if this node may be null, undefined or contain `AST_Accessor` + (function(def) { + AST_Node.DEFMETHOD("may_throw_on_access", function(compressor) { + return !compressor.option("pure_getters") + || this._dot_throw(compressor); + }); + + function is_strict(compressor) { + return /strict/.test(compressor.option("pure_getters")); + } + + def(AST_Node, is_strict); + def(AST_Null, return_true); + def(AST_Undefined, return_true); + def(AST_Constant, return_false); + def(AST_Array, return_false); + def(AST_Object, function(compressor) { + if (!is_strict(compressor)) return false; + for (var i = this.properties.length; --i >=0;) + if (this.properties[i]._dot_throw(compressor)) return true; + return false; + }); + def(AST_ObjectProperty, return_false); + def(AST_ObjectGetter, return_true); + def(AST_Expansion, function(compressor) { + return this.expression._dot_throw(compressor); + }); + def(AST_Function, return_false); + def(AST_Arrow, return_false); + def(AST_UnaryPostfix, return_false); + def(AST_UnaryPrefix, function() { + return this.operator == "void"; + }); + def(AST_Binary, function(compressor) { + return (this.operator == "&&" || this.operator == "||") + && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); + }); + def(AST_Assign, function(compressor) { + return this.operator == "=" + && this.right._dot_throw(compressor); + }); + def(AST_Conditional, function(compressor) { + return this.consequent._dot_throw(compressor) + || this.alternative._dot_throw(compressor); + }); + def(AST_Dot, function(compressor) { + if (!is_strict(compressor)) return false; + if (this.expression instanceof AST_Function && this.property == "prototype") return false; + return true; + }); + def(AST_Sequence, function(compressor) { + return this.tail_node()._dot_throw(compressor); + }); + def(AST_SymbolRef, function(compressor) { + if (this.is_undefined) return true; + if (!is_strict(compressor)) return false; + if (is_undeclared_ref(this) && this.is_declared(compressor)) return false; + if (this.is_immutable()) return false; + var fixed = this.fixed_value(); + return !fixed || fixed._dot_throw(compressor); + }); + })(function(node, func) { + node.DEFMETHOD("_dot_throw", func); + }); + + /* -----[ boolean/negation helpers ]----- */ + + // methods to determine whether an expression has a boolean result type + (function(def) { + var unary_bool = [ "!", "delete" ]; + var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ]; + def(AST_Node, return_false); + def(AST_UnaryPrefix, function() { + return member(this.operator, unary_bool); + }); + def(AST_Binary, function() { + return member(this.operator, binary_bool) + || lazy_op(this.operator) + && this.left.is_boolean() + && this.right.is_boolean(); + }); + def(AST_Conditional, function() { + return this.consequent.is_boolean() && this.alternative.is_boolean(); + }); + def(AST_Assign, function() { + return this.operator == "=" && this.right.is_boolean(); + }); + def(AST_Sequence, function() { + return this.tail_node().is_boolean(); + }); + def(AST_True, return_true); + def(AST_False, return_true); + })(function(node, func) { + node.DEFMETHOD("is_boolean", func); + }); + + // methods to determine if an expression has a numeric result type + (function(def) { + def(AST_Node, return_false); + def(AST_Number, return_true); + var unary = makePredicate("+ - ~ ++ --"); + def(AST_Unary, function() { + return unary(this.operator); + }); + var binary = makePredicate("- * / % & | ^ << >> >>>"); + def(AST_Binary, function(compressor) { + return binary(this.operator) || this.operator == "+" + && this.left.is_number(compressor) + && this.right.is_number(compressor); + }); + def(AST_Assign, function(compressor) { + return binary(this.operator.slice(0, -1)) + || this.operator == "=" && this.right.is_number(compressor); + }); + def(AST_Sequence, function(compressor) { + return this.tail_node().is_number(compressor); + }); + def(AST_Conditional, function(compressor) { + return this.consequent.is_number(compressor) && this.alternative.is_number(compressor); + }); + })(function(node, func) { + node.DEFMETHOD("is_number", func); + }); + + // methods to determine if an expression has a string result type + (function(def) { + def(AST_Node, return_false); + def(AST_String, return_true); + def(AST_TemplateString, function() { + return this.segments.length === 1; + }); + def(AST_UnaryPrefix, function() { + return this.operator == "typeof"; + }); + def(AST_Binary, function(compressor) { + return this.operator == "+" && + (this.left.is_string(compressor) || this.right.is_string(compressor)); + }); + def(AST_Assign, function(compressor) { + return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor); + }); + def(AST_Sequence, function(compressor) { + return this.tail_node().is_string(compressor); + }); + def(AST_Conditional, function(compressor) { + return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); + }); + })(function(node, func) { + node.DEFMETHOD("is_string", func); + }); + + var lazy_op = makePredicate("&& ||"); + var unary_side_effects = makePredicate("delete ++ --"); + + function is_lhs(node, parent) { + if (parent instanceof AST_Unary && unary_side_effects(parent.operator)) return parent.expression; + if (parent instanceof AST_Assign && parent.left === node) return node; + } + + (function(def) { + function to_node(value, orig) { + if (value instanceof AST_Node) return make_node(value.CTOR, orig, value); + if (Array.isArray(value)) return make_node(AST_Array, orig, { + elements: value.map(function(value) { + return to_node(value, orig); + }) + }); + if (value && typeof value == "object") { + var props = []; + for (var key in value) if (HOP(value, key)) { + props.push(make_node(AST_ObjectKeyVal, orig, { + key: key, + value: to_node(value[key], orig) + })); + } + return make_node(AST_Object, orig, { + properties: props + }); + } + return make_node_from_constant(value, orig); + } + + function warn(compressor, node) { + compressor.warn("global_defs " + node.print_to_string() + " redefined [{file}:{line},{col}]", node.start); + } + + AST_Toplevel.DEFMETHOD("resolve_defines", function(compressor) { + if (!compressor.option("global_defs")) return this; + this.figure_out_scope({ ie8: compressor.option("ie8") }); + return this.transform(new TreeTransformer(function(node) { + var def = node._find_defs(compressor, ""); + if (!def) return; + var level = 0, child = node, parent; + while (parent = this.parent(level++)) { + if (!(parent instanceof AST_PropAccess)) break; + if (parent.expression !== child) break; + child = parent; + } + if (is_lhs(child, parent)) { + warn(compressor, node); + return; + } + return def; + })); + }); + def(AST_Node, noop); + def(AST_Dot, function(compressor, suffix) { + return this.expression._find_defs(compressor, "." + this.property + suffix); + }); + def(AST_SymbolDeclaration, function(compressor) { + if (!this.global()) return; + if (HOP(compressor.option("global_defs"), this.name)) warn(compressor, this); + }); + def(AST_SymbolRef, function(compressor, suffix) { + if (!this.global()) return; + var defines = compressor.option("global_defs"); + var name = this.name + suffix; + if (HOP(defines, name)) return to_node(defines[name], this); + }); + })(function(node, func) { + node.DEFMETHOD("_find_defs", func); + }); + + function best_of_expression(ast1, ast2) { + return ast1.print_to_string().length > + ast2.print_to_string().length + ? ast2 : ast1; + } + + function best_of_statement(ast1, ast2) { + return best_of_expression(make_node(AST_SimpleStatement, ast1, { + body: ast1 + }), make_node(AST_SimpleStatement, ast2, { + body: ast2 + })).body; + } + + function best_of(compressor, ast1, ast2) { + return (first_in_statement(compressor) ? best_of_statement : best_of_expression)(ast1, ast2); + } + + function convert_to_predicate(obj) { + for (var key in obj) { + obj[key] = makePredicate(obj[key]); + } + } + + var object_fns = [ + "constructor", + "toString", + "valueOf", + ]; + var native_fns = { + Array: [ + "indexOf", + "join", + "lastIndexOf", + "slice", + ].concat(object_fns), + Boolean: object_fns, + Function: object_fns, + Number: [ + "toExponential", + "toFixed", + "toPrecision", + ].concat(object_fns), + Object: object_fns, + RegExp: [ + "test", + ].concat(object_fns), + String: [ + "charAt", + "charCodeAt", + "concat", + "indexOf", + "italics", + "lastIndexOf", + "match", + "replace", + "search", + "slice", + "split", + "substr", + "substring", + "toLowerCase", + "toUpperCase", + "trim", + ].concat(object_fns), + }; + convert_to_predicate(native_fns); + var static_fns = { + Array: [ + "isArray", + ], + Math: [ + "abs", + "acos", + "asin", + "atan", + "ceil", + "cos", + "exp", + "floor", + "log", + "round", + "sin", + "sqrt", + "tan", + "atan2", + "pow", + "max", + "min", + ], + Number: [ + "isFinite", + "isNaN", + ], + Object: [ + "create", + "getOwnPropertyDescriptor", + "getOwnPropertyNames", + "getPrototypeOf", + "isExtensible", + "isFrozen", + "isSealed", + "keys", + ], + String: [ + "fromCharCode", + ], + }; + convert_to_predicate(static_fns); + + // methods to evaluate a constant expression + (function(def) { + // If the node has been successfully reduced to a constant, + // then its value is returned; otherwise the element itself + // is returned. + // They can be distinguished as constant value is never a + // descendant of AST_Node. + AST_Node.DEFMETHOD("evaluate", function(compressor) { + if (!compressor.option("evaluate")) return this; + var val = this._eval(compressor, 1); + if (!val || val instanceof RegExp) return val; + if (typeof val == "function" || typeof val == "object") return this; + return val; + }); + var unaryPrefix = makePredicate("! ~ - + void"); + AST_Node.DEFMETHOD("is_constant", function() { + // Accomodate when compress option evaluate=false + // as well as the common constant expressions !0 and -1 + if (this instanceof AST_Constant) { + return !(this instanceof AST_RegExp); + } else { + return this instanceof AST_UnaryPrefix + && this.expression instanceof AST_Constant + && unaryPrefix(this.operator); + } + }); + def(AST_Statement, function() { + throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start)); + }); + def(AST_Lambda, return_this); + def(AST_Class, return_this); + def(AST_Node, return_this); + def(AST_Constant, function() { + return this.getValue(); + }); + def(AST_TemplateString, function() { + if (this.segments.length !== 1) return this; + return this.segments[0].value; + }); + def(AST_Function, function(compressor) { + if (compressor.option("unsafe")) { + var fn = function() {}; + fn.node = this; + fn.toString = function() { + return this.node.print_to_string(); + }; + return fn; + } + return this; + }); + def(AST_Array, function(compressor, depth) { + if (compressor.option("unsafe")) { + var elements = []; + for (var i = 0, len = this.elements.length; i < len; i++) { + var element = this.elements[i]; + var value = element._eval(compressor, depth); + if (element === value) return this; + elements.push(value); + } + return elements; + } + return this; + }); + def(AST_Object, function(compressor, depth) { + if (compressor.option("unsafe")) { + var val = {}; + for (var i = 0, len = this.properties.length; i < len; i++) { + var prop = this.properties[i]; + if (prop instanceof AST_Expansion) return this; + var key = prop.key; + if (key instanceof AST_Symbol) { + key = key.name; + } else if (key instanceof AST_Node) { + key = key._eval(compressor, depth); + if (key === prop.key) return this; + } + if (typeof Object.prototype[key] === "function") { + return this; + } + if (prop.value instanceof AST_Function) continue; + val[key] = prop.value._eval(compressor, depth); + if (val[key] === prop.value) return this; + } + return val; + } + return this; + }); + var non_converting_unary = makePredicate("! typeof void"); + def(AST_UnaryPrefix, function(compressor, depth) { + var e = this.expression; + // Function would be evaluated to an array and so typeof would + // incorrectly return 'object'. Hence making is a special case. + if (compressor.option("typeofs") + && this.operator == "typeof" + && (e instanceof AST_Lambda + || e instanceof AST_SymbolRef + && e.fixed_value() instanceof AST_Lambda)) { + return typeof function() {}; + } + if (!non_converting_unary(this.operator)) depth++; + e = e._eval(compressor, depth); + if (e === this.expression) return this; + switch (this.operator) { + case "!": return !e; + case "typeof": + // typeof returns "object" or "function" on different platforms + // so cannot evaluate reliably + if (e instanceof RegExp) return this; + return typeof e; + case "void": return void e; + case "~": return ~e; + case "-": return -e; + case "+": return +e; + } + return this; + }); + var non_converting_binary = makePredicate("&& || === !=="); + def(AST_Binary, function(compressor, depth) { + if (!non_converting_binary(this.operator)) depth++; + var left = this.left._eval(compressor, depth); + if (left === this.left) return this; + var right = this.right._eval(compressor, depth); + if (right === this.right) return this; + var result; + switch (this.operator) { + case "&&" : result = left && right; break; + case "||" : result = left || right; break; + case "|" : result = left | right; break; + case "&" : result = left & right; break; + case "^" : result = left ^ right; break; + case "+" : result = left + right; break; + case "*" : result = left * right; break; + case "**" : result = Math.pow(left, right); break; + case "/" : result = left / right; break; + case "%" : result = left % right; break; + case "-" : result = left - right; break; + case "<<" : result = left << right; break; + case ">>" : result = left >> right; break; + case ">>>" : result = left >>> right; break; + case "==" : result = left == right; break; + case "===" : result = left === right; break; + case "!=" : result = left != right; break; + case "!==" : result = left !== right; break; + case "<" : result = left < right; break; + case "<=" : result = left <= right; break; + case ">" : result = left > right; break; + case ">=" : result = left >= right; break; + default: + return this; + } + if (isNaN(result) && compressor.find_parent(AST_With)) { + // leave original expression as is + return this; + } + return result; + }); + def(AST_Conditional, function(compressor, depth) { + var condition = this.condition._eval(compressor, depth); + if (condition === this.condition) return this; + var node = condition ? this.consequent : this.alternative; + var value = node._eval(compressor, depth); + return value === node ? this : value; + }); + def(AST_SymbolRef, function(compressor, depth) { + var fixed = this.fixed_value(); + if (!fixed) return this; + var value; + if (HOP(fixed, "_eval")) { + value = fixed._eval(); + } else { + this._eval = return_this; + value = fixed._eval(compressor, depth); + delete this._eval; + if (value === fixed) return this; + fixed._eval = function() { + return value; + }; + } + if (value && typeof value == "object") { + var escaped = this.definition().escaped; + if (escaped && depth > escaped) return this; + } + return value; + }); + var global_objs = { + Array: Array, + Math: Math, + Number: Number, + Object: Object, + String: String, + }; + var static_values = { + Math: [ + "E", + "LN10", + "LN2", + "LOG2E", + "LOG10E", + "PI", + "SQRT1_2", + "SQRT2", + ], + Number: [ + "MAX_VALUE", + "MIN_VALUE", + "NaN", + "NEGATIVE_INFINITY", + "POSITIVE_INFINITY", + ], + }; + convert_to_predicate(static_values); + def(AST_PropAccess, function(compressor, depth) { + if (compressor.option("unsafe")) { + var key = this.property; + if (key instanceof AST_Node) { + key = key._eval(compressor, depth); + if (key === this.property) return this; + } + var exp = this.expression; + var val; + if (is_undeclared_ref(exp)) { + + var aa; + var first_arg = exp.name === "hasOwnProperty" + && key === "call" + && (aa = compressor.parent() && compressor.parent().args) + && (aa && aa[0] + && aa[0].evaluate(compressor)); + if (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) { + return this.clone(); + } + if (!(static_values[exp.name] || return_false)(key)) return this; + val = global_objs[exp.name]; + } else { + val = exp._eval(compressor, depth + 1); + if (!val || val === exp || !HOP(val, key)) return this; + if (typeof val == "function") switch (key) { + case "name": + return val.node.name ? val.node.name.name : ""; + case "length": + return val.node.argnames.length; + default: + return this; + } + } + return val[key]; + } + return this; + }); + def(AST_Call, function(compressor, depth) { + var exp = this.expression; + if (compressor.option("unsafe") && exp instanceof AST_PropAccess) { + var key = exp.property; + if (key instanceof AST_Node) { + key = key._eval(compressor, depth); + if (key === exp.property) return this; + } + var val; + var e = exp.expression; + if (is_undeclared_ref(e)) { + var first_arg = + e.name === "hasOwnProperty" && + key === "call" && + (this.args[0] && this.args[0].evaluate(compressor)); + if ((first_arg == null || first_arg.thedef && first_arg.thedef.undeclared)) { + return this.clone(); + } + if (!(static_fns[e.name] || return_false)(key)) return this; + val = global_objs[e.name]; + } else { + val = e._eval(compressor, depth + 1); + if (val === e || !(val && native_fns[val.constructor.name] || return_false)(key)) return this; + } + var args = []; + for (var i = 0, len = this.args.length; i < len; i++) { + var arg = this.args[i]; + var value = arg._eval(compressor, depth); + if (arg === value) return this; + args.push(value); + } + try { + return val[key].apply(val, args); + } catch (ex) { + compressor.warn("Error evaluating {code} [{file}:{line},{col}]", { + code: this.print_to_string(), + file: this.start.file, + line: this.start.line, + col: this.start.col + }); + } + } + return this; + }); + def(AST_New, return_this); + })(function(node, func) { + node.DEFMETHOD("_eval", func); + }); + + // method to negate an expression + (function(def) { + function basic_negation(exp) { + return make_node(AST_UnaryPrefix, exp, { + operator: "!", + expression: exp + }); + } + function best(orig, alt, first_in_statement) { + var negated = basic_negation(orig); + if (first_in_statement) { + var stat = make_node(AST_SimpleStatement, alt, { + body: alt + }); + return best_of_expression(negated, stat) === stat ? alt : negated; + } + return best_of_expression(negated, alt); + } + def(AST_Node, function() { + return basic_negation(this); + }); + def(AST_Statement, function() { + throw new Error("Cannot negate a statement"); + }); + def(AST_Function, function() { + return basic_negation(this); + }); + def(AST_Arrow, function() { + return basic_negation(this); + }); + def(AST_UnaryPrefix, function() { + if (this.operator == "!") + return this.expression; + return basic_negation(this); + }); + def(AST_Sequence, function(compressor) { + var expressions = this.expressions.slice(); + expressions.push(expressions.pop().negate(compressor)); + return make_sequence(this, expressions); + }); + def(AST_Conditional, function(compressor, first_in_statement) { + var self = this.clone(); + self.consequent = self.consequent.negate(compressor); + self.alternative = self.alternative.negate(compressor); + return best(this, self, first_in_statement); + }); + def(AST_Binary, function(compressor, first_in_statement) { + var self = this.clone(), op = this.operator; + if (compressor.option("unsafe_comps")) { + switch (op) { + case "<=" : self.operator = ">" ; return self; + case "<" : self.operator = ">=" ; return self; + case ">=" : self.operator = "<" ; return self; + case ">" : self.operator = "<=" ; return self; + } + } + switch (op) { + case "==" : self.operator = "!="; return self; + case "!=" : self.operator = "=="; return self; + case "===": self.operator = "!=="; return self; + case "!==": self.operator = "==="; return self; + case "&&": + self.operator = "||"; + self.left = self.left.negate(compressor, first_in_statement); + self.right = self.right.negate(compressor); + return best(this, self, first_in_statement); + case "||": + self.operator = "&&"; + self.left = self.left.negate(compressor, first_in_statement); + self.right = self.right.negate(compressor); + return best(this, self, first_in_statement); + } + return basic_negation(this); + }); + })(function(node, func) { + node.DEFMETHOD("negate", function(compressor, first_in_statement) { + return func.call(this, compressor, first_in_statement); + }); + }); + + var global_pure_fns = makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError"); + AST_Call.DEFMETHOD("is_expr_pure", function(compressor) { + if (compressor.option("unsafe")) { + var expr = this.expression; + var first_arg = (this.args && this.args[0] && this.args[0].evaluate(compressor)); + if ( + expr.expression && expr.expression.name === "hasOwnProperty" && + (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) + ) { + return false; + } + if (is_undeclared_ref(expr) && global_pure_fns(expr.name)) return true; + if (expr instanceof AST_Dot + && is_undeclared_ref(expr.expression) + && (static_fns[expr.expression.name] || return_false)(expr.property)) { + return true; + } + } + return this.pure || !compressor.pure_funcs(this); + }); + AST_Node.DEFMETHOD("is_call_pure", return_false); + AST_Dot.DEFMETHOD("is_call_pure", function(compressor) { + if (!compressor.option("unsafe")) return; + var expr = this.expression; + var fns = return_false; + if (expr instanceof AST_Array) { + fns = native_fns.Array; + } else if (expr.is_boolean()) { + fns = native_fns.Boolean; + } else if (expr.is_number(compressor)) { + fns = native_fns.Number; + } else if (expr instanceof AST_RegExp) { + fns = native_fns.RegExp; + } else if (expr.is_string(compressor)) { + fns = native_fns.String; + } else if (!this.may_throw_on_access(compressor)) { + fns = native_fns.Object; + } + return fns(this.property); + }); + + // determine if expression has side effects + (function(def) { + def(AST_Node, return_true); + + def(AST_EmptyStatement, return_false); + def(AST_Constant, return_false); + def(AST_This, return_false); + + function any(list, compressor) { + for (var i = list.length; --i >= 0;) + if (list[i].has_side_effects(compressor)) + return true; + return false; + } + + def(AST_Block, function(compressor) { + return any(this.body, compressor); + }); + def(AST_Call, function(compressor) { + if (!this.is_expr_pure(compressor) + && (!this.expression.is_call_pure(compressor) + || this.expression.has_side_effects(compressor))) { + return true; + } + return any(this.args, compressor); + }); + def(AST_Switch, function(compressor) { + return this.expression.has_side_effects(compressor) + || any(this.body, compressor); + }); + def(AST_Case, function(compressor) { + return this.expression.has_side_effects(compressor) + || any(this.body, compressor); + }); + def(AST_Try, function(compressor) { + return any(this.body, compressor) + || this.bcatch && this.bcatch.has_side_effects(compressor) + || this.bfinally && this.bfinally.has_side_effects(compressor); + }); + def(AST_If, function(compressor) { + return this.condition.has_side_effects(compressor) + || this.body && this.body.has_side_effects(compressor) + || this.alternative && this.alternative.has_side_effects(compressor); + }); + def(AST_LabeledStatement, function(compressor) { + return this.body.has_side_effects(compressor); + }); + def(AST_SimpleStatement, function(compressor) { + return this.body.has_side_effects(compressor); + }); + def(AST_Lambda, return_false); + def(AST_Class, return_false); + def(AST_DefClass, return_true); + def(AST_Binary, function(compressor) { + return this.left.has_side_effects(compressor) + || this.right.has_side_effects(compressor); + }); + def(AST_Assign, return_true); + def(AST_Conditional, function(compressor) { + return this.condition.has_side_effects(compressor) + || this.consequent.has_side_effects(compressor) + || this.alternative.has_side_effects(compressor); + }); + def(AST_Unary, function(compressor) { + return unary_side_effects(this.operator) + || this.expression.has_side_effects(compressor); + }); + def(AST_SymbolRef, function(compressor) { + return !this.is_declared(compressor); + }); + def(AST_SymbolDeclaration, return_false); + def(AST_Object, function(compressor) { + return any(this.properties, compressor); + }); + def(AST_ObjectProperty, function(compressor) { + if (this.key instanceof AST_ObjectKeyVal && + this.key.has_side_effects(compressor)) + return true; + return this.value.has_side_effects(compressor); + }); + def(AST_Array, function(compressor) { + return any(this.elements, compressor); + }); + def(AST_Dot, function(compressor) { + return this.expression.may_throw_on_access(compressor) + || this.expression.has_side_effects(compressor); + }); + def(AST_Sub, function(compressor) { + return this.expression.may_throw_on_access(compressor) + || this.expression.has_side_effects(compressor) + || this.property.has_side_effects(compressor); + }); + def(AST_Sequence, function(compressor) { + return any(this.expressions, compressor); + }); + def(AST_Definitions, function(compressor) { + return any(this.definitions, compressor); + }); + def(AST_VarDef, function(compressor) { + return this.value; + }); + def(AST_TemplateSegment, return_false); + def(AST_TemplateString, function(compressor) { + return any(this.segments, compressor); + }); + })(function(node, func) { + node.DEFMETHOD("has_side_effects", func); + }); + + // determine if expression may throw + (function(def) { + def(AST_Node, return_true); + + def(AST_Class, return_false); + def(AST_Constant, return_false); + def(AST_EmptyStatement, return_false); + def(AST_Lambda, return_false); + def(AST_SymbolDeclaration, return_false); + def(AST_This, return_false); + + function any(list, compressor) { + for (var i = list.length; --i >= 0;) + if (list[i].may_throw(compressor)) + return true; + return false; + } + + def(AST_Array, function(compressor) { + return any(this.elements, compressor); + }); + def(AST_Assign, function(compressor) { + if (this.right.may_throw(compressor)) return true; + if (!compressor.has_directive("use strict") + && this.operator == "=" + && this.left instanceof AST_SymbolRef) { + return false; + } + return this.left.may_throw(compressor); + }); + def(AST_Binary, function(compressor) { + return this.left.may_throw(compressor) + || this.right.may_throw(compressor); + }); + def(AST_Block, function(compressor) { + return any(this.body, compressor); + }); + def(AST_Call, function(compressor) { + if (any(this.args, compressor)) return true; + if (this.is_expr_pure(compressor)) return false; + if (this.expression.may_throw(compressor)) return true; + return !(this.expression instanceof AST_Lambda) + || any(this.expression.body, compressor); + }); + def(AST_Case, function(compressor) { + return this.expression.may_throw(compressor) + || any(this.body, compressor); + }); + def(AST_Conditional, function(compressor) { + return this.condition.may_throw(compressor) + || this.consequent.may_throw(compressor) + || this.alternative.may_throw(compressor); + }); + def(AST_Definitions, function(compressor) { + return any(this.definitions, compressor); + }); + def(AST_Dot, function(compressor) { + return this.expression.may_throw_on_access(compressor) + || this.expression.may_throw(compressor); + }); + def(AST_If, function(compressor) { + return this.condition.may_throw(compressor) + || this.body && this.body.may_throw(compressor) + || this.alternative && this.alternative.may_throw(compressor); + }); + def(AST_LabeledStatement, function(compressor) { + return this.body.may_throw(compressor); + }); + def(AST_Object, function(compressor) { + return any(this.properties, compressor); + }); + def(AST_ObjectProperty, function(compressor) { + return this.value.may_throw(compressor); + }); + def(AST_Return, function(compressor) { + return this.value && this.value.may_throw(compressor); + }); + def(AST_Sequence, function(compressor) { + return any(this.expressions, compressor); + }); + def(AST_SimpleStatement, function(compressor) { + return this.body.may_throw(compressor); + }); + def(AST_Sub, function(compressor) { + return this.expression.may_throw_on_access(compressor) + || this.expression.may_throw(compressor) + || this.property.may_throw(compressor); + }); + def(AST_Switch, function(compressor) { + return this.expression.may_throw(compressor) + || any(this.body, compressor); + }); + def(AST_SymbolRef, function(compressor) { + return !this.is_declared(compressor); + }); + def(AST_Try, function(compressor) { + return this.bcatch ? this.bcatch.may_throw(compressor) : any(this.body, compressor) + || this.bfinally && this.bfinally.may_throw(compressor); + }); + def(AST_Unary, function(compressor) { + if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) + return false; + return this.expression.may_throw(compressor); + }); + def(AST_VarDef, function(compressor) { + if (!this.value) return false; + return this.value.may_throw(compressor); + }); + })(function(node, func) { + node.DEFMETHOD("may_throw", func); + }); + + // determine if expression is constant + (function(def) { + function all(list) { + for (var i = list.length; --i >= 0;) + if (!list[i].is_constant_expression()) + return false; + return true; + } + + function all_refs_local(scope) { + var self = this; + var result = true; + self.walk(new TreeWalker(function(node) { + if (!result) return true; + if (node instanceof AST_SymbolRef) { + if (self.inlined) { + result = false; + return true; + } + var def = node.definition(); + if (member(def, self.enclosed) + && !self.variables.has(def.name)) { + if (scope) { + var scope_def = scope.find_variable(node); + if (def.undeclared ? !scope_def : scope_def === def) { + result = "f"; + return true; + } + } + result = false; + } + return true; + } + if (node instanceof AST_This && self instanceof AST_Arrow) { + result = false; + return true; + } + })); + return result; + } + + def(AST_Node, return_false); + def(AST_Constant, return_true); + def(AST_Class, function(scope) { + var self = this; + if (self.extends && !self.extends.is_constant_expression(scope)) { + return false; + } + return all_refs_local.call(self, scope); + }); + def(AST_Lambda, all_refs_local); + def(AST_Unary, function() { + return this.expression.is_constant_expression(); + }); + def(AST_Binary, function() { + return this.left.is_constant_expression() && this.right.is_constant_expression(); + }); + def(AST_Array, function() { + return all(this.elements); + }); + def(AST_Object, function() { + return all(this.properties); + }); + def(AST_ObjectProperty, function() { + return !(this.key instanceof AST_Node) && this.value.is_constant_expression(); + }); + })(function(node, func) { + node.DEFMETHOD("is_constant_expression", func); + }); + + // tell me if a statement aborts + function aborts(thing) { + return thing && thing.aborts(); + } + (function(def) { + def(AST_Statement, return_null); + def(AST_Jump, return_this); + function block_aborts() { + for (var i = 0; i < this.body.length; i++) { + if (aborts(this.body[i])) { + return this.body[i]; + } + } + return null; + } + def(AST_Import, function() { return null; }); + def(AST_BlockStatement, block_aborts); + def(AST_SwitchBranch, block_aborts); + def(AST_If, function() { + return this.alternative && aborts(this.body) && aborts(this.alternative) && this; + }); + })(function(node, func) { + node.DEFMETHOD("aborts", func); + }); + + /* -----[ optimizers ]----- */ + + var directives = ["use asm", "use strict"]; + OPT(AST_Directive, function(self, compressor) { + if (compressor.option("directives") + && (!member(self.value, directives) || compressor.has_directive(self.value) !== self)) { + return make_node(AST_EmptyStatement, self); + } + return self; + }); + + OPT(AST_Debugger, function(self, compressor) { + if (compressor.option("drop_debugger")) + return make_node(AST_EmptyStatement, self); + return self; + }); + + OPT(AST_LabeledStatement, function(self, compressor) { + if (self.body instanceof AST_Break + && compressor.loopcontrol_target(self.body) === self.body) { + return make_node(AST_EmptyStatement, self); + } + return self.label.references.length == 0 ? self.body : self; + }); + + OPT(AST_Block, function(self, compressor) { + tighten_body(self.body, compressor); + return self; + }); + + function can_be_extracted_from_if_block(node) { + return !( + node instanceof AST_Const || + node instanceof AST_Let || + node instanceof AST_Class + ); + } + + OPT(AST_BlockStatement, function(self, compressor) { + tighten_body(self.body, compressor); + switch (self.body.length) { + case 1: + if (!compressor.has_directive("use strict") + && compressor.parent() instanceof AST_If + && can_be_extracted_from_if_block(self.body[0]) + || can_be_evicted_from_block(self.body[0])) { + return self.body[0]; + } + break; + case 0: return make_node(AST_EmptyStatement, self); + } + return self; + }); + + function opt_AST_Lambda(self, compressor) { + tighten_body(self.body, compressor); + if (compressor.option("side_effects") + && self.body.length == 1 + && self.body[0] === compressor.has_directive("use strict")) { + self.body.length = 0; + } + return self; + } + OPT(AST_Lambda, opt_AST_Lambda); + + AST_Scope.DEFMETHOD("drop_unused", function(compressor) { + if (!compressor.option("unused")) return; + if (compressor.has_directive("use asm")) return; + var self = this; + if (self.pinned()) return; + var drop_funcs = !(self instanceof AST_Toplevel) || compressor.toplevel.funcs; + var drop_vars = !(self instanceof AST_Toplevel) || compressor.toplevel.vars; + var assign_as_unused = /keep_assign/.test(compressor.option("unused")) ? return_false : function(node) { + if (node instanceof AST_Assign && (node.write_only || node.operator == "=")) { + return node.left; + } + if (node instanceof AST_Unary && node.write_only) return node.expression; + }; + var in_use = []; + var in_use_ids = Object.create(null); // avoid expensive linear scans of in_use + var fixed_ids = Object.create(null); + if (self instanceof AST_Toplevel && compressor.top_retain) { + self.variables.each(function(def) { + if (compressor.top_retain(def) && !(def.id in in_use_ids)) { + in_use_ids[def.id] = true; + in_use.push(def); + } + }); + } + var var_defs_by_id = new Dictionary(); + var initializations = new Dictionary(); + var destructuring_value = null; + // pass 1: find out which symbols are directly used in + // this scope (not in nested scopes). + var scope = this; + var tw = new TreeWalker(function(node, descend) { + if (node instanceof AST_Lambda && node.uses_arguments && !tw.has_directive("use strict")) { + node.argnames.forEach(function(argname) { + if (!(argname instanceof AST_SymbolDeclaration)) return; + var def = argname.definition(); + if (!(def.id in in_use_ids)) { + in_use_ids[def.id] = true; + in_use.push(def); + } + }); + } + if (node === self) return; + if (node instanceof AST_Defun || node instanceof AST_DefClass) { + var node_def = node.name.definition(); + var in_export = tw.parent() instanceof AST_Export; + if (in_export || !drop_funcs && scope === self) { + if (node_def.global && !(node_def.id in in_use_ids)) { + in_use_ids[node_def.id] = true; + in_use.push(node_def); + } + } + initializations.add(node_def.id, node); + return true; // don't go in nested scopes + } + if (node instanceof AST_SymbolFunarg && scope === self) { + var_defs_by_id.add(node.definition().id, node); + } + if (node instanceof AST_Definitions && scope === self) { + var in_export = tw.parent() instanceof AST_Export; + node.definitions.forEach(function(def) { + if (def.name instanceof AST_SymbolVar) { + var_defs_by_id.add(def.name.definition().id, def); + } + if (in_export || !drop_vars) { + def.name.walk(new TreeWalker(function(node) { + if (node instanceof AST_SymbolDeclaration) { + var def = node.definition(); + if ((in_export || def.global) && !(def.id in in_use_ids)) { + in_use_ids[def.id] = true; + in_use.push(def); + } + } + })); + } + if (def.value) { + if (def.name instanceof AST_Destructuring) { + var destructuring_cache = destructuring_value; + destructuring_value = def.value; + def.walk(tw); + destructuring_value = destructuring_cache; + } else { + var node_def = def.name.definition(); + initializations.add(node_def.id, def.value); + if (!node_def.chained && def.name.fixed_value() === def.value) { + fixed_ids[node_def.id] = def; + } + } + if (def.value.has_side_effects(compressor)) { + def.value.walk(tw); + } + } + }); + return true; + } + if (node.destructuring && destructuring_value) { + initializations.add(node.name, destructuring_value); + } + return scan_ref_scoped(node, descend); + }); + self.walk(tw); + // pass 2: for every used symbol we need to walk its + // initialization code to figure out if it uses other + // symbols (that may not be in_use). + tw = new TreeWalker(scan_ref_scoped); + for (var i = 0; i < in_use.length; i++) { + var init = initializations.get(in_use[i].id); + if (init) init.forEach(function(init) { + init.walk(tw); + }); + } + // pass 3: we should drop declarations not in_use + var tt = new TreeTransformer( + function before(node, descend, in_list) { + var parent = tt.parent(); + if (drop_vars) { + var sym = assign_as_unused(node); + if (sym instanceof AST_SymbolRef) { + var def = sym.definition(); + var in_use = def.id in in_use_ids; + if (node instanceof AST_Assign) { + if (!in_use || def.id in fixed_ids && fixed_ids[def.id] !== node) { + return maintain_this_binding(parent, node, node.right.transform(tt)); + } + } else if (!in_use) return make_node(AST_Number, node, { + value: 0 + }); + } + } + if (scope !== self) return; + var def; + if (node.name + && (node instanceof AST_ClassExpression + && !keep_name(compressor.option("keep_classnames"), (def = node.name.definition()).name) + || node instanceof AST_Function + && !keep_name(compressor.option("keep_fnames"), (def = node.name.definition()).name))) { + // any declarations with same name will overshadow + // name of this anonymous function and can therefore + // never be used anywhere + if (!(def.id in in_use_ids) || def.orig.length > 1) node.name = null; + } + if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) { + var trim = !compressor.option("keep_fargs"); + for (var a = node.argnames, i = a.length; --i >= 0;) { + var sym = a[i]; + if (sym instanceof AST_Expansion) { + sym = sym.expression; + } + if (sym instanceof AST_DefaultAssign) { + sym = sym.left; + } + // Do not drop destructuring arguments. + // They constitute a type assertion, so dropping + // them would stop that TypeError which would happen + // if someone called it with an incorrectly formatted + // parameter. + if (!(sym instanceof AST_Destructuring) && !(sym.definition().id in in_use_ids)) { + sym.__unused = true; + if (trim) { + a.pop(); + compressor[sym.unreferenced() ? "warn" : "info"]("Dropping unused function argument {name} [{file}:{line},{col}]", template(sym)); + } + } else { + trim = false; + } + } + } + if ((node instanceof AST_Defun || node instanceof AST_DefClass) && node !== self) { + var def = node.name.definition(); + var keep = (def.id in in_use_ids) || !drop_funcs && def.global; + if (!keep) { + compressor[node.name.unreferenced() ? "warn" : "info"]("Dropping unused function {name} [{file}:{line},{col}]", template(node.name)); + def.eliminated++; + return make_node(AST_EmptyStatement, node); + } + } + if (node instanceof AST_Definitions && !(parent instanceof AST_ForIn && parent.init === node)) { + var drop_block = !(parent instanceof AST_Toplevel) && !(node instanceof AST_Var); + // place uninitialized names at the start + var body = [], head = [], tail = []; + // for unused names whose initialization has + // side effects, we can cascade the init. code + // into the next one, or next statement. + var side_effects = []; + node.definitions.forEach(function(def) { + if (def.value) def.value = def.value.transform(tt); + var is_destructure = def.name instanceof AST_Destructuring; + var sym = is_destructure + ? new SymbolDef(null, { name: "" }) /* fake SymbolDef */ + : def.name.definition(); + if (drop_block && sym.global) return tail.push(def); + if (!(drop_vars || drop_block) + || is_destructure + && (def.name.names.length + || def.name.is_array + || compressor.option("pure_getters") != true) + || sym.id in in_use_ids) { + if (def.value && sym.id in fixed_ids && fixed_ids[sym.id] !== def) { + def.value = def.value.drop_side_effect_free(compressor); + } + if (def.name instanceof AST_SymbolVar) { + var var_defs = var_defs_by_id.get(sym.id); + if (var_defs.length > 1 && (!def.value || sym.orig.indexOf(def.name) > sym.eliminated)) { + compressor.warn("Dropping duplicated definition of variable {name} [{file}:{line},{col}]", template(def.name)); + if (def.value) { + var ref = make_node(AST_SymbolRef, def.name, def.name); + sym.references.push(ref); + var assign = make_node(AST_Assign, def, { + operator: "=", + left: ref, + right: def.value + }); + if (fixed_ids[sym.id] === def) { + fixed_ids[sym.id] = assign; + } + side_effects.push(assign.transform(tt)); + } + remove(var_defs, def); + sym.eliminated++; + return; + } + } + if (def.value) { + if (side_effects.length > 0) { + if (tail.length > 0) { + side_effects.push(def.value); + def.value = make_sequence(def.value, side_effects); + } else { + body.push(make_node(AST_SimpleStatement, node, { + body: make_sequence(node, side_effects) + })); + } + side_effects = []; + } + tail.push(def); + } else { + head.push(def); + } + } else if (sym.orig[0] instanceof AST_SymbolCatch) { + var value = def.value && def.value.drop_side_effect_free(compressor); + if (value) side_effects.push(value); + def.value = null; + head.push(def); + } else { + var value = def.value && def.value.drop_side_effect_free(compressor); + if (value) { + if (!is_destructure) compressor.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", template(def.name)); + side_effects.push(value); + } else { + if (!is_destructure) compressor[def.name.unreferenced() ? "warn" : "info"]("Dropping unused variable {name} [{file}:{line},{col}]", template(def.name)); + } + sym.eliminated++; + } + }); + if (head.length > 0 || tail.length > 0) { + node.definitions = head.concat(tail); + body.push(node); + } + if (side_effects.length > 0) { + body.push(make_node(AST_SimpleStatement, node, { + body: make_sequence(node, side_effects) + })); + } + switch (body.length) { + case 0: + return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); + case 1: + return body[0]; + default: + return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, { + body: body + }); + } + } + // certain combination of unused name + side effect leads to: + // https://github.com/mishoo/UglifyJS2/issues/44 + // https://github.com/mishoo/UglifyJS2/issues/1830 + // https://github.com/mishoo/UglifyJS2/issues/1838 + // that's an invalid AST. + // We fix it at this stage by moving the `var` outside the `for`. + if (node instanceof AST_For) { + descend(node, this); + var block; + if (node.init instanceof AST_BlockStatement) { + block = node.init; + node.init = block.body.pop(); + block.body.push(node); + } + if (node.init instanceof AST_SimpleStatement) { + node.init = node.init.body; + } else if (is_empty(node.init)) { + node.init = null; + } + return !block ? node : in_list ? MAP.splice(block.body) : block; + } + if (node instanceof AST_LabeledStatement && node.body instanceof AST_For) { + descend(node, this); + if (node.body instanceof AST_BlockStatement) { + var block = node.body; + node.body = block.body.pop(); + block.body.push(node); + return in_list ? MAP.splice(block.body) : block; + } + return node; + } + if (node instanceof AST_BlockStatement) { + descend(node, this); + if (in_list && all(node.body, can_be_evicted_from_block)) { + return MAP.splice(node.body); + } + return node; + } + if (node instanceof AST_Scope) { + var save_scope = scope; + scope = node; + descend(node, this); + scope = save_scope; + return node; + } + + function template(sym) { + return { + name : sym.name, + file : sym.start.file, + line : sym.start.line, + col : sym.start.col + }; + } + } + ); + self.transform(tt); + + function scan_ref_scoped(node, descend) { + var node_def, sym = assign_as_unused(node); + if (sym instanceof AST_SymbolRef + && !is_ref_of(node.left, AST_SymbolBlockDeclaration) + && self.variables.get(sym.name) === (node_def = sym.definition())) { + if (node instanceof AST_Assign) { + node.right.walk(tw); + if (!node_def.chained && node.left.fixed_value() === node.right) { + fixed_ids[node_def.id] = node; + } + } + return true; + } + if (node instanceof AST_SymbolRef) { + node_def = node.definition(); + if (!(node_def.id in in_use_ids)) { + in_use_ids[node_def.id] = true; + in_use.push(node_def); + if (node_def = node_def.redefined()) { + in_use_ids[node_def.id] = true; + in_use.push(node_def); + } + } + return true; + } + if (node instanceof AST_Scope) { + var save_scope = scope; + scope = node; + descend(); + scope = save_scope; + return true; + } + } + }); + + AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { + var self = this; + if (compressor.has_directive("use asm")) return self; + // Hoisting makes no sense in an arrow func + if (!Array.isArray(self.body)) return self; + + var hoist_funs = compressor.option("hoist_funs"); + var hoist_vars = compressor.option("hoist_vars"); + + if (hoist_funs || hoist_vars) { + var dirs = []; + var hoisted = []; + var vars = new Dictionary(), vars_found = 0, var_decl = 0; + // let's count var_decl first, we seem to waste a lot of + // space if we hoist `var` when there's only one. + self.walk(new TreeWalker(function(node) { + if (node instanceof AST_Scope && node !== self) + return true; + if (node instanceof AST_Var) { + ++var_decl; + return true; + } + })); + hoist_vars = hoist_vars && var_decl > 1; + var tt = new TreeTransformer( + function before(node) { + if (node !== self) { + if (node instanceof AST_Directive) { + dirs.push(node); + return make_node(AST_EmptyStatement, node); + } + if (hoist_funs && node instanceof AST_Defun + && !(tt.parent() instanceof AST_Export) + && tt.parent() === self) { + hoisted.push(node); + return make_node(AST_EmptyStatement, node); + } + if (hoist_vars && node instanceof AST_Var) { + node.definitions.forEach(function(def) { + if (def.name instanceof AST_Destructuring) return; + vars.set(def.name.name, def); + ++vars_found; + }); + var seq = node.to_assignments(compressor); + var p = tt.parent(); + if (p instanceof AST_ForIn && p.init === node) { + if (seq == null) { + var def = node.definitions[0].name; + return make_node(AST_SymbolRef, def, def); + } + return seq; + } + if (p instanceof AST_For && p.init === node) { + return seq; + } + if (!seq) return make_node(AST_EmptyStatement, node); + return make_node(AST_SimpleStatement, node, { + body: seq + }); + } + if (node instanceof AST_Scope) + return node; // to avoid descending in nested scopes + } + } + ); + self = self.transform(tt); + if (vars_found > 0) { + // collect only vars which don't show up in self's arguments list + var defs = []; + vars.each(function(def, name) { + if (self instanceof AST_Lambda + && find_if(function(x) { return x.name == def.name.name; }, + self.args_as_names())) { + vars.del(name); + } else { + def = def.clone(); + def.value = null; + defs.push(def); + vars.set(name, def); + } + }); + if (defs.length > 0) { + // try to merge in assignments + for (var i = 0; i < self.body.length;) { + if (self.body[i] instanceof AST_SimpleStatement) { + var expr = self.body[i].body, sym, assign; + if (expr instanceof AST_Assign + && expr.operator == "=" + && (sym = expr.left) instanceof AST_Symbol + && vars.has(sym.name) + ) { + var def = vars.get(sym.name); + if (def.value) break; + def.value = expr.right; + remove(defs, def); + defs.push(def); + self.body.splice(i, 1); + continue; + } + if (expr instanceof AST_Sequence + && (assign = expr.expressions[0]) instanceof AST_Assign + && assign.operator == "=" + && (sym = assign.left) instanceof AST_Symbol + && vars.has(sym.name) + ) { + var def = vars.get(sym.name); + if (def.value) break; + def.value = assign.right; + remove(defs, def); + defs.push(def); + self.body[i].body = make_sequence(expr, expr.expressions.slice(1)); + continue; + } + } + if (self.body[i] instanceof AST_EmptyStatement) { + self.body.splice(i, 1); + continue; + } + if (self.body[i] instanceof AST_BlockStatement) { + var tmp = [ i, 1 ].concat(self.body[i].body); + self.body.splice.apply(self.body, tmp); + continue; + } + break; + } + defs = make_node(AST_Var, self, { + definitions: defs + }); + hoisted.push(defs); + } + } + self.body = dirs.concat(hoisted, self.body); + } + return self; + }); + + AST_Scope.DEFMETHOD("var_names", function() { + var var_names = this._var_names; + if (!var_names) { + this._var_names = var_names = Object.create(null); + this.enclosed.forEach(function(def) { + var_names[def.name] = true; + }); + this.variables.each(function(def, name) { + var_names[name] = true; + }); + } + return var_names; + }); + + AST_Scope.DEFMETHOD("make_var_name", function(prefix) { + var var_names = this.var_names(); + prefix = prefix.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/ig, "_"); + var name = prefix; + for (var i = 0; var_names[name]; i++) name = prefix + "$" + i; + var_names[name] = true; + return name; + }); + + AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { + var self = this; + if (!compressor.option("hoist_props") || compressor.has_directive("use asm")) return self; + var top_retain = self instanceof AST_Toplevel && compressor.top_retain || return_false; + var defs_by_id = Object.create(null); + var tt = new TreeTransformer(function(node, descend) { + if (node instanceof AST_Definitions && tt.parent() instanceof AST_Export) return node; + if (node instanceof AST_VarDef) { + var sym = node.name, def, value; + if (sym.scope === self + && (def = sym.definition()).escaped != 1 + && !def.assignments + && !def.direct_access + && !def.single_use + && !compressor.exposed(def) + && !top_retain(def) + && (value = sym.fixed_value()) === node.value + && value instanceof AST_Object) { + descend(node, this); + var defs = new Dictionary(); + var assignments = []; + value.properties.forEach(function(prop) { + assignments.push(make_node(AST_VarDef, node, { + name: make_sym(prop.key), + value: prop.value + })); + }); + defs_by_id[def.id] = defs; + return MAP.splice(assignments); + } + } + if (node instanceof AST_PropAccess && node.expression instanceof AST_SymbolRef) { + var defs = defs_by_id[node.expression.definition().id]; + if (defs) { + var def = defs.get(get_value(node.property)); + var sym = make_node(AST_SymbolRef, node, { + name: def.name, + scope: node.expression.scope, + thedef: def + }); + sym.reference({}); + return sym; + } + } + + function make_sym(key) { + var new_var = make_node(sym.CTOR, sym, { + name: self.make_var_name(sym.name + "_" + key), + scope: self + }); + var def = self.def_variable(new_var); + defs.set(key, def); + self.enclosed.push(def); + return new_var; + } + }); + return self.transform(tt); + }); + + // drop_side_effect_free() + // remove side-effect-free parts which only affects return value + (function(def) { + // Drop side-effect-free elements from an array of expressions. + // Returns an array of expressions with side-effects or null + // if all elements were dropped. Note: original array may be + // returned if nothing changed. + function trim(nodes, compressor, first_in_statement) { + var len = nodes.length; + if (!len) return null; + var ret = [], changed = false; + for (var i = 0; i < len; i++) { + var node = nodes[i].drop_side_effect_free(compressor, first_in_statement); + changed |= node !== nodes[i]; + if (node) { + ret.push(node); + first_in_statement = false; + } + } + return changed ? ret.length ? ret : null : nodes; + } + + def(AST_Node, return_this); + def(AST_Constant, return_null); + def(AST_This, return_null); + def(AST_Call, function(compressor, first_in_statement) { + if (!this.is_expr_pure(compressor)) { + if (this.expression.is_call_pure(compressor)) { + var exprs = this.args.slice(); + exprs.unshift(this.expression.expression); + exprs = trim(exprs, compressor, first_in_statement); + return exprs && make_sequence(this, exprs); + } + if (is_func_expr(this.expression) + && (!this.expression.name || !this.expression.name.definition().references.length)) { + var node = this.clone(); + node.expression.process_expression(false, compressor); + return node; + } + return this; + } + if (this.pure) { + compressor.warn("Dropping __PURE__ call [{file}:{line},{col}]", this.start); + } + var args = trim(this.args, compressor, first_in_statement); + return args && make_sequence(this, args); + }); + def(AST_Accessor, return_null); + def(AST_Function, return_null); + def(AST_Arrow, return_null); + def(AST_ClassExpression, return_null); + def(AST_Binary, function(compressor, first_in_statement) { + var right = this.right.drop_side_effect_free(compressor); + if (!right) return this.left.drop_side_effect_free(compressor, first_in_statement); + if (lazy_op(this.operator)) { + if (right === this.right) return this; + var node = this.clone(); + node.right = right; + return node; + } else { + var left = this.left.drop_side_effect_free(compressor, first_in_statement); + if (!left) return this.right.drop_side_effect_free(compressor, first_in_statement); + return make_sequence(this, [ left, right ]); + } + }); + def(AST_Assign, function(compressor) { + var left = this.left; + if (left.has_side_effects(compressor) + || compressor.has_directive("use strict") + && left instanceof AST_PropAccess + && left.expression.is_constant()) { + return this; + } + this.write_only = true; + while (left instanceof AST_PropAccess) { + left = left.expression; + } + if (left.is_constant_expression(compressor.find_parent(AST_Scope))) { + return this.right.drop_side_effect_free(compressor); + } + return this; + }); + def(AST_Conditional, function(compressor) { + var consequent = this.consequent.drop_side_effect_free(compressor); + var alternative = this.alternative.drop_side_effect_free(compressor); + if (consequent === this.consequent && alternative === this.alternative) return this; + if (!consequent) return alternative ? make_node(AST_Binary, this, { + operator: "||", + left: this.condition, + right: alternative + }) : this.condition.drop_side_effect_free(compressor); + if (!alternative) return make_node(AST_Binary, this, { + operator: "&&", + left: this.condition, + right: consequent + }); + var node = this.clone(); + node.consequent = consequent; + node.alternative = alternative; + return node; + }); + def(AST_Unary, function(compressor, first_in_statement) { + if (unary_side_effects(this.operator)) { + this.write_only = !this.expression.has_side_effects(compressor); + return this; + } + if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) return null; + var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); + if (first_in_statement && expression && is_iife_call(expression)) { + if (expression === this.expression && this.operator == "!") return this; + return expression.negate(compressor, first_in_statement); + } + return expression; + }); + def(AST_SymbolRef, function(compressor) { + return this.is_declared(compressor) ? null : this; + }); + def(AST_Object, function(compressor, first_in_statement) { + var values = trim(this.properties, compressor, first_in_statement); + return values && make_sequence(this, values); + }); + def(AST_ObjectProperty, function(compressor, first_in_statement) { + return this.value.drop_side_effect_free(compressor, first_in_statement); + }); + def(AST_Array, function(compressor, first_in_statement) { + var values = trim(this.elements, compressor, first_in_statement); + return values && make_sequence(this, values); + }); + def(AST_Dot, function(compressor, first_in_statement) { + if (this.expression.may_throw_on_access(compressor)) return this; + return this.expression.drop_side_effect_free(compressor, first_in_statement); + }); + def(AST_Sub, function(compressor, first_in_statement) { + if (this.expression.may_throw_on_access(compressor)) return this; + var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); + if (!expression) return this.property.drop_side_effect_free(compressor, first_in_statement); + var property = this.property.drop_side_effect_free(compressor); + if (!property) return expression; + return make_sequence(this, [ expression, property ]); + }); + def(AST_Sequence, function(compressor) { + var last = this.tail_node(); + var expr = last.drop_side_effect_free(compressor); + if (expr === last) return this; + var expressions = this.expressions.slice(0, -1); + if (expr) expressions.push(expr); + return make_sequence(this, expressions); + }); + def(AST_Expansion, function(compressor, first_in_statement) { + return this.expression.drop_side_effect_free(compressor, first_in_statement); + }); + def(AST_TemplateSegment, return_null); + def(AST_TemplateString, function(compressor) { + var values = trim(this.segments, compressor, first_in_statement); + return values && make_sequence(this, values); + }); + })(function(node, func) { + node.DEFMETHOD("drop_side_effect_free", func); + }); + + OPT(AST_SimpleStatement, function(self, compressor) { + if (compressor.option("side_effects")) { + var body = self.body; + var node = body.drop_side_effect_free(compressor, true); + if (!node) { + compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start); + return make_node(AST_EmptyStatement, self); + } + if (node !== body) { + return make_node(AST_SimpleStatement, self, { body: node }); + } + } + return self; + }); + + OPT(AST_While, function(self, compressor) { + return compressor.option("loops") ? make_node(AST_For, self, self).optimize(compressor) : self; + }); + + function has_break_or_continue(loop, parent) { + var found = false; + var tw = new TreeWalker(function(node) { + if (found || node instanceof AST_Scope) return true; + if (node instanceof AST_LoopControl && tw.loopcontrol_target(node) === loop) { + return found = true; + } + }); + if (parent instanceof AST_LabeledStatement) tw.push(parent); + tw.push(loop); + loop.body.walk(tw); + return found; + } + + OPT(AST_Do, function(self, compressor) { + if (!compressor.option("loops")) return self; + var cond = self.condition.tail_node().evaluate(compressor); + if (!(cond instanceof AST_Node)) { + if (cond) return make_node(AST_For, self, { + body: make_node(AST_BlockStatement, self.body, { + body: [ + self.body, + make_node(AST_SimpleStatement, self.condition, { + body: self.condition + }) + ] + }) + }).optimize(compressor); + if (!has_break_or_continue(self, compressor.parent())) { + return make_node(AST_BlockStatement, self.body, { + body: [ + self.body, + make_node(AST_SimpleStatement, self.condition, { + body: self.condition + }) + ] + }).optimize(compressor); + } + } + return self; + }); + + function if_break_in_loop(self, compressor) { + var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body; + if (compressor.option("dead_code") && is_break(first)) { + var body = []; + if (self.init instanceof AST_Statement) { + body.push(self.init); + } else if (self.init) { + body.push(make_node(AST_SimpleStatement, self.init, { + body: self.init + })); + } + if (self.condition) { + body.push(make_node(AST_SimpleStatement, self.condition, { + body: self.condition + })); + } + extract_declarations_from_unreachable_code(compressor, self.body, body); + return make_node(AST_BlockStatement, self, { + body: body + }); + } + if (first instanceof AST_If) { + if (is_break(first.body)) { + if (self.condition) { + self.condition = make_node(AST_Binary, self.condition, { + left: self.condition, + operator: "&&", + right: first.condition.negate(compressor), + }); + } else { + self.condition = first.condition.negate(compressor); + } + drop_it(first.alternative); + } else if (is_break(first.alternative)) { + if (self.condition) { + self.condition = make_node(AST_Binary, self.condition, { + left: self.condition, + operator: "&&", + right: first.condition, + }); + } else { + self.condition = first.condition; + } + drop_it(first.body); + } + } + return self; + + function is_break(node) { + return node instanceof AST_Break + && compressor.loopcontrol_target(node) === compressor.self(); + } + + function drop_it(rest) { + rest = as_statement_array(rest); + if (self.body instanceof AST_BlockStatement) { + self.body = self.body.clone(); + self.body.body = rest.concat(self.body.body.slice(1)); + self.body = self.body.transform(compressor); + } else { + self.body = make_node(AST_BlockStatement, self.body, { + body: rest + }).transform(compressor); + } + self = if_break_in_loop(self, compressor); + } + } + + OPT(AST_For, function(self, compressor) { + if (!compressor.option("loops")) return self; + if (compressor.option("side_effects") && self.init) { + self.init = self.init.drop_side_effect_free(compressor); + } + if (self.condition) { + var cond = self.condition.evaluate(compressor); + if (!(cond instanceof AST_Node)) { + if (cond) self.condition = null; + else if (!compressor.option("dead_code")) { + var orig = self.condition; + self.condition = make_node_from_constant(cond, self.condition); + self.condition = best_of_expression(self.condition.transform(compressor), orig); + } + } + if (compressor.option("dead_code")) { + if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor); + if (!cond) { + var body = []; + extract_declarations_from_unreachable_code(compressor, self.body, body); + if (self.init instanceof AST_Statement) { + body.push(self.init); + } else if (self.init) { + body.push(make_node(AST_SimpleStatement, self.init, { + body: self.init + })); + } + body.push(make_node(AST_SimpleStatement, self.condition, { + body: self.condition + })); + return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); + } + } + } + return if_break_in_loop(self, compressor); + }); + + OPT(AST_If, function(self, compressor) { + if (is_empty(self.alternative)) self.alternative = null; + + if (!compressor.option("conditionals")) return self; + // if condition can be statically determined, warn and drop + // one of the blocks. note, statically determined implies + // “has no side effects”; also it doesn't work for cases like + // `x && true`, though it probably should. + var cond = self.condition.evaluate(compressor); + if (!compressor.option("dead_code") && !(cond instanceof AST_Node)) { + var orig = self.condition; + self.condition = make_node_from_constant(cond, orig); + self.condition = best_of_expression(self.condition.transform(compressor), orig); + } + if (compressor.option("dead_code")) { + if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor); + if (!cond) { + compressor.warn("Condition always false [{file}:{line},{col}]", self.condition.start); + var body = []; + extract_declarations_from_unreachable_code(compressor, self.body, body); + body.push(make_node(AST_SimpleStatement, self.condition, { + body: self.condition + })); + if (self.alternative) body.push(self.alternative); + return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); + } else if (!(cond instanceof AST_Node)) { + compressor.warn("Condition always true [{file}:{line},{col}]", self.condition.start); + var body = []; + if (self.alternative) { + extract_declarations_from_unreachable_code(compressor, self.alternative, body); + } + body.push(make_node(AST_SimpleStatement, self.condition, { + body: self.condition + })); + body.push(self.body); + return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); + } + } + var negated = self.condition.negate(compressor); + var self_condition_length = self.condition.print_to_string().length; + var negated_length = negated.print_to_string().length; + var negated_is_best = negated_length < self_condition_length; + if (self.alternative && negated_is_best) { + negated_is_best = false; // because we already do the switch here. + // no need to swap values of self_condition_length and negated_length + // here because they are only used in an equality comparison later on. + self.condition = negated; + var tmp = self.body; + self.body = self.alternative || make_node(AST_EmptyStatement, self); + self.alternative = tmp; + } + if (is_empty(self.body) && is_empty(self.alternative)) { + return make_node(AST_SimpleStatement, self.condition, { + body: self.condition.clone() + }).optimize(compressor); + } + if (self.body instanceof AST_SimpleStatement + && self.alternative instanceof AST_SimpleStatement) { + return make_node(AST_SimpleStatement, self, { + body: make_node(AST_Conditional, self, { + condition : self.condition, + consequent : self.body.body, + alternative : self.alternative.body + }) + }).optimize(compressor); + } + if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) { + if (self_condition_length === negated_length && !negated_is_best + && self.condition instanceof AST_Binary && self.condition.operator == "||") { + // although the code length of self.condition and negated are the same, + // negated does not require additional surrounding parentheses. + // see https://github.com/mishoo/UglifyJS2/issues/979 + negated_is_best = true; + } + if (negated_is_best) return make_node(AST_SimpleStatement, self, { + body: make_node(AST_Binary, self, { + operator : "||", + left : negated, + right : self.body.body + }) + }).optimize(compressor); + return make_node(AST_SimpleStatement, self, { + body: make_node(AST_Binary, self, { + operator : "&&", + left : self.condition, + right : self.body.body + }) + }).optimize(compressor); + } + if (self.body instanceof AST_EmptyStatement + && self.alternative instanceof AST_SimpleStatement) { + return make_node(AST_SimpleStatement, self, { + body: make_node(AST_Binary, self, { + operator : "||", + left : self.condition, + right : self.alternative.body + }) + }).optimize(compressor); + } + if (self.body instanceof AST_Exit + && self.alternative instanceof AST_Exit + && self.body.TYPE == self.alternative.TYPE) { + return make_node(self.body.CTOR, self, { + value: make_node(AST_Conditional, self, { + condition : self.condition, + consequent : self.body.value || make_node(AST_Undefined, self.body), + alternative : self.alternative.value || make_node(AST_Undefined, self.alternative) + }).transform(compressor) + }).optimize(compressor); + } + if (self.body instanceof AST_If + && !self.body.alternative + && !self.alternative) { + self = make_node(AST_If, self, { + condition: make_node(AST_Binary, self.condition, { + operator: "&&", + left: self.condition, + right: self.body.condition + }), + body: self.body.body, + alternative: null + }); + } + if (aborts(self.body)) { + if (self.alternative) { + var alt = self.alternative; + self.alternative = null; + return make_node(AST_BlockStatement, self, { + body: [ self, alt ] + }).optimize(compressor); + } + } + if (aborts(self.alternative)) { + var body = self.body; + self.body = self.alternative; + self.condition = negated_is_best ? negated : self.condition.negate(compressor); + self.alternative = null; + return make_node(AST_BlockStatement, self, { + body: [ self, body ] + }).optimize(compressor); + } + return self; + }); + + OPT(AST_Switch, function(self, compressor) { + if (!compressor.option("switches")) return self; + var branch; + var value = self.expression.evaluate(compressor); + if (!(value instanceof AST_Node)) { + var orig = self.expression; + self.expression = make_node_from_constant(value, orig); + self.expression = best_of_expression(self.expression.transform(compressor), orig); + } + if (!compressor.option("dead_code")) return self; + if (value instanceof AST_Node) { + value = self.expression.tail_node().evaluate(compressor); + } + var decl = []; + var body = []; + var default_branch; + var exact_match; + for (var i = 0, len = self.body.length; i < len && !exact_match; i++) { + branch = self.body[i]; + if (branch instanceof AST_Default) { + if (!default_branch) { + default_branch = branch; + } else { + eliminate_branch(branch, body[body.length - 1]); + } + } else if (!(value instanceof AST_Node)) { + var exp = branch.expression.evaluate(compressor); + if (!(exp instanceof AST_Node) && exp !== value) { + eliminate_branch(branch, body[body.length - 1]); + continue; + } + if (exp instanceof AST_Node) exp = branch.expression.tail_node().evaluate(compressor); + if (exp === value) { + exact_match = branch; + if (default_branch) { + var default_index = body.indexOf(default_branch); + body.splice(default_index, 1); + eliminate_branch(default_branch, body[default_index - 1]); + default_branch = null; + } + } + } + if (aborts(branch)) { + var prev = body[body.length - 1]; + if (aborts(prev) && prev.body.length == branch.body.length + && make_node(AST_BlockStatement, prev, prev).equivalent_to(make_node(AST_BlockStatement, branch, branch))) { + prev.body = []; + } + } + body.push(branch); + } + while (i < len) eliminate_branch(self.body[i++], body[body.length - 1]); + if (body.length > 0) { + body[0].body = decl.concat(body[0].body); + } + self.body = body; + while (branch = body[body.length - 1]) { + var stat = branch.body[branch.body.length - 1]; + if (stat instanceof AST_Break && compressor.loopcontrol_target(stat) === self) + branch.body.pop(); + if (branch.body.length || branch instanceof AST_Case + && (default_branch || branch.expression.has_side_effects(compressor))) break; + if (body.pop() === default_branch) default_branch = null; + } + if (body.length == 0) { + return make_node(AST_BlockStatement, self, { + body: decl.concat(make_node(AST_SimpleStatement, self.expression, { + body: self.expression + })) + }).optimize(compressor); + } + if (body.length == 1 && (body[0] === exact_match || body[0] === default_branch)) { + var has_break = false; + var tw = new TreeWalker(function(node) { + if (has_break + || node instanceof AST_Lambda + || node instanceof AST_SimpleStatement) return true; + if (node instanceof AST_Break && tw.loopcontrol_target(node) === self) + has_break = true; + }); + self.walk(tw); + if (!has_break) { + var statements = body[0].body.slice(); + var exp = body[0].expression; + if (exp) statements.unshift(make_node(AST_SimpleStatement, exp, { + body: exp + })); + statements.unshift(make_node(AST_SimpleStatement, self.expression, { + body:self.expression + })); + return make_node(AST_BlockStatement, self, { + body: statements + }).optimize(compressor); + } + } + return self; + + function eliminate_branch(branch, prev) { + if (prev && !aborts(prev)) { + prev.body = prev.body.concat(branch.body); + } else { + extract_declarations_from_unreachable_code(compressor, branch, decl); + } + } + }); + + OPT(AST_Try, function(self, compressor) { + tighten_body(self.body, compressor); + if (self.bcatch && self.bfinally && all(self.bfinally.body, is_empty)) self.bfinally = null; + if (compressor.option("dead_code") && all(self.body, is_empty)) { + var body = []; + if (self.bcatch) { + extract_declarations_from_unreachable_code(compressor, self.bcatch, body); + body.forEach(function(stat) { + if (!(stat instanceof AST_Definitions)) return; + stat.definitions.forEach(function(var_def) { + var def = var_def.name.definition().redefined(); + if (!def) return; + var_def.name = var_def.name.clone(); + var_def.name.thedef = def; + }); + }); + } + if (self.bfinally) body = body.concat(self.bfinally.body); + return make_node(AST_BlockStatement, self, { + body: body + }).optimize(compressor); + } + return self; + }); + + AST_Definitions.DEFMETHOD("remove_initializers", function() { + var decls = []; + this.definitions.forEach(function(def) { + if (def.name instanceof AST_SymbolDeclaration) { + def.value = null; + decls.push(def); + } else def.name.walk(new TreeWalker(function(node) { + if (node instanceof AST_SymbolDeclaration) { + decls.push(make_node(AST_VarDef, def, { + name: node, + value: null + })); + } + })); + }); + this.definitions = decls; + }); + + AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { + var reduce_vars = compressor.option("reduce_vars"); + var assignments = this.definitions.reduce(function(a, def) { + if (def.value && !(def.name instanceof AST_Destructuring)) { + var name = make_node(AST_SymbolRef, def.name, def.name); + a.push(make_node(AST_Assign, def, { + operator : "=", + left : name, + right : def.value + })); + if (reduce_vars) name.definition().fixed = false; + } else if (def.value) { + // Because it's a destructuring, do not turn into an assignment. + var varDef = make_node(AST_VarDef, def, { + name: def.name, + value: def.value + }); + var var_ = make_node(AST_Var, def, { + definitions: [ varDef ] + }); + a.push(var_); + } + def = def.name.definition(); + def.eliminated++; + def.replaced--; + return a; + }, []); + if (assignments.length == 0) return null; + return make_sequence(this, assignments); + }); + + OPT(AST_Definitions, function(self, compressor) { + if (self.definitions.length == 0) + return make_node(AST_EmptyStatement, self); + return self; + }); + + OPT(AST_Import, function(self, compressor) { + return self; + }); + + function retain_top_func(fn, compressor) { + return compressor.top_retain + && fn instanceof AST_Defun + && fn._top + && fn.name + && compressor.top_retain(fn.name); + } + + OPT(AST_Call, function(self, compressor) { + var exp = self.expression; + var fn = exp; + var simple_args = all(self.args, function(arg) { + return !(arg instanceof AST_Expansion); + }); + if (compressor.option("reduce_vars") && fn instanceof AST_SymbolRef) { + fn = fn.fixed_value(); + if (retain_top_func(fn, compressor)) fn = exp; + } + var is_func = fn instanceof AST_Lambda; + if (compressor.option("unused") + && simple_args + && is_func + && !fn.uses_arguments + && !fn.pinned()) { + var pos = 0, last = 0; + for (var i = 0, len = self.args.length; i < len; i++) { + if (fn.argnames[i] instanceof AST_Expansion) { + if (fn.argnames[i].expression.__unused) while (i < len) { + var node = self.args[i++].drop_side_effect_free(compressor); + if (node) { + self.args[pos++] = node; + } + } else while (i < len) { + self.args[pos++] = self.args[i++]; + } + last = pos; + break; + } + var trim = i >= fn.argnames.length; + if (trim || fn.argnames[i].__unused) { + var node = self.args[i].drop_side_effect_free(compressor); + if (node) { + self.args[pos++] = node; + } else if (!trim) { + self.args[pos++] = make_node(AST_Number, self.args[i], { + value: 0 + }); + continue; + } + } else { + self.args[pos++] = self.args[i]; + } + last = pos; + } + self.args.length = last; + } + if (compressor.option("unsafe")) { + if (is_undeclared_ref(exp)) switch (exp.name) { + case "Array": + if (self.args.length != 1) { + return make_node(AST_Array, self, { + elements: self.args + }).optimize(compressor); + } + break; + case "Object": + if (self.args.length == 0) { + return make_node(AST_Object, self, { + properties: [] + }); + } + break; + case "String": + if (self.args.length == 0) return make_node(AST_String, self, { + value: "" + }); + if (self.args.length <= 1) return make_node(AST_Binary, self, { + left: self.args[0], + operator: "+", + right: make_node(AST_String, self, { value: "" }) + }).optimize(compressor); + break; + case "Number": + if (self.args.length == 0) return make_node(AST_Number, self, { + value: 0 + }); + if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, { + expression: self.args[0], + operator: "+" + }).optimize(compressor); + case "Boolean": + if (self.args.length == 0) return make_node(AST_False, self); + if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, { + expression: make_node(AST_UnaryPrefix, self, { + expression: self.args[0], + operator: "!" + }), + operator: "!" + }).optimize(compressor); + break; + case "RegExp": + var params = []; + if (all(self.args, function(arg) { + var value = arg.evaluate(compressor); + params.unshift(value); + return arg !== value; + })) { + try { + return best_of(compressor, self, make_node(AST_RegExp, self, { + value: RegExp.apply(RegExp, params), + })); + } catch (ex) { + compressor.warn("Error converting {expr} [{file}:{line},{col}]", { + expr: self.print_to_string(), + file: self.start.file, + line: self.start.line, + col: self.start.col + }); + } + } + break; + } else if (exp instanceof AST_Dot) switch(exp.property) { + case "toString": + if (self.args.length == 0 && !exp.expression.may_throw_on_access(compressor)) { + return make_node(AST_Binary, self, { + left: make_node(AST_String, self, { value: "" }), + operator: "+", + right: exp.expression + }).optimize(compressor); + } + break; + case "join": + if (exp.expression instanceof AST_Array) EXIT: { + var separator; + if (self.args.length > 0) { + separator = self.args[0].evaluate(compressor); + if (separator === self.args[0]) break EXIT; // not a constant + } + var elements = []; + var consts = []; + for (var i = 0, len = exp.expression.elements.length; i < len; i++) { + var el = exp.expression.elements[i]; + if (el instanceof AST_Expansion) break EXIT; + var value = el.evaluate(compressor); + if (value !== el) { + consts.push(value); + } else { + if (consts.length > 0) { + elements.push(make_node(AST_String, self, { + value: consts.join(separator) + })); + consts.length = 0; + } + elements.push(el); + } + } + if (consts.length > 0) { + elements.push(make_node(AST_String, self, { + value: consts.join(separator) + })); + } + if (elements.length == 0) return make_node(AST_String, self, { value: "" }); + if (elements.length == 1) { + if (elements[0].is_string(compressor)) { + return elements[0]; + } + return make_node(AST_Binary, elements[0], { + operator : "+", + left : make_node(AST_String, self, { value: "" }), + right : elements[0] + }); + } + if (separator == "") { + var first; + if (elements[0].is_string(compressor) + || elements[1].is_string(compressor)) { + first = elements.shift(); + } else { + first = make_node(AST_String, self, { value: "" }); + } + return elements.reduce(function(prev, el) { + return make_node(AST_Binary, el, { + operator : "+", + left : prev, + right : el + }); + }, first).optimize(compressor); + } + // need this awkward cloning to not affect original element + // best_of will decide which one to get through. + var node = self.clone(); + node.expression = node.expression.clone(); + node.expression.expression = node.expression.expression.clone(); + node.expression.expression.elements = elements; + return best_of(compressor, self, node); + } + break; + case "charAt": + if (exp.expression.is_string(compressor)) { + var arg = self.args[0]; + var index = arg ? arg.evaluate(compressor) : 0; + if (index !== arg) { + return make_node(AST_Sub, exp, { + expression: exp.expression, + property: make_node_from_constant(index | 0, arg || exp) + }).optimize(compressor); + } + } + break; + case "apply": + if (self.args.length == 2 && self.args[1] instanceof AST_Array) { + var args = self.args[1].elements.slice(); + args.unshift(self.args[0]); + return make_node(AST_Call, self, { + expression: make_node(AST_Dot, exp, { + expression: exp.expression, + property: "call" + }), + args: args + }).optimize(compressor); + } + break; + case "call": + var func = exp.expression; + if (func instanceof AST_SymbolRef) { + func = func.fixed_value(); + } + if (func instanceof AST_Lambda && !func.contains_this()) { + return (self.args.length ? make_sequence(this, [ + self.args[0], + make_node(AST_Call, self, { + expression: exp.expression, + args: self.args.slice(1) + }) + ]) : make_node(AST_Call, self, { + expression: exp.expression, + args: [] + })).optimize(compressor); + } + break; + } + } + if (compressor.option("unsafe_Function") + && is_undeclared_ref(exp) + && exp.name == "Function") { + // new Function() => function(){} + if (self.args.length == 0) return make_node(AST_Function, self, { + argnames: [], + body: [] + }).optimize(compressor); + if (all(self.args, function(x) { + return x instanceof AST_String; + })) { + // quite a corner-case, but we can handle it: + // https://github.com/mishoo/UglifyJS2/issues/203 + // if the code argument is a constant, then we can minify it. + try { + var code = "n(function(" + self.args.slice(0, -1).map(function(arg) { + return arg.value; + }).join(",") + "){" + self.args[self.args.length - 1].value + "})"; + var ast = parse(code); + var mangle = { ie8: compressor.option("ie8") }; + ast.figure_out_scope(mangle); + var comp = new Compressor(compressor.options); + ast = ast.transform(comp); + ast.figure_out_scope(mangle); + base54.reset(); + ast.compute_char_frequency(mangle); + ast.mangle_names(mangle); + var fun; + ast.walk(new TreeWalker(function(node) { + if (fun) return true; + if (is_func_expr(node)) { + fun = node; + return true; + } + })); + if (fun.body instanceof AST_Node) { + fun.body = [ + make_node(AST_Return, fun.body, { + value: fun.body + }) + ]; + } + var code = OutputStream(); + AST_BlockStatement.prototype._codegen.call(fun, fun, code); + self.args = [ + make_node(AST_String, self, { + value: fun.argnames.map(function(arg) { + return arg.print_to_string(); + }).join(",") + }), + make_node(AST_String, self.args[self.args.length - 1], { + value: code.get().replace(/^\{|\}$/g, "") + }) + ]; + return self; + } catch (ex) { + if (ex instanceof JS_Parse_Error) { + compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]", self.args[self.args.length - 1].start); + compressor.warn(ex.toString()); + } else { + throw ex; + } + } + } + } + var stat = is_func && fn.body; + if (stat instanceof AST_Node) { + stat = make_node(AST_Return, stat, { + value: stat + }); + } else if (stat) { + stat = stat[0]; + } + var is_regular_func = is_func && !fn.is_generator && !fn.async; + var can_inline = compressor.option("inline") && !self.is_expr_pure(compressor); + if (can_inline && stat instanceof AST_Return && is_regular_func) { + var value = stat.value; + if (!value || value.is_constant_expression()) { + if (value) { + value = value.clone(true); + } else { + value = make_node(AST_Undefined, self); + } + var args = self.args.concat(value); + return make_sequence(self, args).optimize(compressor); + } + } + if (is_regular_func) { + var def, value, scope, in_loop, level = -1; + if (can_inline + && simple_args + && !fn.uses_arguments + && !fn.pinned() + && !(compressor.parent() instanceof AST_Class) + && !(fn.name && fn instanceof AST_Function) + && (!(compressor.find_parent(AST_Lambda) instanceof AST_Arrow) + || fn.argnames.length == 0 + && (fn.body instanceof AST_Node || fn.body.length == 1)) + && (value = can_flatten_body(stat)) + && (exp === fn + || compressor.option("unused") + && (def = exp.definition()).references.length == 1 + && !recursive_ref(compressor, def) + && fn.is_constant_expression(exp.scope)) + && !self.pure + && !fn.contains_this() + && can_inject_symbols() + && !(scope instanceof AST_Class)) { + fn._squeezed = true; + return make_sequence(self, flatten_fn()).optimize(compressor); + } + if (compressor.option("side_effects") && !(fn.body instanceof AST_Node) && all(fn.body, is_empty)) { + var args = self.args.concat(make_node(AST_Undefined, self)); + return make_sequence(self, args).optimize(compressor); + } + } + if (compressor.option("negate_iife") + && compressor.parent() instanceof AST_SimpleStatement + && is_iife_call(self)) { + return self.negate(compressor, true); + } + var ev = self.evaluate(compressor); + if (ev !== self) { + ev = make_node_from_constant(ev, self).optimize(compressor); + return best_of(compressor, ev, self); + } + return self; + + function return_value(stat) { + if (!stat) return make_node(AST_Undefined, self); + if (stat instanceof AST_Return) { + if (!stat.value) return make_node(AST_Undefined, self); + return stat.value.clone(true); + } + if (stat instanceof AST_SimpleStatement) { + return make_node(AST_UnaryPrefix, stat, { + operator: "void", + expression: stat.body.clone(true) + }); + } + } + + function can_flatten_body(stat) { + var body = fn.body instanceof AST_Node ? [ fn.body ] : fn.body; + var len = body.length; + if (compressor.option("inline") < 3) { + return len == 1 && return_value(stat); + } + stat = null; + for (var i = 0; i < len; i++) { + var line = body[i]; + if (line instanceof AST_Var) { + if (stat && !all(line.definitions, function(var_def) { + return !var_def.value; + })) { + return false; + } + } else if (stat) { + return false; + } else { + stat = line; + } + } + return return_value(stat); + } + + function can_inject_args(block_scoped, safe_to_inject) { + for (var i = 0, len = fn.argnames.length; i < len; i++) { + var arg = fn.argnames[i]; + if (arg instanceof AST_DefaultAssign) { + if (arg.left.__unused) continue; + return false; + } + if (arg instanceof AST_Destructuring) return false; + if (arg instanceof AST_Expansion) { + if (arg.expression.__unused) continue; + return false; + } + if (arg.__unused) continue; + if (!safe_to_inject + || block_scoped[arg.name] + || identifier_atom(arg.name) + || scope.var_names()[arg.name]) { + return false; + } + if (in_loop) in_loop.push(arg.definition()); + } + return true; + } + + function can_inject_vars(block_scoped, safe_to_inject) { + var len = fn.body.length; + for (var i = 0; i < len; i++) { + var stat = fn.body[i]; + if (!(stat instanceof AST_Var)) continue; + if (!safe_to_inject) return false; + for (var j = stat.definitions.length; --j >= 0;) { + var name = stat.definitions[j].name; + if (name instanceof AST_Destructuring + || block_scoped[name.name] + || identifier_atom(name.name) + || scope.var_names()[name.name]) { + return false; + } + if (in_loop) in_loop.push(name.definition()); + } + } + return true; + } + + function can_inject_symbols() { + var block_scoped = Object.create(null); + do { + scope = compressor.parent(++level); + if (scope.is_block_scope() && !(compressor.parent(level - 1) instanceof AST_Scope)) { + if (scope.block_scope) { + // TODO this is sometimes undefined during compression. + // But it should always have a value! + scope.block_scope.variables.each(function (variable) { + block_scoped[variable.name] = true; + }); + } + } + if (scope instanceof AST_Catch) { + if (scope.argname) { + block_scoped[scope.argname.name] = true; + } + } else if (scope instanceof AST_IterationStatement) { + in_loop = []; + } else if (scope instanceof AST_SymbolRef) { + if (scope.fixed_value() instanceof AST_Scope) return false; + } + } while (!(scope instanceof AST_Scope) || scope instanceof AST_Arrow); + var safe_to_inject = !(scope instanceof AST_Toplevel) || compressor.toplevel.vars; + var inline = compressor.option("inline"); + if (!can_inject_vars(block_scoped, inline >= 3 && safe_to_inject)) return false; + if (!can_inject_args(block_scoped, inline >= 2 && safe_to_inject)) return false; + return !in_loop || in_loop.length == 0 || !is_reachable(fn, in_loop); + } + + function append_var(decls, expressions, name, value) { + var def = name.definition(); + scope.variables.set(name.name, def); + scope.enclosed.push(def); + if (!scope.var_names()[name.name]) { + scope.var_names()[name.name] = true; + decls.push(make_node(AST_VarDef, name, { + name: name, + value: null + })); + } + var sym = make_node(AST_SymbolRef, name, name); + def.references.push(sym); + if (value) expressions.push(make_node(AST_Assign, self, { + operator: "=", + left: sym, + right: value.clone() + })); + } + + function flatten_args(decls, expressions) { + var len = fn.argnames.length; + for (var i = self.args.length; --i >= len;) { + expressions.push(self.args[i]); + } + for (i = len; --i >= 0;) { + var name = fn.argnames[i]; + var value = self.args[i]; + if (name.__unused || !name.name || scope.var_names()[name.name]) { + if (value) expressions.push(value); + } else { + var symbol = make_node(AST_SymbolVar, name, name); + name.definition().orig.push(symbol); + if (!value && in_loop) value = make_node(AST_Undefined, self); + append_var(decls, expressions, symbol, value); + } + } + decls.reverse(); + expressions.reverse(); + } + + function flatten_vars(decls, expressions) { + var pos = expressions.length; + for (var i = 0, lines = fn.body.length; i < lines; i++) { + var stat = fn.body[i]; + if (!(stat instanceof AST_Var)) continue; + for (var j = 0, defs = stat.definitions.length; j < defs; j++) { + var var_def = stat.definitions[j]; + var name = var_def.name; + append_var(decls, expressions, name, var_def.value); + if (in_loop && all(fn.argnames, function(argname) { + return argname.name != name.name; + })) { + var def = fn.variables.get(name.name); + var sym = make_node(AST_SymbolRef, name, name); + def.references.push(sym); + expressions.splice(pos++, 0, make_node(AST_Assign, var_def, { + operator: "=", + left: sym, + right: make_node(AST_Undefined, name) + })); + } + } + } + } + + function flatten_fn() { + var decls = []; + var expressions = []; + flatten_args(decls, expressions); + flatten_vars(decls, expressions); + expressions.push(value); + if (decls.length) { + i = scope.body.indexOf(compressor.parent(level - 1)) + 1; + scope.body.splice(i, 0, make_node(AST_Var, fn, { + definitions: decls + })); + } + return expressions; + } + }); + + OPT(AST_New, function(self, compressor) { + if (compressor.option("unsafe")) { + var exp = self.expression; + if (is_undeclared_ref(exp)) { + switch (exp.name) { + case "Object": + case "RegExp": + case "Function": + case "Error": + case "Array": + return make_node(AST_Call, self, self).transform(compressor); + } + } + } + return self; + }); + + OPT(AST_Sequence, function(self, compressor) { + if (!compressor.option("side_effects")) return self; + var expressions = []; + filter_for_side_effects(); + var end = expressions.length - 1; + trim_right_for_undefined(); + if (end == 0) { + self = maintain_this_binding(compressor.parent(), compressor.self(), expressions[0]); + if (!(self instanceof AST_Sequence)) self = self.optimize(compressor); + return self; + } + self.expressions = expressions; + return self; + + function filter_for_side_effects() { + var first = first_in_statement(compressor); + var last = self.expressions.length - 1; + self.expressions.forEach(function(expr, index) { + if (index < last) expr = expr.drop_side_effect_free(compressor, first); + if (expr) { + merge_sequence(expressions, expr); + first = false; + } + }); + } + + function trim_right_for_undefined() { + while (end > 0 && is_undefined(expressions[end], compressor)) end--; + if (end < expressions.length - 1) { + expressions[end] = make_node(AST_UnaryPrefix, self, { + operator : "void", + expression : expressions[end] + }); + expressions.length = end + 1; + } + } + }); + + AST_Unary.DEFMETHOD("lift_sequences", function(compressor) { + if (compressor.option("sequences")) { + if (this.expression instanceof AST_Sequence) { + var x = this.expression.expressions.slice(); + var e = this.clone(); + e.expression = x.pop(); + x.push(e); + return make_sequence(this, x).optimize(compressor); + } + } + return this; + }); + + OPT(AST_UnaryPostfix, function(self, compressor) { + return self.lift_sequences(compressor); + }); + + OPT(AST_UnaryPrefix, function(self, compressor) { + var e = self.expression; + if (self.operator == "delete" + && !(e instanceof AST_SymbolRef + || e instanceof AST_PropAccess + || is_identifier_atom(e))) { + if (e instanceof AST_Sequence) { + e = e.expressions.slice(); + e.push(make_node(AST_True, self)); + return make_sequence(self, e).optimize(compressor); + } + return make_sequence(self, [ e, make_node(AST_True, self) ]).optimize(compressor); + } + var seq = self.lift_sequences(compressor); + if (seq !== self) { + return seq; + } + if (compressor.option("side_effects") && self.operator == "void") { + e = e.drop_side_effect_free(compressor); + if (e) { + self.expression = e; + return self; + } else { + return make_node(AST_Undefined, self).optimize(compressor); + } + } + if (compressor.in_boolean_context()) { + switch (self.operator) { + case "!": + if (e instanceof AST_UnaryPrefix && e.operator == "!") { + // !!foo ==> foo, if we're in boolean context + return e.expression; + } + if (e instanceof AST_Binary) { + self = best_of(compressor, self, e.negate(compressor, first_in_statement(compressor))); + } + break; + case "typeof": + // typeof always returns a non-empty string, thus it's + // always true in booleans + compressor.warn("Boolean expression always true [{file}:{line},{col}]", self.start); + return (e instanceof AST_SymbolRef ? make_node(AST_True, self) : make_sequence(self, [ + e, + make_node(AST_True, self) + ])).optimize(compressor); + } + } + if (self.operator == "-" && e instanceof AST_Infinity) { + e = e.transform(compressor); + } + if (e instanceof AST_Binary + && (self.operator == "+" || self.operator == "-") + && (e.operator == "*" || e.operator == "/" || e.operator == "%")) { + return make_node(AST_Binary, self, { + operator: e.operator, + left: make_node(AST_UnaryPrefix, e.left, { + operator: self.operator, + expression: e.left + }), + right: e.right + }); + } + // avoids infinite recursion of numerals + if (self.operator != "-" + || !(e instanceof AST_Number || e instanceof AST_Infinity)) { + var ev = self.evaluate(compressor); + if (ev !== self) { + ev = make_node_from_constant(ev, self).optimize(compressor); + return best_of(compressor, ev, self); + } + } + return self; + }); + + AST_Binary.DEFMETHOD("lift_sequences", function(compressor) { + if (compressor.option("sequences")) { + if (this.left instanceof AST_Sequence) { + var x = this.left.expressions.slice(); + var e = this.clone(); + e.left = x.pop(); + x.push(e); + return make_sequence(this, x).optimize(compressor); + } + if (this.right instanceof AST_Sequence && !this.left.has_side_effects(compressor)) { + var assign = this.operator == "=" && this.left instanceof AST_SymbolRef; + var x = this.right.expressions; + var last = x.length - 1; + for (var i = 0; i < last; i++) { + if (!assign && x[i].has_side_effects(compressor)) break; + } + if (i == last) { + x = x.slice(); + var e = this.clone(); + e.right = x.pop(); + x.push(e); + return make_sequence(this, x).optimize(compressor); + } else if (i > 0) { + var e = this.clone(); + e.right = make_sequence(this.right, x.slice(i)); + x = x.slice(0, i); + x.push(e); + return make_sequence(this, x).optimize(compressor); + } + } + } + return this; + }); + + var commutativeOperators = makePredicate("== === != !== * & | ^"); + function is_object(node) { + return node instanceof AST_Array + || node instanceof AST_Lambda + || node instanceof AST_Object + || node instanceof AST_Class; + } + + OPT(AST_Binary, function(self, compressor) { + function reversible() { + return self.left.is_constant() + || self.right.is_constant() + || !self.left.has_side_effects(compressor) + && !self.right.has_side_effects(compressor); + } + function reverse(op) { + if (reversible()) { + if (op) self.operator = op; + var tmp = self.left; + self.left = self.right; + self.right = tmp; + } + } + if (commutativeOperators(self.operator)) { + if (self.right.is_constant() + && !self.left.is_constant()) { + // if right is a constant, whatever side effects the + // left side might have could not influence the + // result. hence, force switch. + + if (!(self.left instanceof AST_Binary + && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { + reverse(); + } + } + } + self = self.lift_sequences(compressor); + if (compressor.option("comparisons")) switch (self.operator) { + case "===": + case "!==": + var is_strict_comparison = true; + if ((self.left.is_string(compressor) && self.right.is_string(compressor)) || + (self.left.is_number(compressor) && self.right.is_number(compressor)) || + (self.left.is_boolean() && self.right.is_boolean()) || + self.left.equivalent_to(self.right)) { + self.operator = self.operator.substr(0, 2); + } + // XXX: intentionally falling down to the next case + case "==": + case "!=": + // void 0 == x => null == x + if (!is_strict_comparison && is_undefined(self.left, compressor)) { + self.left = make_node(AST_Null, self.left); + } else if (compressor.option("typeofs") + // "undefined" == typeof x => undefined === x + && self.left instanceof AST_String + && self.left.value == "undefined" + && self.right instanceof AST_UnaryPrefix + && self.right.operator == "typeof") { + var expr = self.right.expression; + if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) + : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) { + self.right = expr; + self.left = make_node(AST_Undefined, self.left).optimize(compressor); + if (self.operator.length == 2) self.operator += "="; + } + } else if (self.left instanceof AST_SymbolRef + // obj !== obj => false + && self.right instanceof AST_SymbolRef + && self.left.definition() === self.right.definition() + && is_object(self.left.fixed_value())) { + return make_node(self.operator[0] == "=" ? AST_True : AST_False, self); + } + break; + case "&&": + case "||": + var lhs = self.left; + if (lhs.operator == self.operator) { + lhs = lhs.right; + } + if (lhs instanceof AST_Binary + && lhs.operator == (self.operator == "&&" ? "!==" : "===") + && self.right instanceof AST_Binary + && lhs.operator == self.right.operator + && (is_undefined(lhs.left, compressor) && self.right.left instanceof AST_Null + || lhs.left instanceof AST_Null && is_undefined(self.right.left, compressor)) + && !lhs.right.has_side_effects(compressor) + && lhs.right.equivalent_to(self.right.right)) { + var combined = make_node(AST_Binary, self, { + operator: lhs.operator.slice(0, -1), + left: make_node(AST_Null, self), + right: lhs.right + }); + if (lhs !== self.left) { + combined = make_node(AST_Binary, self, { + operator: self.operator, + left: self.left.left, + right: combined + }); + } + return combined; + } + break; + } + if (self.operator == "+" && compressor.in_boolean_context()) { + var ll = self.left.evaluate(compressor); + var rr = self.right.evaluate(compressor); + if (ll && typeof ll == "string") { + compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start); + return make_sequence(self, [ + self.right, + make_node(AST_True, self) + ]).optimize(compressor); + } + if (rr && typeof rr == "string") { + compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start); + return make_sequence(self, [ + self.left, + make_node(AST_True, self) + ]).optimize(compressor); + } + } + if (compressor.option("comparisons") && self.is_boolean()) { + if (!(compressor.parent() instanceof AST_Binary) + || compressor.parent() instanceof AST_Assign) { + var negated = make_node(AST_UnaryPrefix, self, { + operator: "!", + expression: self.negate(compressor, first_in_statement(compressor)) + }); + self = best_of(compressor, self, negated); + } + if (compressor.option("unsafe_comps")) { + switch (self.operator) { + case "<": reverse(">"); break; + case "<=": reverse(">="); break; + } + } + } + if (self.operator == "+") { + if (self.right instanceof AST_String + && self.right.getValue() == "" + && self.left.is_string(compressor)) { + return self.left; + } + if (self.left instanceof AST_String + && self.left.getValue() == "" + && self.right.is_string(compressor)) { + return self.right; + } + if (self.left instanceof AST_Binary + && self.left.operator == "+" + && self.left.left instanceof AST_String + && self.left.left.getValue() == "" + && self.right.is_string(compressor)) { + self.left = self.left.right; + return self.transform(compressor); + } + } + if (compressor.option("evaluate")) { + switch (self.operator) { + case "&&": + var ll = self.left.truthy ? true : self.left.falsy ? false : self.left.evaluate(compressor); + if (!ll) { + compressor.warn("Condition left of && always false [{file}:{line},{col}]", self.start); + return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor); + } else if (!(ll instanceof AST_Node)) { + compressor.warn("Condition left of && always true [{file}:{line},{col}]", self.start); + return make_sequence(self, [ self.left, self.right ]).optimize(compressor); + } + var rr = self.right.evaluate(compressor); + if (!rr) { + if (compressor.in_boolean_context()) { + compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start); + return make_sequence(self, [ + self.left, + make_node(AST_False, self) + ]).optimize(compressor); + } else self.falsy = true; + } else if (!(rr instanceof AST_Node)) { + var parent = compressor.parent(); + if (parent.operator == "&&" && parent.left === compressor.self() || compressor.in_boolean_context()) { + compressor.warn("Dropping side-effect-free && [{file}:{line},{col}]", self.start); + return self.left.optimize(compressor); + } + } + // x || false && y ---> x ? y : false + if (self.left.operator == "||") { + var lr = self.left.right.evaluate(compressor); + if (!lr) return make_node(AST_Conditional, self, { + condition: self.left.left, + consequent: self.right, + alternative: self.left.right + }).optimize(compressor); + } + break; + case "||": + var ll = self.left.truthy ? true : self.left.falsy ? false : self.left.evaluate(compressor); + if (!ll) { + compressor.warn("Condition left of || always false [{file}:{line},{col}]", self.start); + return make_sequence(self, [ self.left, self.right ]).optimize(compressor); + } else if (!(ll instanceof AST_Node)) { + compressor.warn("Condition left of || always true [{file}:{line},{col}]", self.start); + return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor); + } + var rr = self.right.evaluate(compressor); + if (!rr) { + var parent = compressor.parent(); + if (parent.operator == "||" && parent.left === compressor.self() || compressor.in_boolean_context()) { + compressor.warn("Dropping side-effect-free || [{file}:{line},{col}]", self.start); + return self.left.optimize(compressor); + } + } else if (!(rr instanceof AST_Node)) { + if (compressor.in_boolean_context()) { + compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start); + return make_sequence(self, [ + self.left, + make_node(AST_True, self) + ]).optimize(compressor); + } else self.truthy = true; + } + if (self.left.operator == "&&") { + var lr = self.left.right.evaluate(compressor); + if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, { + condition: self.left.left, + consequent: self.left.right, + alternative: self.right + }).optimize(compressor); + } + break; + } + var associative = true; + switch (self.operator) { + case "+": + // "foo" + ("bar" + x) => "foobar" + x + if (self.left instanceof AST_Constant + && self.right instanceof AST_Binary + && self.right.operator == "+" + && self.right.left instanceof AST_Constant + && self.right.is_string(compressor)) { + self = make_node(AST_Binary, self, { + operator: "+", + left: make_node(AST_String, self.left, { + value: "" + self.left.getValue() + self.right.left.getValue(), + start: self.left.start, + end: self.right.left.end + }), + right: self.right.right + }); + } + // (x + "foo") + "bar" => x + "foobar" + if (self.right instanceof AST_Constant + && self.left instanceof AST_Binary + && self.left.operator == "+" + && self.left.right instanceof AST_Constant + && self.left.is_string(compressor)) { + self = make_node(AST_Binary, self, { + operator: "+", + left: self.left.left, + right: make_node(AST_String, self.right, { + value: "" + self.left.right.getValue() + self.right.getValue(), + start: self.left.right.start, + end: self.right.end + }) + }); + } + // (x + "foo") + ("bar" + y) => (x + "foobar") + y + if (self.left instanceof AST_Binary + && self.left.operator == "+" + && self.left.is_string(compressor) + && self.left.right instanceof AST_Constant + && self.right instanceof AST_Binary + && self.right.operator == "+" + && self.right.left instanceof AST_Constant + && self.right.is_string(compressor)) { + self = make_node(AST_Binary, self, { + operator: "+", + left: make_node(AST_Binary, self.left, { + operator: "+", + left: self.left.left, + right: make_node(AST_String, self.left.right, { + value: "" + self.left.right.getValue() + self.right.left.getValue(), + start: self.left.right.start, + end: self.right.left.end + }) + }), + right: self.right.right + }); + } + // a + -b => a - b + if (self.right instanceof AST_UnaryPrefix + && self.right.operator == "-" + && self.left.is_number(compressor)) { + self = make_node(AST_Binary, self, { + operator: "-", + left: self.left, + right: self.right.expression + }); + break; + } + // -a + b => b - a + if (self.left instanceof AST_UnaryPrefix + && self.left.operator == "-" + && reversible() + && self.right.is_number(compressor)) { + self = make_node(AST_Binary, self, { + operator: "-", + left: self.right, + right: self.left.expression + }); + break; + } + case "*": + associative = compressor.option("unsafe_math"); + case "&": + case "|": + case "^": + // a + +b => +b + a + if (self.left.is_number(compressor) + && self.right.is_number(compressor) + && reversible() + && !(self.left instanceof AST_Binary + && self.left.operator != self.operator + && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { + var reversed = make_node(AST_Binary, self, { + operator: self.operator, + left: self.right, + right: self.left + }); + if (self.right instanceof AST_Constant + && !(self.left instanceof AST_Constant)) { + self = best_of(compressor, reversed, self); + } else { + self = best_of(compressor, self, reversed); + } + } + if (associative && self.is_number(compressor)) { + // a + (b + c) => (a + b) + c + if (self.right instanceof AST_Binary + && self.right.operator == self.operator) { + self = make_node(AST_Binary, self, { + operator: self.operator, + left: make_node(AST_Binary, self.left, { + operator: self.operator, + left: self.left, + right: self.right.left, + start: self.left.start, + end: self.right.left.end + }), + right: self.right.right + }); + } + // (n + 2) + 3 => 5 + n + // (2 * n) * 3 => 6 + n + if (self.right instanceof AST_Constant + && self.left instanceof AST_Binary + && self.left.operator == self.operator) { + if (self.left.left instanceof AST_Constant) { + self = make_node(AST_Binary, self, { + operator: self.operator, + left: make_node(AST_Binary, self.left, { + operator: self.operator, + left: self.left.left, + right: self.right, + start: self.left.left.start, + end: self.right.end + }), + right: self.left.right + }); + } else if (self.left.right instanceof AST_Constant) { + self = make_node(AST_Binary, self, { + operator: self.operator, + left: make_node(AST_Binary, self.left, { + operator: self.operator, + left: self.left.right, + right: self.right, + start: self.left.right.start, + end: self.right.end + }), + right: self.left.left + }); + } + } + // (a | 1) | (2 | d) => (3 | a) | b + if (self.left instanceof AST_Binary + && self.left.operator == self.operator + && self.left.right instanceof AST_Constant + && self.right instanceof AST_Binary + && self.right.operator == self.operator + && self.right.left instanceof AST_Constant) { + self = make_node(AST_Binary, self, { + operator: self.operator, + left: make_node(AST_Binary, self.left, { + operator: self.operator, + left: make_node(AST_Binary, self.left.left, { + operator: self.operator, + left: self.left.right, + right: self.right.left, + start: self.left.right.start, + end: self.right.left.end + }), + right: self.left.left + }), + right: self.right.right + }); + } + } + } + } + // x && (y && z) ==> x && y && z + // x || (y || z) ==> x || y || z + // x + ("y" + z) ==> x + "y" + z + // "x" + (y + "z")==> "x" + y + "z" + if (self.right instanceof AST_Binary + && self.right.operator == self.operator + && (lazy_op(self.operator) + || (self.operator == "+" + && (self.right.left.is_string(compressor) + || (self.left.is_string(compressor) + && self.right.right.is_string(compressor))))) + ) { + self.left = make_node(AST_Binary, self.left, { + operator : self.operator, + left : self.left, + right : self.right.left + }); + self.right = self.right.right; + return self.transform(compressor); + } + var ev = self.evaluate(compressor); + if (ev !== self) { + ev = make_node_from_constant(ev, self).optimize(compressor); + return best_of(compressor, ev, self); + } + return self; + }); + + OPT(AST_SymbolExport, function(self, compressor) { + return self; + }); + + function recursive_ref(compressor, def) { + var node; + for (var i = 0; node = compressor.parent(i); i++) { + if (node instanceof AST_Lambda) { + var name = node.name; + if (name && name.definition() === def) break; + } + } + return node; + } + + function within_array_or_object_literal(compressor) { + var node, level = 0; + while (node = compressor.parent(level++)) { + if (node instanceof AST_Statement) return false; + if (node instanceof AST_Array + || node instanceof AST_ObjectKeyVal + || node instanceof AST_Object) { + return true; + } + } + return false; + } + + OPT(AST_SymbolRef, function(self, compressor) { + if (!compressor.option("ie8") + && is_undeclared_ref(self) + && (!self.scope.uses_with || !compressor.find_parent(AST_With))) { + switch (self.name) { + case "undefined": + return make_node(AST_Undefined, self).optimize(compressor); + case "NaN": + return make_node(AST_NaN, self).optimize(compressor); + case "Infinity": + return make_node(AST_Infinity, self).optimize(compressor); + } + } + var parent = compressor.parent(); + if (compressor.option("reduce_vars") && is_lhs(self, parent) !== self) { + var d = self.definition(); + if (compressor.top_retain && d.global && compressor.top_retain(d)) { + d.fixed = false; + d.should_replace = false; + d.single_use = false; + return self; + } + var fixed = self.fixed_value(); + var single_use = d.single_use + && !(parent instanceof AST_Call && parent.is_expr_pure(compressor)); + if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { + if (retain_top_func(fixed, compressor)) { + single_use = false; + } else if (d.scope !== self.scope + && (!compressor.option("reduce_funcs") && fixed instanceof AST_Lambda + || d.escaped == 1 + || fixed.inlined + || within_array_or_object_literal(compressor))) { + single_use = false; + } else if (recursive_ref(compressor, d)) { + single_use = false; + } else if (d.scope !== self.scope || d.orig[0] instanceof AST_SymbolFunarg) { + single_use = fixed.is_constant_expression(self.scope); + if (single_use == "f") { + var scope = self.scope; + do { + if (scope instanceof AST_Defun || is_func_expr(scope)) { + scope.inlined = true; + } + } while (scope = scope.parent_scope); + } + } + } + if (single_use && fixed) { + if (fixed instanceof AST_DefClass) { + fixed = make_node(AST_ClassExpression, fixed, fixed); + } + if (fixed instanceof AST_Defun) { + fixed._squeezed = true; + fixed = make_node(AST_Function, fixed, fixed); + } + var value; + if (d.recursive_refs > 0 && fixed.name instanceof AST_SymbolDefun) { + value = fixed.clone(true); + var defun_def = value.name.definition(); + var lambda_def = value.variables.get(value.name.name); + var name = lambda_def && lambda_def.orig[0]; + if (!(name instanceof AST_SymbolLambda)) { + name = make_node(AST_SymbolLambda, value.name, value.name); + name.scope = value; + value.name = name; + lambda_def = value.def_function(name); + } + value.walk(new TreeWalker(function(node) { + if (node instanceof AST_SymbolRef && node.definition() === defun_def) { + node.thedef = lambda_def; + lambda_def.references.push(node); + } + })); + } else { + value = fixed.optimize(compressor); + if (value === fixed) value = fixed.clone(true); + } + return value; + } + if (fixed && d.should_replace === undefined) { + var init; + if (fixed instanceof AST_This) { + if (!(d.orig[0] instanceof AST_SymbolFunarg) + && all(d.references, function(ref) { + return d.scope === ref.scope; + })) { + init = fixed; + } + } else { + var ev = fixed.evaluate(compressor); + if (ev !== fixed && (compressor.option("unsafe_regexp") || !(ev instanceof RegExp))) { + init = make_node_from_constant(ev, fixed); + } + } + if (init) { + var value_length = init.optimize(compressor).print_to_string().length; + var fn; + if (has_symbol_ref(fixed)) { + fn = function() { + var result = init.optimize(compressor); + return result === init ? result.clone(true) : result; + }; + } else { + value_length = Math.min(value_length, fixed.print_to_string().length); + fn = function() { + var result = best_of_expression(init.optimize(compressor), fixed); + return result === init || result === fixed ? result.clone(true) : result; + }; + } + var name_length = d.name.length; + var overhead = 0; + if (compressor.option("unused") && !compressor.exposed(d)) { + overhead = (name_length + 2 + value_length) / (d.references.length - d.assignments); + } + d.should_replace = value_length <= name_length + overhead ? fn : false; + } else { + d.should_replace = false; + } + } + if (d.should_replace) { + return d.should_replace(); + } + } + return self; + + function has_symbol_ref(value) { + var found; + value.walk(new TreeWalker(function(node) { + if (node instanceof AST_SymbolRef) found = true; + if (found) return true; + })); + return found; + } + }); + + function is_atomic(lhs, self) { + return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE; + } + + OPT(AST_Undefined, function(self, compressor) { + if (compressor.option("unsafe_undefined")) { + var undef = find_variable(compressor, "undefined"); + if (undef) { + var ref = make_node(AST_SymbolRef, self, { + name : "undefined", + scope : undef.scope, + thedef : undef + }); + ref.is_undefined = true; + return ref; + } + } + var lhs = is_lhs(compressor.self(), compressor.parent()); + if (lhs && is_atomic(lhs, self)) return self; + return make_node(AST_UnaryPrefix, self, { + operator: "void", + expression: make_node(AST_Number, self, { + value: 0 + }) + }); + }); + + OPT(AST_Infinity, function(self, compressor) { + var lhs = is_lhs(compressor.self(), compressor.parent()); + if (lhs && is_atomic(lhs, self)) return self; + if (compressor.option("keep_infinity") + && !(lhs && !is_atomic(lhs, self)) + && !find_variable(compressor, "Infinity")) + return self; + return make_node(AST_Binary, self, { + operator: "/", + left: make_node(AST_Number, self, { + value: 1 + }), + right: make_node(AST_Number, self, { + value: 0 + }) + }); + }); + + OPT(AST_NaN, function(self, compressor) { + var lhs = is_lhs(compressor.self(), compressor.parent()); + if (lhs && !is_atomic(lhs, self) + || find_variable(compressor, "NaN")) { + return make_node(AST_Binary, self, { + operator: "/", + left: make_node(AST_Number, self, { + value: 0 + }), + right: make_node(AST_Number, self, { + value: 0 + }) + }); + } + return self; + }); + + function is_reachable(self, defs) { + var reachable = false; + var find_ref = new TreeWalker(function(node) { + if (reachable) return true; + if (node instanceof AST_SymbolRef && member(node.definition(), defs)) { + return reachable = true; + } + }); + var scan_scope = new TreeWalker(function(node) { + if (reachable) return true; + if (node instanceof AST_Scope && node !== self) { + var parent = scan_scope.parent(); + if (parent instanceof AST_Call && parent.expression === node) return; + node.walk(find_ref); + return true; + } + }); + self.walk(scan_scope); + return reachable; + } + + var ASSIGN_OPS = [ "+", "-", "/", "*", "%", ">>", "<<", ">>>", "|", "^", "&" ]; + var ASSIGN_OPS_COMMUTATIVE = [ "*", "|", "^", "&" ]; + OPT(AST_Assign, function(self, compressor) { + var def; + if (compressor.option("dead_code") + && self.left instanceof AST_SymbolRef + && (def = self.left.definition()).scope === compressor.find_parent(AST_Lambda)) { + var level = 0, node, parent = self; + do { + node = parent; + parent = compressor.parent(level++); + if (parent instanceof AST_Exit) { + if (in_try(level, parent)) break; + if (is_reachable(def.scope, [ def ])) break; + if (self.operator == "=") return self.right; + def.fixed = false; + return make_node(AST_Binary, self, { + operator: self.operator.slice(0, -1), + left: self.left, + right: self.right + }).optimize(compressor); + } + } while (parent instanceof AST_Binary && parent.right === node + || parent instanceof AST_Sequence && parent.tail_node() === node); + } + self = self.lift_sequences(compressor); + if (self.operator == "=" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary) { + // x = expr1 OP expr2 + if (self.right.left instanceof AST_SymbolRef + && self.right.left.name == self.left.name + && member(self.right.operator, ASSIGN_OPS)) { + // x = x - 2 ---> x -= 2 + self.operator = self.right.operator + "="; + self.right = self.right.right; + } else if (self.right.right instanceof AST_SymbolRef + && self.right.right.name == self.left.name + && member(self.right.operator, ASSIGN_OPS_COMMUTATIVE) + && !self.right.left.has_side_effects(compressor)) { + // x = 2 & x ---> x &= 2 + self.operator = self.right.operator + "="; + self.right = self.right.left; + } + } + return self; + + function in_try(level, node) { + var right = self.right; + self.right = make_node(AST_Null, right); + var may_throw = node.may_throw(compressor); + self.right = right; + var scope = self.left.definition().scope; + var parent; + while ((parent = compressor.parent(level++)) !== scope) { + if (parent instanceof AST_Try) { + if (parent.bfinally) return true; + if (may_throw && parent.bcatch) return true; + } + } + } + }); + + OPT(AST_DefaultAssign, function(self, compressor) { + if (!compressor.option("evaluate")) { + return self; + } + var evaluateRight = self.right.evaluate(compressor); + + // `[x = undefined] = foo` ---> `[x] = foo` + if (evaluateRight === undefined) { + self = self.left; + } else if (evaluateRight !== self.right) { + evaluateRight = make_node_from_constant(evaluateRight, self.right); + self.right = best_of_expression(evaluateRight, self.right); + } + + return self; + }); + + OPT(AST_Conditional, function(self, compressor) { + if (!compressor.option("conditionals")) return self; + // This looks like lift_sequences(), should probably be under "sequences" + if (self.condition instanceof AST_Sequence) { + var expressions = self.condition.expressions.slice(); + self.condition = expressions.pop(); + expressions.push(self); + return make_sequence(self, expressions); + } + var cond = self.condition.evaluate(compressor); + if (cond !== self.condition) { + if (cond) { + compressor.warn("Condition always true [{file}:{line},{col}]", self.start); + return maintain_this_binding(compressor.parent(), compressor.self(), self.consequent); + } else { + compressor.warn("Condition always false [{file}:{line},{col}]", self.start); + return maintain_this_binding(compressor.parent(), compressor.self(), self.alternative); + } + } + var negated = cond.negate(compressor, first_in_statement(compressor)); + if (best_of(compressor, cond, negated) === negated) { + self = make_node(AST_Conditional, self, { + condition: negated, + consequent: self.alternative, + alternative: self.consequent + }); + } + var condition = self.condition; + var consequent = self.consequent; + var alternative = self.alternative; + // x?x:y --> x||y + if (condition instanceof AST_SymbolRef + && consequent instanceof AST_SymbolRef + && condition.definition() === consequent.definition()) { + return make_node(AST_Binary, self, { + operator: "||", + left: condition, + right: alternative + }); + } + // if (foo) exp = something; else exp = something_else; + // | + // v + // exp = foo ? something : something_else; + if (consequent instanceof AST_Assign + && alternative instanceof AST_Assign + && consequent.operator == alternative.operator + && consequent.left.equivalent_to(alternative.left) + && (!self.condition.has_side_effects(compressor) + || consequent.operator == "=" + && !consequent.left.has_side_effects(compressor))) { + return make_node(AST_Assign, self, { + operator: consequent.operator, + left: consequent.left, + right: make_node(AST_Conditional, self, { + condition: self.condition, + consequent: consequent.right, + alternative: alternative.right + }) + }); + } + // x ? y(a) : y(b) --> y(x ? a : b) + var arg_index; + if (consequent instanceof AST_Call + && alternative.TYPE === consequent.TYPE + && consequent.args.length > 0 + && consequent.args.length == alternative.args.length + && consequent.expression.equivalent_to(alternative.expression) + && !self.condition.has_side_effects(compressor) + && !consequent.expression.has_side_effects(compressor) + && typeof (arg_index = single_arg_diff()) == "number") { + var node = consequent.clone(); + node.args[arg_index] = make_node(AST_Conditional, self, { + condition: self.condition, + consequent: consequent.args[arg_index], + alternative: alternative.args[arg_index] + }); + return node; + } + // x?y?z:a:a --> x&&y?z:a + if (consequent instanceof AST_Conditional + && consequent.alternative.equivalent_to(alternative)) { + return make_node(AST_Conditional, self, { + condition: make_node(AST_Binary, self, { + left: self.condition, + operator: "&&", + right: consequent.condition + }), + consequent: consequent.consequent, + alternative: alternative + }); + } + // x ? y : y --> x, y + if (consequent.equivalent_to(alternative)) { + return make_sequence(self, [ + self.condition, + consequent + ]).optimize(compressor); + } + // x ? y || z : z --> x && y || z + if (consequent instanceof AST_Binary + && consequent.operator == "||" + && consequent.right.equivalent_to(alternative)) { + return make_node(AST_Binary, self, { + operator: "||", + left: make_node(AST_Binary, self, { + operator: "&&", + left: self.condition, + right: consequent.left + }), + right: alternative + }).optimize(compressor); + } + var in_bool = compressor.in_boolean_context(); + if (is_true(self.consequent)) { + if (is_false(self.alternative)) { + // c ? true : false ---> !!c + return booleanize(self.condition); + } + // c ? true : x ---> !!c || x + return make_node(AST_Binary, self, { + operator: "||", + left: booleanize(self.condition), + right: self.alternative + }); + } + if (is_false(self.consequent)) { + if (is_true(self.alternative)) { + // c ? false : true ---> !c + return booleanize(self.condition.negate(compressor)); + } + // c ? false : x ---> !c && x + return make_node(AST_Binary, self, { + operator: "&&", + left: booleanize(self.condition.negate(compressor)), + right: self.alternative + }); + } + if (is_true(self.alternative)) { + // c ? x : true ---> !c || x + return make_node(AST_Binary, self, { + operator: "||", + left: booleanize(self.condition.negate(compressor)), + right: self.consequent + }); + } + if (is_false(self.alternative)) { + // c ? x : false ---> !!c && x + return make_node(AST_Binary, self, { + operator: "&&", + left: booleanize(self.condition), + right: self.consequent + }); + } + + return self; + + function booleanize(node) { + if (node.is_boolean()) return node; + // !!expression + return make_node(AST_UnaryPrefix, node, { + operator: "!", + expression: node.negate(compressor) + }); + } + + // AST_True or !0 + function is_true(node) { + return node instanceof AST_True + || in_bool + && node instanceof AST_Constant + && node.getValue() + || (node instanceof AST_UnaryPrefix + && node.operator == "!" + && node.expression instanceof AST_Constant + && !node.expression.getValue()); + } + // AST_False or !1 + function is_false(node) { + return node instanceof AST_False + || in_bool + && node instanceof AST_Constant + && !node.getValue() + || (node instanceof AST_UnaryPrefix + && node.operator == "!" + && node.expression instanceof AST_Constant + && node.expression.getValue()); + } + + function single_arg_diff() { + var a = consequent.args; + var b = alternative.args; + for (var i = 0, len = a.length; i < len; i++) { + if (a[i] instanceof AST_Expansion) return; + if (!a[i].equivalent_to(b[i])) { + if (b[i] instanceof AST_Expansion) return; + for (var j = i + 1; j < len; j++) { + if (a[j] instanceof AST_Expansion) return; + if (!a[j].equivalent_to(b[j])) return; + } + return i; + } + } + } + }); + + OPT(AST_Boolean, function(self, compressor) { + if (compressor.in_boolean_context()) return make_node(AST_Number, self, { + value: +self.value + }); + var p = compressor.parent(); + if (compressor.option("booleans_as_integers")) { + if (p instanceof AST_Binary && (p.operator == "===" || p.operator == "!==")) { + p.operator = p.operator.replace(/=$/, ""); + } + return make_node(AST_Number, self, { + value: +self.value + }); + } + if (compressor.option("booleans")) { + if (p instanceof AST_Binary && (p.operator == "==" + || p.operator == "!=")) { + compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", { + operator : p.operator, + value : self.value, + file : p.start.file, + line : p.start.line, + col : p.start.col, + }); + return make_node(AST_Number, self, { + value: +self.value + }); + } + return make_node(AST_UnaryPrefix, self, { + operator: "!", + expression: make_node(AST_Number, self, { + value: 1 - self.value + }) + }); + } + return self; + }); + + function safe_to_flatten(value, compressor) { + if (value instanceof AST_SymbolRef) { + value = value.fixed_value(); + } + if (!value) return false; + return !(value instanceof AST_Lambda || value instanceof AST_Class) + || compressor.parent() instanceof AST_New + || !value.contains_this(); + } + + OPT(AST_Sub, function(self, compressor) { + var expr = self.expression; + var prop = self.property; + if (compressor.option("properties")) { + var key = prop.evaluate(compressor); + if (key !== prop) { + if (typeof key == "string") { + if (key == "undefined") { + key = undefined; + } else { + var value = parseFloat(key); + if (value.toString() == key) { + key = value; + } + } + } + prop = self.property = best_of_expression(prop, make_node_from_constant(key, prop).transform(compressor)); + var property = "" + key; + if (is_identifier_string(property) + && property.length <= prop.print_to_string().length + 1) { + return make_node(AST_Dot, self, { + expression: expr, + property: property + }).optimize(compressor); + } + } + } + var fn; + OPT_ARGUMENTS: if (compressor.option("arguments") + && expr instanceof AST_SymbolRef + && expr.name == "arguments" + && expr.definition().orig.length == 1 + && (fn = expr.scope) instanceof AST_Lambda + && fn.uses_arguments + && !(fn instanceof AST_Arrow) + && prop instanceof AST_Number) { + var index = prop.getValue(); + var params = Object.create(null); + var argnames = fn.argnames; + for (var n = 0; n < argnames.length; n++) { + if (!(argnames[n] instanceof AST_SymbolFunarg)) { + break OPT_ARGUMENTS; // destructuring parameter - bail + } + var param = argnames[n].name; + if (param in params) { + break OPT_ARGUMENTS; // duplicate parameter - bail + } + params[param] = true; + } + var argname = fn.argnames[index]; + if (argname && compressor.has_directive("use strict")) { + var def = argname.definition(); + if (!compressor.option("reduce_vars") || def.assignments || def.orig.length > 1) { + argname = null; + } + } else if (!argname && !compressor.option("keep_fargs") && index < fn.argnames.length + 5) { + while (index >= fn.argnames.length) { + argname = make_node(AST_SymbolFunarg, fn, { + name: fn.make_var_name("argument_" + fn.argnames.length), + scope: fn + }); + fn.argnames.push(argname); + fn.enclosed.push(fn.def_variable(argname)); + } + } + if (argname) { + var sym = make_node(AST_SymbolRef, self, argname); + sym.reference({}); + delete argname.__unused; + return sym; + } + } + if (is_lhs(self, compressor.parent())) return self; + if (key !== prop) { + var sub = self.flatten_object(property, compressor); + if (sub) { + expr = self.expression = sub.expression; + prop = self.property = sub.property; + } + } + if (compressor.option("properties") && compressor.option("side_effects") + && prop instanceof AST_Number && expr instanceof AST_Array) { + var index = prop.getValue(); + var elements = expr.elements; + var retValue = elements[index]; + FLATTEN: if (safe_to_flatten(retValue, compressor)) { + var flatten = true; + var values = []; + for (var i = elements.length; --i > index;) { + var value = elements[i].drop_side_effect_free(compressor); + if (value) { + values.unshift(value); + if (flatten && value.has_side_effects(compressor)) flatten = false; + } + } + if (retValue instanceof AST_Expansion) break FLATTEN; + retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue; + if (!flatten) values.unshift(retValue); + while (--i >= 0) { + var value = elements[i]; + if (value instanceof AST_Expansion) break FLATTEN; + value = value.drop_side_effect_free(compressor); + if (value) values.unshift(value); + else index--; + } + if (flatten) { + values.push(retValue); + return make_sequence(self, values).optimize(compressor); + } else return make_node(AST_Sub, self, { + expression: make_node(AST_Array, expr, { + elements: values + }), + property: make_node(AST_Number, prop, { + value: index + }) + }); + } + } + var ev = self.evaluate(compressor); + if (ev !== self) { + ev = make_node_from_constant(ev, self).optimize(compressor); + return best_of(compressor, ev, self); + } + return self; + }); + + AST_Lambda.DEFMETHOD("contains_this", function() { + var result; + var self = this; + self.walk(new TreeWalker(function(node) { + if (result) return true; + if (node instanceof AST_This) return result = true; + if (node !== self && node instanceof AST_Scope && !(node instanceof AST_Arrow)) return true; + })); + return result; + }); + + AST_PropAccess.DEFMETHOD("flatten_object", function(key, compressor) { + if (!compressor.option("properties")) return; + var arrows = compressor.option("unsafe_arrows") && compressor.option("ecma") >= 6; + var expr = this.expression; + if (expr instanceof AST_Object) { + var props = expr.properties; + for (var i = props.length; --i >= 0;) { + var prop = props[i]; + if ("" + (prop instanceof AST_ConciseMethod ? prop.key.name : prop.key) == key) { + if (!all(props, function(prop) { + return prop instanceof AST_ObjectKeyVal + || arrows && prop instanceof AST_ConciseMethod && !prop.is_generator; + })) break; + if (!safe_to_flatten(prop.value, compressor)) break; + return make_node(AST_Sub, this, { + expression: make_node(AST_Array, expr, { + elements: props.map(function(prop) { + var v = prop.value; + if (v instanceof AST_Accessor) v = make_node(AST_Function, v, v); + var k = prop.key; + if (k instanceof AST_Node && !(k instanceof AST_SymbolMethod)) { + return make_sequence(prop, [ k, v ]); + } + return v; + }) + }), + property: make_node(AST_Number, this, { + value: i + }) + }); + } + } + } + }); + + OPT(AST_Dot, function(self, compressor) { + if (self.property == "arguments" || self.property == "caller") { + compressor.warn("Function.protoype.{prop} not supported [{file}:{line},{col}]", { + prop: self.property, + file: self.start.file, + line: self.start.line, + col: self.start.col + }); + } + if (is_lhs(self, compressor.parent())) return self; + if (compressor.option("unsafe_proto") + && self.expression instanceof AST_Dot + && self.expression.property == "prototype") { + var exp = self.expression.expression; + if (is_undeclared_ref(exp)) switch (exp.name) { + case "Array": + self.expression = make_node(AST_Array, self.expression, { + elements: [] + }); + break; + case "Function": + self.expression = make_node(AST_Function, self.expression, { + argnames: [], + body: [] + }); + break; + case "Number": + self.expression = make_node(AST_Number, self.expression, { + value: 0 + }); + break; + case "Object": + self.expression = make_node(AST_Object, self.expression, { + properties: [] + }); + break; + case "RegExp": + self.expression = make_node(AST_RegExp, self.expression, { + value: /t/ + }); + break; + case "String": + self.expression = make_node(AST_String, self.expression, { + value: "" + }); + break; + } + } + var sub = self.flatten_object(self.property, compressor); + if (sub) return sub.optimize(compressor); + var ev = self.evaluate(compressor); + if (ev !== self) { + ev = make_node_from_constant(ev, self).optimize(compressor); + return best_of(compressor, ev, self); + } + return self; + }); + + function literals_in_boolean_context(self, compressor) { + if (compressor.in_boolean_context()) { + return best_of(compressor, self, make_sequence(self, [ + self, + make_node(AST_True, self) + ]).optimize(compressor)); + } + return self; + } + OPT(AST_Array, literals_in_boolean_context); + OPT(AST_Object, literals_in_boolean_context); + OPT(AST_RegExp, literals_in_boolean_context); + + OPT(AST_Return, function(self, compressor) { + if (self.value && is_undefined(self.value, compressor)) { + self.value = null; + } + return self; + }); + + OPT(AST_Arrow, function(self, compressor) { + if (!(self.body instanceof AST_Node)) { + self = opt_AST_Lambda(self, compressor); + } + if (compressor.option("arrows") + && self.body.length == 1 + && self.body[0] instanceof AST_Return) { + var value = self.body[0].value; + self.body = value ? value : []; + } + return self; + }); + + OPT(AST_Function, function(self, compressor) { + self = opt_AST_Lambda(self, compressor); + if (compressor.option("unsafe_arrows") + && compressor.option("ecma") >= 6 + && !self.name + && !self.is_generator + && !self.uses_arguments + && !self.pinned()) { + var has_special_symbol = false; + self.walk(new TreeWalker(function(node) { + if (has_special_symbol) return true; + if (node instanceof AST_This) { + has_special_symbol = true; + return true; + } + })); + if (!has_special_symbol) return make_node(AST_Arrow, self, self).optimize(compressor); + } + return self; + }); + + OPT(AST_Class, function(self, compressor) { + // HACK to avoid compress failure. + // AST_Class is not really an AST_Scope/AST_Block as it lacks a body. + return self; + }); + + OPT(AST_Yield, function(self, compressor) { + if (self.expression && !self.is_star && is_undefined(self.expression, compressor)) { + self.expression = null; + } + return self; + }); + + OPT(AST_TemplateString, function(self, compressor) { + if (!compressor.option("evaluate") + || compressor.parent() instanceof AST_PrefixedTemplateString) + return self; + + var segments = []; + for (var i = 0; i < self.segments.length; i++) { + var segment = self.segments[i]; + if (segment instanceof AST_Node) { + var result = segment.evaluate(compressor); + // Evaluate to constant value + // Constant value shorter than ${segment} + if (result !== segment && (result + "").length <= segment.print_to_string().length + "${}".length) { + // There should always be a previous and next segment if segment is a node + segments[segments.length - 1].value = segments[segments.length - 1].value + result + self.segments[++i].value; + continue; + } + } + segments.push(segment); + } + self.segments = segments; + + return segments.length == 1 ? make_node(AST_String, self, segments[0]) : self; + }); + + OPT(AST_PrefixedTemplateString, function(self, compressor) { + return self; + }); + + // ["p"]:1 ---> p:1 + // [42]:1 ---> 42:1 + function lift_key(self, compressor) { + if (!compressor.option("computed_props")) return self; + // save a comparison in the typical case + if (!(self.key instanceof AST_Constant)) return self; + // whitelist acceptable props as not all AST_Constants are true constants + if (self.key instanceof AST_String || self.key instanceof AST_Number) { + if (self.key.value === "__proto__") return self; + if (self.key.value == "constructor" + && compressor.parent() instanceof AST_Class) return self; + if (self instanceof AST_ObjectKeyVal) { + self.key = self.key.value; + } else { + self.key = make_node(AST_SymbolMethod, self.key, { + name: self.key.value + }); + } + } + return self; + } + + OPT(AST_ObjectProperty, lift_key); + + OPT(AST_ConciseMethod, function(self, compressor) { + lift_key(self, compressor); + // p(){return x;} ---> p:()=>x + if (compressor.option("arrows") + && compressor.parent() instanceof AST_Object + && !self.is_generator + && !self.value.uses_arguments + && !self.value.pinned() + && self.value.body.length == 1 + && self.value.body[0] instanceof AST_Return + && self.value.body[0].value + && !self.value.contains_this()) { + var arrow = make_node(AST_Arrow, self.value, self.value); + arrow.async = self.async; + arrow.is_generator = self.is_generator; + return make_node(AST_ObjectKeyVal, self, { + key: self.key instanceof AST_SymbolMethod ? self.key.name : self.key, + value: arrow, + quote: self.quote, + }); + } + return self; + }); + + OPT(AST_ObjectKeyVal, function(self, compressor) { + lift_key(self, compressor); + // p:function(){} ---> p(){} + // p:function*(){} ---> *p(){} + // p:async function(){} ---> async p(){} + // p:()=>{} ---> p(){} + // p:async()=>{} ---> async p(){} + var unsafe_methods = compressor.option("unsafe_methods"); + if (unsafe_methods + && compressor.option("ecma") >= 6 + && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + ""))) { + var key = self.key; + var value = self.value; + var is_arrow_with_block = value instanceof AST_Arrow + && Array.isArray(value.body) + && !value.contains_this(); + if ((is_arrow_with_block || value instanceof AST_Function) && !value.name) { + return make_node(AST_ConciseMethod, self, { + async: value.async, + is_generator: value.is_generator, + key: key instanceof AST_Node ? key : make_node(AST_SymbolMethod, self, { + name: key, + }), + value: make_node(AST_Accessor, value, value), + quote: self.quote, + }); + } + } + return self; + }); + + OPT(AST_Destructuring, function(self, compressor) { + if (compressor.option("pure_getters") == true + && compressor.option("unused") + && !self.is_array + && Array.isArray(self.names) + && !is_destructuring_export_decl(compressor)) { + var keep = []; + for (var i = 0; i < self.names.length; i++) { + var elem = self.names[i]; + if (!(elem instanceof AST_ObjectKeyVal + && typeof elem.key == "string" + && elem.value instanceof AST_SymbolDeclaration + && !should_retain(compressor, elem.value.definition()))) { + keep.push(elem); + } + } + if (keep.length != self.names.length) { + self.names = keep; + } + } + return self; + + function is_destructuring_export_decl(compressor) { + var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/]; + for (var a = 0, p = 0, len = ancestors.length; a < len; p++) { + var parent = compressor.parent(p); + if (!parent) return false; + if (a === 0 && parent.TYPE == "Destructuring") continue; + if (!ancestors[a].test(parent.TYPE)) { + return false; + } + a++; + } + return true; + } + + function should_retain(compressor, def) { + if (def.references.length) return true; + if (!def.global) return false; + if (compressor.toplevel.vars) { + if (compressor.top_retain) { + return compressor.top_retain(def); + } + return false; + } + return true; + } + }); +})(); diff --git a/tools/node_modules/terser/lib/minify.js b/tools/node_modules/terser/lib/minify.js new file mode 100644 index 000000000000..7b016e9cff90 --- /dev/null +++ b/tools/node_modules/terser/lib/minify.js @@ -0,0 +1,260 @@ +"use strict"; + +var to_ascii = typeof atob == "undefined" ? function(b64) { + if (Buffer.from && Buffer.from !== Uint8Array.from) { + // Node >= 4.5.0 + return Buffer.from(b64, "base64").toString(); + } else { + // Node < 4.5.0, old API, manual safeguards + if (typeof b64 !== "string") throw new Errror("\"b64\" must be a string"); + return new Buffer(b64, "base64").toString(); + } +} : atob; +var to_base64 = typeof btoa == "undefined" ? function(str) { + if (Buffer.from && Buffer.from !== Uint8Array.from) { + // Node >= 4.5.0 + return Buffer.from(str).toString("base64"); + } else { + // Node < 4.5.0, old API, manual safeguards + if (typeof str !== "string") throw new Errror("\"str\" must be a string"); + return new Buffer(str).toString("base64"); + } +} : btoa; + +function read_source_map(code) { + var match = /\n\/\/# sourceMappingURL=data:application\/json(;.*?)?;base64,(.*)/.exec(code); + if (!match) { + AST_Node.warn("inline source map not found"); + return null; + } + return to_ascii(match[2]); +} + +function set_shorthand(name, options, keys) { + if (options[name]) { + keys.forEach(function(key) { + if (options[key]) { + if (typeof options[key] != "object") options[key] = {}; + if (!(name in options[key])) options[key][name] = options[name]; + } + }); + } +} + +function init_cache(cache) { + if (!cache) return; + if (!("props" in cache)) { + cache.props = new Dictionary(); + } else if (!(cache.props instanceof Dictionary)) { + cache.props = Dictionary.fromObject(cache.props); + } +} + +function to_json(cache) { + return { + props: cache.props.toObject() + }; +} + +function minify(files, options) { + var warn_function = AST_Node.warn_function; + try { + options = defaults(options, { + compress: {}, + ecma: undefined, + enclose: false, + ie8: false, + keep_classnames: undefined, + keep_fnames: false, + mangle: {}, + module: false, + nameCache: null, + output: {}, + parse: {}, + rename: undefined, + safari10: false, + sourceMap: false, + timings: false, + toplevel: false, + warnings: false, + wrap: false, + }, true); + var timings = options.timings && { + start: Date.now() + }; + if (options.keep_classnames === undefined) { + options.keep_classnames = options.keep_fnames; + } + if (options.rename === undefined) { + options.rename = options.compress && options.mangle; + } + set_shorthand("ecma", options, [ "parse", "compress", "output" ]); + set_shorthand("ie8", options, [ "compress", "mangle", "output" ]); + set_shorthand("keep_classnames", options, [ "compress", "mangle" ]); + set_shorthand("keep_fnames", options, [ "compress", "mangle" ]); + set_shorthand("module", options, [ "parse", "compress", "mangle" ]); + set_shorthand("safari10", options, [ "mangle", "output" ]); + set_shorthand("toplevel", options, [ "compress", "mangle" ]); + set_shorthand("warnings", options, [ "compress" ]); + var quoted_props; + if (options.mangle) { + options.mangle = defaults(options.mangle, { + cache: options.nameCache && (options.nameCache.vars || {}), + eval: false, + ie8: false, + keep_classnames: false, + keep_fnames: false, + module: false, + properties: false, + reserved: [], + safari10: false, + toplevel: false, + }, true); + if (options.mangle.properties) { + if (typeof options.mangle.properties != "object") { + options.mangle.properties = {}; + } + if (options.mangle.properties.keep_quoted) { + quoted_props = options.mangle.properties.reserved; + if (!Array.isArray(quoted_props)) quoted_props = []; + options.mangle.properties.reserved = quoted_props; + } + if (options.nameCache && !("cache" in options.mangle.properties)) { + options.mangle.properties.cache = options.nameCache.props || {}; + } + } + init_cache(options.mangle.cache); + init_cache(options.mangle.properties.cache); + } + if (options.sourceMap) { + options.sourceMap = defaults(options.sourceMap, { + content: null, + filename: null, + includeSources: false, + root: null, + url: null, + }, true); + } + var warnings = []; + if (options.warnings && !AST_Node.warn_function) { + AST_Node.warn_function = function(warning) { + warnings.push(warning); + }; + } + if (timings) timings.parse = Date.now(); + var toplevel; + if (files instanceof AST_Toplevel) { + toplevel = files; + } else { + if (typeof files == "string") { + files = [ files ]; + } + options.parse = options.parse || {}; + options.parse.toplevel = null; + for (var name in files) if (HOP(files, name)) { + options.parse.filename = name; + options.parse.toplevel = parse(files[name], options.parse); + if (options.sourceMap && options.sourceMap.content == "inline") { + if (Object.keys(files).length > 1) + throw new Error("inline source map only works with singular input"); + options.sourceMap.content = read_source_map(files[name]); + } + } + toplevel = options.parse.toplevel; + } + if (quoted_props) { + reserve_quoted_keys(toplevel, quoted_props); + } + if (options.wrap) { + toplevel = toplevel.wrap_commonjs(options.wrap); + } + if (options.enclose) { + toplevel = toplevel.wrap_enclose(options.enclose); + } + if (timings) timings.rename = Date.now(); + // disable rename on harmony due to expand_names bug in for-of loops + // https://github.com/mishoo/UglifyJS2/issues/2794 + if (0 && options.rename) { + toplevel.figure_out_scope(options.mangle); + toplevel.expand_names(options.mangle); + } + if (timings) timings.compress = Date.now(); + if (options.compress) toplevel = new Compressor(options.compress).compress(toplevel); + if (timings) timings.scope = Date.now(); + if (options.mangle) toplevel.figure_out_scope(options.mangle); + if (timings) timings.mangle = Date.now(); + if (options.mangle) { + base54.reset(); + toplevel.compute_char_frequency(options.mangle); + toplevel.mangle_names(options.mangle); + } + if (timings) timings.properties = Date.now(); + if (options.mangle && options.mangle.properties) { + toplevel = mangle_properties(toplevel, options.mangle.properties); + } + if (timings) timings.output = Date.now(); + var result = {}; + if (options.output.ast) { + result.ast = toplevel; + } + if (!HOP(options.output, "code") || options.output.code) { + if (options.sourceMap) { + if (typeof options.sourceMap.content == "string") { + options.sourceMap.content = JSON.parse(options.sourceMap.content); + } + options.output.source_map = SourceMap({ + file: options.sourceMap.filename, + orig: options.sourceMap.content, + root: options.sourceMap.root + }); + if (options.sourceMap.includeSources) { + if (files instanceof AST_Toplevel) { + throw new Error("original source content unavailable"); + } else for (var name in files) if (HOP(files, name)) { + options.output.source_map.get().setSourceContent(name, files[name]); + } + } + } + delete options.output.ast; + delete options.output.code; + var stream = OutputStream(options.output); + toplevel.print(stream); + result.code = stream.get(); + if (options.sourceMap) { + result.map = options.output.source_map.toString(); + if (options.sourceMap.url == "inline") { + result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(result.map); + } else if (options.sourceMap.url) { + result.code += "\n//# sourceMappingURL=" + options.sourceMap.url; + } + } + } + if (options.nameCache && options.mangle) { + if (options.mangle.cache) options.nameCache.vars = to_json(options.mangle.cache); + if (options.mangle.properties && options.mangle.properties.cache) { + options.nameCache.props = to_json(options.mangle.properties.cache); + } + } + if (timings) { + timings.end = Date.now(); + result.timings = { + parse: 1e-3 * (timings.rename - timings.parse), + rename: 1e-3 * (timings.compress - timings.rename), + compress: 1e-3 * (timings.scope - timings.compress), + scope: 1e-3 * (timings.mangle - timings.scope), + mangle: 1e-3 * (timings.properties - timings.mangle), + properties: 1e-3 * (timings.output - timings.properties), + output: 1e-3 * (timings.end - timings.output), + total: 1e-3 * (timings.end - timings.start) + }; + } + if (warnings.length) { + result.warnings = warnings; + } + return result; + } catch (ex) { + return { error: ex }; + } finally { + AST_Node.warn_function = warn_function; + } +} diff --git a/tools/node_modules/terser/lib/mozilla-ast.js b/tools/node_modules/terser/lib/mozilla-ast.js new file mode 100644 index 000000000000..c5129be5daaa --- /dev/null +++ b/tools/node_modules/terser/lib/mozilla-ast.js @@ -0,0 +1,1087 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +(function() { + + var normalize_directives = function(body) { + var in_directive = true; + + for (var i = 0; i < body.length; i++) { + if (in_directive && body[i] instanceof AST_Statement && body[i].body instanceof AST_String) { + body[i] = new AST_Directive({ + start: body[i].start, + end: body[i].end, + value: body[i].body.value + }); + } else if (in_directive && !(body[i] instanceof AST_Statement && body[i].body instanceof AST_String)) { + in_directive = false; + } + } + + return body; + }; + + var MOZ_TO_ME = { + Program: function(M) { + return new AST_Toplevel({ + start: my_start_token(M), + end: my_end_token(M), + body: normalize_directives(M.body.map(from_moz)) + }); + }, + ArrayPattern: function(M) { + return new AST_Destructuring({ + start: my_start_token(M), + end: my_end_token(M), + names: M.elements.map(function(elm) { + if (elm === null) { + return new AST_Hole(); + } + return from_moz(elm); + }), + is_array: true + }); + }, + ObjectPattern: function(M) { + return new AST_Destructuring({ + start: my_start_token(M), + end: my_end_token(M), + names: M.properties.map(from_moz), + is_array: false + }); + }, + AssignmentPattern: function(M) { + return new AST_Binary({ + start: my_start_token(M), + end: my_end_token(M), + left: from_moz(M.left), + operator: "=", + right: from_moz(M.right) + }); + }, + SpreadElement: function(M) { + return new AST_Expansion({ + start: my_start_token(M), + end: my_end_token(M), + expression: from_moz(M.argument) + }); + }, + RestElement: function(M) { + return new AST_Expansion({ + start: my_start_token(M), + end: my_end_token(M), + expression: from_moz(M.argument) + }); + }, + TemplateElement: function(M) { + return new AST_TemplateSegment({ + start: my_start_token(M), + end: my_end_token(M), + value: M.value.cooked, + raw: M.value.raw + }); + }, + TemplateLiteral: function(M) { + var segments = []; + for (var i = 0; i < M.quasis.length; i++) { + segments.push(from_moz(M.quasis[i])); + if (M.expressions[i]) { + segments.push(from_moz(M.expressions[i])); + } + } + return new AST_TemplateString({ + start: my_start_token(M), + end: my_end_token(M), + segments: segments + }); + }, + TaggedTemplateExpression: function(M) { + return new AST_PrefixedTemplateString({ + start: my_start_token(M), + end: my_end_token(M), + template_string: from_moz(M.quasi), + prefix: from_moz(M.tag) + }); + }, + FunctionDeclaration: function(M) { + return new AST_Defun({ + start: my_start_token(M), + end: my_end_token(M), + name: from_moz(M.id), + argnames: M.params.map(from_moz), + is_generator: M.generator, + async: M.async, + body: normalize_directives(from_moz(M.body).body) + }); + }, + FunctionExpression: function(M) { + return new AST_Function({ + start: my_start_token(M), + end: my_end_token(M), + name: from_moz(M.id), + argnames: M.params.map(from_moz), + is_generator: M.generator, + async: M.async, + body: normalize_directives(from_moz(M.body).body) + }); + }, + ArrowFunctionExpression: function(M) { + return new AST_Arrow({ + start: my_start_token(M), + end: my_end_token(M), + argnames: M.params.map(from_moz), + body: from_moz(M.body), + async: M.async, + }); + }, + ExpressionStatement: function(M) { + return new AST_SimpleStatement({ + start: my_start_token(M), + end: my_end_token(M), + body: from_moz(M.expression) + }); + }, + TryStatement: function(M) { + var handlers = M.handlers || [M.handler]; + if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) { + throw new Error("Multiple catch clauses are not supported."); + } + return new AST_Try({ + start : my_start_token(M), + end : my_end_token(M), + body : from_moz(M.block).body, + bcatch : from_moz(handlers[0]), + bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null + }); + }, + Property: function(M) { + var key = M.key; + var args = { + start : my_start_token(key || M.value), + end : my_end_token(M.value), + key : key.type == "Identifier" ? key.name : key.value, + value : from_moz(M.value) + }; + if (M.computed) { + args.key = from_moz(M.key); + } + if (M.method) { + args.is_generator = M.value.generator; + args.async = M.value.async; + if (!M.computed) { + args.key = new AST_SymbolMethod({ name: args.key }); + } else { + args.key = from_moz(M.key); + } + return new AST_ConciseMethod(args); + } + if (M.kind == "init") { + if (key.type != "Identifier" && key.type != "Literal") { + args.key = from_moz(key); + } + return new AST_ObjectKeyVal(args); + } + if (typeof args.key === "string" || typeof args.key === "number") { + args.key = new AST_SymbolMethod({ + name: args.key + }); + } + args.value = new AST_Accessor(args.value); + if (M.kind == "get") return new AST_ObjectGetter(args); + if (M.kind == "set") return new AST_ObjectSetter(args); + if (M.kind == "method") { + args.async = M.value.async; + args.is_generator = M.value.generator; + args.quote = M.computed ? "\"" : null; + return new AST_ConciseMethod(args); + } + }, + MethodDefinition: function(M) { + var args = { + start : my_start_token(M), + end : my_end_token(M), + key : M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }), + value : from_moz(M.value), + static : M.static, + }; + if (M.kind == "get") { + return new AST_ObjectGetter(args); + } + if (M.kind == "set") { + return new AST_ObjectSetter(args); + } + args.is_generator = M.value.generator; + args.async = M.value.async; + return new AST_ConciseMethod(args); + }, + ArrayExpression: function(M) { + return new AST_Array({ + start : my_start_token(M), + end : my_end_token(M), + elements : M.elements.map(function(elem) { + return elem === null ? new AST_Hole() : from_moz(elem); + }) + }); + }, + ObjectExpression: function(M) { + return new AST_Object({ + start : my_start_token(M), + end : my_end_token(M), + properties : M.properties.map(function(prop) { + if (prop.type === "SpreadElement") { + return from_moz(prop); + } + prop.type = "Property"; + return from_moz(prop); + }) + }); + }, + SequenceExpression: function(M) { + return new AST_Sequence({ + start : my_start_token(M), + end : my_end_token(M), + expressions: M.expressions.map(from_moz) + }); + }, + MemberExpression: function(M) { + return new (M.computed ? AST_Sub : AST_Dot)({ + start : my_start_token(M), + end : my_end_token(M), + property : M.computed ? from_moz(M.property) : M.property.name, + expression : from_moz(M.object) + }); + }, + SwitchCase: function(M) { + return new (M.test ? AST_Case : AST_Default)({ + start : my_start_token(M), + end : my_end_token(M), + expression : from_moz(M.test), + body : M.consequent.map(from_moz) + }); + }, + VariableDeclaration: function(M) { + return new (M.kind === "const" ? AST_Const : + M.kind === "let" ? AST_Let : AST_Var)({ + start : my_start_token(M), + end : my_end_token(M), + definitions : M.declarations.map(from_moz) + }); + }, + + ImportDeclaration: function(M) { + var imported_name = null; + var imported_names = null; + M.specifiers.forEach(function (specifier) { + if (specifier.type === "ImportSpecifier") { + if (!imported_names) { imported_names = []; } + imported_names.push(new AST_NameMapping({ + start: my_start_token(specifier), + end: my_end_token(specifier), + foreign_name: from_moz(specifier.imported), + name: from_moz(specifier.local) + })); + } else if (specifier.type === "ImportDefaultSpecifier") { + imported_name = from_moz(specifier.local); + } else if (specifier.type === "ImportNamespaceSpecifier") { + if (!imported_names) { imported_names = []; } + imported_names.push(new AST_NameMapping({ + start: my_start_token(specifier), + end: my_end_token(specifier), + foreign_name: new AST_SymbolImportForeign({ name: "*" }), + name: from_moz(specifier.local) + })); + } + }); + return new AST_Import({ + start : my_start_token(M), + end : my_end_token(M), + imported_name: imported_name, + imported_names : imported_names, + module_name : from_moz(M.source) + }); + }, + ExportAllDeclaration: function(M) { + return new AST_Export({ + start: my_start_token(M), + end: my_end_token(M), + exported_names: [ + new AST_NameMapping({ + name: new AST_SymbolExportForeign({ name: "*" }), + foreign_name: new AST_SymbolExportForeign({ name: "*" }) + }) + ], + module_name: from_moz(M.source) + }); + }, + ExportNamedDeclaration: function(M) { + return new AST_Export({ + start: my_start_token(M), + end: my_end_token(M), + exported_definition: from_moz(M.declaration), + exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(function (specifier) { + return new AST_NameMapping({ + foreign_name: from_moz(specifier.exported), + name: from_moz(specifier.local) + }); + }) : null, + module_name: from_moz(M.source) + }); + }, + ExportDefaultDeclaration: function(M) { + return new AST_Export({ + start: my_start_token(M), + end: my_end_token(M), + exported_value: from_moz(M.declaration), + is_default: true + }); + }, + Literal: function(M) { + var val = M.value, args = { + start : my_start_token(M), + end : my_end_token(M) + }; + if (val === null) return new AST_Null(args); + var rx = M.regex; + if (rx && rx.pattern) { + // RegExpLiteral as per ESTree AST spec + args.value = new RegExp(rx.pattern, rx.flags); + var raw = args.value.toString(); + args.value.raw_source = rx.flags + ? raw.substring(0, raw.length - rx.flags.length) + rx.flags + : raw; + return new AST_RegExp(args); + } else if (rx) { + // support legacy RegExp + args.value = M.regex && M.raw ? M.raw : val; + return new AST_RegExp(args); + } + switch (typeof val) { + case "string": + args.value = val; + return new AST_String(args); + case "number": + args.value = val; + return new AST_Number(args); + case "boolean": + return new (val ? AST_True : AST_False)(args); + } + }, + MetaProperty: function(M) { + if (M.meta.name === "new" && M.property.name === "target") { + return new AST_NewTarget({ + start: my_start_token(M), + end: my_end_token(M) + }); + } + }, + Identifier: function(M) { + var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; + return new ( p.type == "LabeledStatement" ? AST_Label + : p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : p.kind == "let" ? AST_SymbolLet : AST_SymbolVar) + : /Import.*Specifier/.test(p.type) ? (p.local === M ? AST_SymbolImport : AST_SymbolImportForeign) + : p.type == "ExportSpecifier" ? (p.local === M ? AST_SymbolExport : AST_SymbolExportForeign) + : p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg) + : p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg) + : p.type == "ArrowFunctionExpression" ? (p.params.indexOf(M) !== -1) ? AST_SymbolFunarg : AST_SymbolRef + : p.type == "ClassExpression" ? (p.id === M ? AST_SymbolClass : AST_SymbolRef) + : p.type == "Property" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolMethod) + : p.type == "ClassDeclaration" ? (p.id === M ? AST_SymbolDefClass : AST_SymbolRef) + : p.type == "MethodDefinition" ? (p.computed ? AST_SymbolRef : AST_SymbolMethod) + : p.type == "CatchClause" ? AST_SymbolCatch + : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef + : AST_SymbolRef)({ + start : my_start_token(M), + end : my_end_token(M), + name : M.name + }); + } + }; + + MOZ_TO_ME.UpdateExpression = + MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) { + var prefix = "prefix" in M ? M.prefix + : M.type == "UnaryExpression" ? true : false; + return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ + start : my_start_token(M), + end : my_end_token(M), + operator : M.operator, + expression : from_moz(M.argument) + }); + }; + + MOZ_TO_ME.ClassDeclaration = + MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) { + return new (M.type === "ClassDeclaration" ? AST_DefClass : AST_ClassExpression)({ + start : my_start_token(M), + end : my_end_token(M), + name : from_moz(M.id), + extends : from_moz(M.superClass), + properties: M.body.body.map(from_moz) + }); + }; + + map("EmptyStatement", AST_EmptyStatement); + map("BlockStatement", AST_BlockStatement, "body@body"); + map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative"); + map("LabeledStatement", AST_LabeledStatement, "label>label, body>body"); + map("BreakStatement", AST_Break, "label>label"); + map("ContinueStatement", AST_Continue, "label>label"); + map("WithStatement", AST_With, "object>expression, body>body"); + map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body"); + map("ReturnStatement", AST_Return, "argument>value"); + map("ThrowStatement", AST_Throw, "argument>value"); + map("WhileStatement", AST_While, "test>condition, body>body"); + map("DoWhileStatement", AST_Do, "test>condition, body>body"); + map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body"); + map("ForInStatement", AST_ForIn, "left>init, right>object, body>body"); + map("ForOfStatement", AST_ForOf, "left>init, right>object, body>body, await=await"); + map("AwaitExpression", AST_Await, "argument>expression"); + map("YieldExpression", AST_Yield, "argument>expression, delegate=is_star"); + map("DebuggerStatement", AST_Debugger); + map("VariableDeclarator", AST_VarDef, "id>name, init>value"); + map("CatchClause", AST_Catch, "param>argname, body%body"); + + map("ThisExpression", AST_This); + map("Super", AST_Super); + map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right"); + map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right"); + map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right"); + map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative"); + map("NewExpression", AST_New, "callee>expression, arguments@args"); + map("CallExpression", AST_Call, "callee>expression, arguments@args"); + + def_to_moz(AST_Toplevel, function To_Moz_Program(M) { + return to_moz_scope("Program", M); + }); + + def_to_moz(AST_Expansion, function To_Moz_Spread(M, parent) { + return { + type: to_moz_in_destructuring() ? "RestElement" : "SpreadElement", + argument: to_moz(M.expression) + }; + }); + + def_to_moz(AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) { + return { + type: "TaggedTemplateExpression", + tag: to_moz(M.prefix), + quasi: to_moz(M.template_string) + }; + }); + + def_to_moz(AST_TemplateString, function To_Moz_TemplateLiteral(M) { + var quasis = []; + var expressions = []; + for (var i = 0; i < M.segments.length; i++) { + if (i % 2 !== 0) { + expressions.push(to_moz(M.segments[i])); + } else { + quasis.push({ + type: "TemplateElement", + value: { + raw: M.segments[i].raw, + cooked: M.segments[i].value + }, + tail: i === M.segments.length - 1 + }); + } + } + return { + type: "TemplateLiteral", + quasis: quasis, + expressions: expressions + }; + }); + + def_to_moz(AST_Defun, function To_Moz_FunctionDeclaration(M) { + return { + type: "FunctionDeclaration", + id: to_moz(M.name), + params: M.argnames.map(to_moz), + generator: M.is_generator, + async: M.async, + body: to_moz_scope("BlockStatement", M) + }; + }); + + def_to_moz(AST_Function, function To_Moz_FunctionExpression(M, parent) { + var is_generator = parent.is_generator !== undefined ? + parent.is_generator : M.is_generator; + return { + type: "FunctionExpression", + id: to_moz(M.name), + params: M.argnames.map(to_moz), + generator: is_generator, + async: M.async, + body: to_moz_scope("BlockStatement", M) + }; + }); + + def_to_moz(AST_Arrow, function To_Moz_ArrowFunctionExpression(M) { + var body = M.body instanceof Array ? { + type: "BlockStatement", + body: M.body.map(to_moz) + } : to_moz(M.body); + return { + type: "ArrowFunctionExpression", + params: M.argnames.map(to_moz), + async: M.async, + body: body + }; + }); + + def_to_moz(AST_Destructuring, function To_Moz_ObjectPattern(M) { + if (M.is_array) { + return { + type: "ArrayPattern", + elements: M.names.map(to_moz) + }; + } + return { + type: "ObjectPattern", + properties: M.names.map(to_moz) + }; + }); + + def_to_moz(AST_Directive, function To_Moz_Directive(M) { + return { + type: "ExpressionStatement", + expression: { + type: "Literal", + value: M.value + } + }; + }); + + def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) { + return { + type: "ExpressionStatement", + expression: to_moz(M.body) + }; + }); + + def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) { + return { + type: "SwitchCase", + test: to_moz(M.expression), + consequent: M.body.map(to_moz) + }; + }); + + def_to_moz(AST_Try, function To_Moz_TryStatement(M) { + return { + type: "TryStatement", + block: to_moz_block(M), + handler: to_moz(M.bcatch), + guardedHandlers: [], + finalizer: to_moz(M.bfinally) + }; + }); + + def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { + return { + type: "CatchClause", + param: to_moz(M.argname), + guard: null, + body: to_moz_block(M) + }; + }); + + def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) { + return { + type: "VariableDeclaration", + kind: + M instanceof AST_Const ? "const" : + M instanceof AST_Let ? "let" : "var", + declarations: M.definitions.map(to_moz) + }; + }); + + def_to_moz(AST_Export, function To_Moz_ExportDeclaration(M) { + if (M.exported_names) { + if (M.exported_names[0].name.name === "*") { + return { + type: "ExportAllDeclaration", + source: to_moz(M.module_name) + }; + } + return { + type: "ExportNamedDeclaration", + specifiers: M.exported_names.map(function (name_mapping) { + return { + type: "ExportSpecifier", + exported: to_moz(name_mapping.foreign_name), + local: to_moz(name_mapping.name) + }; + }), + declaration: to_moz(M.exported_definition), + source: to_moz(M.module_name) + }; + } + return { + type: M.is_default ? "ExportDefaultDeclaration" : "ExportNamedDeclaration", + declaration: to_moz(M.exported_value || M.exported_definition) + }; + }); + + def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) { + var specifiers = []; + if (M.imported_name) { + specifiers.push({ + type: "ImportDefaultSpecifier", + local: to_moz(M.imported_name) + }); + } + if (M.imported_names && M.imported_names[0].foreign_name.name === "*") { + specifiers.push({ + type: "ImportNamespaceSpecifier", + local: to_moz(M.imported_names[0].name) + }); + } else if (M.imported_names) { + M.imported_names.forEach(function(name_mapping) { + specifiers.push({ + type: "ImportSpecifier", + local: to_moz(name_mapping.name), + imported: to_moz(name_mapping.foreign_name) + }); + }); + } + return { + type: "ImportDeclaration", + specifiers: specifiers, + source: to_moz(M.module_name) + }; + }); + + def_to_moz(AST_Sequence, function To_Moz_SequenceExpression(M) { + return { + type: "SequenceExpression", + expressions: M.expressions.map(to_moz) + }; + }); + + def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) { + var isComputed = M instanceof AST_Sub; + return { + type: "MemberExpression", + object: to_moz(M.expression), + computed: isComputed, + property: isComputed ? to_moz(M.property) : {type: "Identifier", name: M.property} + }; + }); + + def_to_moz(AST_Unary, function To_Moz_Unary(M) { + return { + type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression", + operator: M.operator, + prefix: M instanceof AST_UnaryPrefix, + argument: to_moz(M.expression) + }; + }); + + def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { + if (M.operator == "=" && to_moz_in_destructuring()) { + return { + type: "AssignmentPattern", + left: to_moz(M.left), + right: to_moz(M.right) + }; + } + return { + type: M.operator == "&&" || M.operator == "||" ? "LogicalExpression" : "BinaryExpression", + left: to_moz(M.left), + operator: M.operator, + right: to_moz(M.right) + }; + }); + + def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) { + return { + type: "ArrayExpression", + elements: M.elements.map(to_moz) + }; + }); + + def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) { + return { + type: "ObjectExpression", + properties: M.properties.map(to_moz) + }; + }); + + def_to_moz(AST_ObjectProperty, function To_Moz_Property(M, parent) { + var key = M.key instanceof AST_Node ? to_moz(M.key) : { + type: "Identifier", + value: M.key + }; + if (typeof M.key === "number") { + key = { + type: "Literal", + value: Number(M.key) + }; + } + if (typeof M.key === "string") { + key = { + type: "Identifier", + name: M.key + }; + } + var kind; + var string_or_num = typeof M.key === "string" || typeof M.key === "number"; + var computed = string_or_num ? false : !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef; + if (M instanceof AST_ObjectKeyVal) { + kind = "init"; + computed = !string_or_num; + } else + if (M instanceof AST_ObjectGetter) { + kind = "get"; + } else + if (M instanceof AST_ObjectSetter) { + kind = "set"; + } + if (parent instanceof AST_Class) { + return { + type: "MethodDefinition", + computed: computed, + kind: kind, + static: M.static, + key: to_moz(M.key), + value: to_moz(M.value) + }; + } + return { + type: "Property", + computed: computed, + kind: kind, + key: key, + value: to_moz(M.value) + }; + }); + + def_to_moz(AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) { + if (parent instanceof AST_Object) { + return { + type: "Property", + computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, + kind: "init", + method: true, + shorthand: false, + key: to_moz(M.key), + value: to_moz(M.value) + }; + } + return { + type: "MethodDefinition", + computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, + kind: M.key === "constructor" ? "constructor" : "method", + static: M.static, + key: to_moz(M.key), + value: to_moz(M.value) + }; + }); + + def_to_moz(AST_Class, function To_Moz_Class(M) { + var type = M instanceof AST_ClassExpression ? "ClassExpression" : "ClassDeclaration"; + return { + type: type, + superClass: to_moz(M.extends), + id: M.name ? to_moz(M.name) : null, + body: { + type: "ClassBody", + body: M.properties.map(to_moz) + } + }; + }); + + def_to_moz(AST_NewTarget, function To_Moz_MetaProperty(M) { + return { + type: "MetaProperty", + meta: { + type: "Identifier", + name: "new" + }, + property: { + type: "Identifier", + name: "target" + } + }; + }); + + def_to_moz(AST_Symbol, function To_Moz_Identifier(M, parent) { + if (M instanceof AST_SymbolMethod && parent.quote) { + return { + type: "Literal", + value: M.name + }; + } + var def = M.definition(); + return { + type: "Identifier", + name: def ? def.mangled_name || def.name : M.name + }; + }); + + def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) { + var pattern = M.value.source; + var flags = M.value.toString().match(/[gimuys]*$/)[0]; + return { + type: "Literal", + value: new RegExp(pattern, flags), + raw: M.value.raw_source, + regex: { + pattern: pattern, + flags: flags, + } + }; + }); + + def_to_moz(AST_Constant, function To_Moz_Literal(M) { + var value = M.value; + if (typeof value === "number" && (value < 0 || (value === 0 && 1 / value < 0))) { + return { + type: "UnaryExpression", + operator: "-", + prefix: true, + argument: { + type: "Literal", + value: -value, + raw: M.start.raw + } + }; + } + return { + type: "Literal", + value: value, + raw: M.start.raw + }; + }); + + def_to_moz(AST_Atom, function To_Moz_Atom(M) { + return { + type: "Identifier", + name: String(M.value) + }; + }); + + AST_Boolean.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); + AST_Null.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); + AST_Hole.DEFMETHOD("to_mozilla_ast", function To_Moz_ArrayHole() { return null; }); + + AST_Block.DEFMETHOD("to_mozilla_ast", AST_BlockStatement.prototype.to_mozilla_ast); + AST_Lambda.DEFMETHOD("to_mozilla_ast", AST_Function.prototype.to_mozilla_ast); + + /* -----[ tools ]----- */ + + function raw_token(moznode) { + if (moznode.type == "Literal") { + return moznode.raw != null ? moznode.raw : moznode.value + ""; + } + } + + function my_start_token(moznode) { + var loc = moznode.loc, start = loc && loc.start; + var range = moznode.range; + return new AST_Token({ + file : loc && loc.source, + line : start && start.line, + col : start && start.column, + pos : range ? range[0] : moznode.start, + endline : start && start.line, + endcol : start && start.column, + endpos : range ? range[0] : moznode.start, + raw : raw_token(moznode), + }); + } + + function my_end_token(moznode) { + var loc = moznode.loc, end = loc && loc.end; + var range = moznode.range; + return new AST_Token({ + file : loc && loc.source, + line : end && end.line, + col : end && end.column, + pos : range ? range[1] : moznode.end, + endline : end && end.line, + endcol : end && end.column, + endpos : range ? range[1] : moznode.end, + raw : raw_token(moznode), + }); + } + + function map(moztype, mytype, propmap) { + var moz_to_me = "function From_Moz_" + moztype + "(M){\n"; + moz_to_me += "return new U2." + mytype.name + "({\n" + + "start: my_start_token(M),\n" + + "end: my_end_token(M)"; + + var me_to_moz = "function To_Moz_" + moztype + "(M){\n"; + me_to_moz += "return {\n" + + "type: " + JSON.stringify(moztype); + + if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop) { + var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop); + if (!m) throw new Error("Can't understand property map: " + prop); + var moz = m[1], how = m[2], my = m[3]; + moz_to_me += ",\n" + my + ": "; + me_to_moz += ",\n" + moz + ": "; + switch (how) { + case "@": + moz_to_me += "M." + moz + ".map(from_moz)"; + me_to_moz += "M." + my + ".map(to_moz)"; + break; + case ">": + moz_to_me += "from_moz(M." + moz + ")"; + me_to_moz += "to_moz(M." + my + ")"; + break; + case "=": + moz_to_me += "M." + moz; + me_to_moz += "M." + my; + break; + case "%": + moz_to_me += "from_moz(M." + moz + ").body"; + me_to_moz += "to_moz_block(M)"; + break; + default: + throw new Error("Can't understand operator in propmap: " + prop); + } + }); + + moz_to_me += "\n})\n}"; + me_to_moz += "\n}\n}"; + + //moz_to_me = parse(moz_to_me).print_to_string({ beautify: true }); + //me_to_moz = parse(me_to_moz).print_to_string({ beautify: true }); + //console.log(moz_to_me); + + moz_to_me = new Function("U2", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")( + exports, my_start_token, my_end_token, from_moz + ); + me_to_moz = new Function("to_moz", "to_moz_block", "to_moz_scope", "return(" + me_to_moz + ")")( + to_moz, to_moz_block, to_moz_scope + ); + MOZ_TO_ME[moztype] = moz_to_me; + def_to_moz(mytype, me_to_moz); + } + + var FROM_MOZ_STACK = null; + + function from_moz(node) { + FROM_MOZ_STACK.push(node); + var ret = node != null ? MOZ_TO_ME[node.type](node) : null; + FROM_MOZ_STACK.pop(); + return ret; + } + + AST_Node.from_mozilla_ast = function(node) { + var save_stack = FROM_MOZ_STACK; + FROM_MOZ_STACK = []; + var ast = from_moz(node); + FROM_MOZ_STACK = save_stack; + return ast; + }; + + function set_moz_loc(mynode, moznode, myparent) { + var start = mynode.start; + var end = mynode.end; + if (start.pos != null && end.endpos != null) { + moznode.range = [start.pos, end.endpos]; + } + if (start.line) { + moznode.loc = { + start: {line: start.line, column: start.col}, + end: end.endline ? {line: end.endline, column: end.endcol} : null + }; + if (start.file) { + moznode.loc.source = start.file; + } + } + return moznode; + } + + function def_to_moz(mytype, handler) { + mytype.DEFMETHOD("to_mozilla_ast", function(parent) { + return set_moz_loc(this, handler(this, parent)); + }); + } + + var TO_MOZ_STACK = null; + + function to_moz(node) { + if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; } + TO_MOZ_STACK.push(node); + var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null; + TO_MOZ_STACK.pop(); + if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; } + return ast; + } + + function to_moz_in_destructuring() { + var i = TO_MOZ_STACK.length; + while (i--) { + if (TO_MOZ_STACK[i] instanceof AST_Destructuring) { + return true; + } + } + return false; + } + + function to_moz_block(node) { + return { + type: "BlockStatement", + body: node.body.map(to_moz) + }; + } + + function to_moz_scope(type, node) { + var body = node.body.map(to_moz); + if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) { + body.unshift(to_moz(new AST_EmptyStatement(node.body[0]))); + } + return { + type: type, + body: body + }; + } +})(); diff --git a/tools/node_modules/terser/lib/output.js b/tools/node_modules/terser/lib/output.js new file mode 100644 index 000000000000..dbc35dc1b9d1 --- /dev/null +++ b/tools/node_modules/terser/lib/output.js @@ -0,0 +1,1939 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +var EXPECT_DIRECTIVE = /^$|[;{][\s\n]*$/; + +function is_some_comments(comment) { + // multiline comment + return comment.type == "comment2" && /@preserve|@license|@cc_on/i.test(comment.value); +} + +function OutputStream(options) { + + var readonly = !options; + options = defaults(options, { + ascii_only : false, + beautify : false, + braces : false, + comments : false, + ecma : 5, + ie8 : false, + indent_level : 4, + indent_start : 0, + inline_script : true, + keep_quoted_props: false, + max_line_len : false, + preamble : null, + quote_keys : false, + quote_style : 0, + safari10 : false, + semicolons : true, + shebang : true, + shorthand : undefined, + source_map : null, + webkit : false, + width : 80, + wrap_iife : false, + }, true); + + if (options.shorthand === undefined) + options.shorthand = options.ecma > 5; + + // Convert comment option to RegExp if neccessary and set up comments filter + var comment_filter = return_false; // Default case, throw all comments away + if (options.comments) { + var comments = options.comments; + if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { + var regex_pos = options.comments.lastIndexOf("/"); + comments = new RegExp( + options.comments.substr(1, regex_pos - 1), + options.comments.substr(regex_pos + 1) + ); + } + if (comments instanceof RegExp) { + comment_filter = function(comment) { + return comment.type != "comment5" && comments.test(comment.value); + }; + } else if (typeof comments === "function") { + comment_filter = function(comment) { + return comment.type != "comment5" && comments(this, comment); + }; + } else if (comments === "some") { + comment_filter = is_some_comments; + } else { // NOTE includes "all" option + comment_filter = return_true; + } + } + + var indentation = 0; + var current_col = 0; + var current_line = 1; + var current_pos = 0; + var OUTPUT = ""; + + var to_utf8 = options.ascii_only ? function(str, identifier) { + if (options.ecma >= 6) { + str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { + var code = get_full_char_code(ch, 0).toString(16); + return "\\u{" + code + "}"; + }); + } + return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { + var code = ch.charCodeAt(0).toString(16); + if (code.length <= 2 && !identifier) { + while (code.length < 2) code = "0" + code; + return "\\x" + code; + } else { + while (code.length < 4) code = "0" + code; + return "\\u" + code; + } + }); + } : function(str) { + var s = ""; + for (var i = 0, len = str.length; i < len; i++) { + if (is_surrogate_pair_head(str[i]) && !is_surrogate_pair_tail(str[i + 1]) + || is_surrogate_pair_tail(str[i]) && !is_surrogate_pair_head(str[i - 1])) { + s += "\\u" + str.charCodeAt(i).toString(16); + } else { + s += str[i]; + } + } + return s; + }; + + function make_string(str, quote) { + var dq = 0, sq = 0; + str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, + function(s, i) { + switch (s) { + case '"': ++dq; return '"'; + case "'": ++sq; return "'"; + case "\\": return "\\\\"; + case "\n": return "\\n"; + case "\r": return "\\r"; + case "\t": return "\\t"; + case "\b": return "\\b"; + case "\f": return "\\f"; + case "\x0B": return options.ie8 ? "\\x0B" : "\\v"; + case "\u2028": return "\\u2028"; + case "\u2029": return "\\u2029"; + case "\ufeff": return "\\ufeff"; + case "\0": + return /[0-9]/.test(get_full_char(str, i+1)) ? "\\x00" : "\\0"; + } + return s; + }); + function quote_single() { + return "'" + str.replace(/\x27/g, "\\'") + "'"; + } + function quote_double() { + return '"' + str.replace(/\x22/g, '\\"') + '"'; + } + function quote_template() { + return "`" + str.replace(/`/g, "\\`") + "`"; + } + str = to_utf8(str); + if (quote === "`") return quote_template(); + switch (options.quote_style) { + case 1: + return quote_single(); + case 2: + return quote_double(); + case 3: + return quote == "'" ? quote_single() : quote_double(); + default: + return dq > sq ? quote_single() : quote_double(); + } + } + + function encode_string(str, quote) { + var ret = make_string(str, quote); + if (options.inline_script) { + ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); + ret = ret.replace(/\x3c!--/g, "\\x3c!--"); + ret = ret.replace(/--\x3e/g, "--\\x3e"); + } + return ret; + } + + function make_name(name) { + name = name.toString(); + name = to_utf8(name, true); + return name; + } + + function make_indent(back) { + return repeat_string(" ", options.indent_start + indentation - back * options.indent_level); + } + + /* -----[ beautification/minification ]----- */ + + var has_parens = false; + var might_need_space = false; + var might_need_semicolon = false; + var might_add_newline = 0; + var need_newline_indented = false; + var need_space = false; + var newline_insert = -1; + var last = ""; + var mapping_token, mapping_name, mappings = options.source_map && []; + + var do_add_mapping = mappings ? function() { + mappings.forEach(function(mapping) { + try { + options.source_map.add( + mapping.token.file, + mapping.line, mapping.col, + mapping.token.line, mapping.token.col, + !mapping.name && mapping.token.type == "name" ? mapping.token.value : mapping.name + ); + } catch(ex) { + mapping.token.file != null && AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", { + file: mapping.token.file, + line: mapping.token.line, + col: mapping.token.col, + cline: mapping.line, + ccol: mapping.col, + name: mapping.name || "" + }); + } + }); + mappings = []; + } : noop; + + var ensure_line_len = options.max_line_len ? function() { + if (current_col > options.max_line_len) { + if (might_add_newline) { + var left = OUTPUT.slice(0, might_add_newline); + var right = OUTPUT.slice(might_add_newline); + if (mappings) { + var delta = right.length - current_col; + mappings.forEach(function(mapping) { + mapping.line++; + mapping.col += delta; + }); + } + OUTPUT = left + "\n" + right; + current_line++; + current_pos++; + current_col = right.length; + } + if (current_col > options.max_line_len) { + AST_Node.warn("Output exceeds {max_line_len} characters", options); + } + } + if (might_add_newline) { + might_add_newline = 0; + do_add_mapping(); + } + } : noop; + + var requireSemicolonChars = makePredicate("( [ + * / - , . `"); + + function print(str) { + str = String(str); + var ch = get_full_char(str, 0); + var prev = get_full_char(last, last.length - 1); + if (need_newline_indented && ch) { + need_newline_indented = false; + if (ch != "\n") { + print("\n"); + indent(); + } + } + if (need_space && ch) { + need_space = false; + if (!/[\s;})]/.test(ch)) { + space(); + } + } + newline_insert = -1; + var prev = last.charAt(last.length - 1); + if (might_need_semicolon) { + might_need_semicolon = false; + + if (prev == ":" && ch == "}" || (!ch || ";}".indexOf(ch) < 0) && prev != ";") { + if (options.semicolons || requireSemicolonChars(ch)) { + OUTPUT += ";"; + current_col++; + current_pos++; + } else { + ensure_line_len(); + OUTPUT += "\n"; + current_pos++; + current_line++; + current_col = 0; + + if (/^\s+$/.test(str)) { + // reset the semicolon flag, since we didn't print one + // now and might still have to later + might_need_semicolon = true; + } + } + + if (!options.beautify) + might_need_space = false; + } + } + + if (might_need_space) { + if ((is_identifier_char(prev) + && (is_identifier_char(ch) || ch == "\\")) + || (ch == "/" && ch == prev) + || ((ch == "+" || ch == "-") && ch == last) + ) { + OUTPUT += " "; + current_col++; + current_pos++; + } + might_need_space = false; + } + + if (mapping_token) { + mappings.push({ + token: mapping_token, + name: mapping_name, + line: current_line, + col: current_col + }); + mapping_token = false; + if (!might_add_newline) do_add_mapping(); + } + + OUTPUT += str; + has_parens = str[str.length - 1] == "("; + current_pos += str.length; + var a = str.split(/\r?\n/), n = a.length - 1; + current_line += n; + current_col += a[0].length; + if (n > 0) { + ensure_line_len(); + current_col = a[n].length; + } + last = str; + } + + var star = function() { + print("*"); + }; + + var space = options.beautify ? function() { + print(" "); + } : function() { + might_need_space = true; + }; + + var indent = options.beautify ? function(half) { + if (options.beautify) { + print(make_indent(half ? 0.5 : 0)); + } + } : noop; + + var with_indent = options.beautify ? function(col, cont) { + if (col === true) col = next_indent(); + var save_indentation = indentation; + indentation = col; + var ret = cont(); + indentation = save_indentation; + return ret; + } : function(col, cont) { return cont(); }; + + var newline = options.beautify ? function() { + if (newline_insert < 0) return print("\n"); + if (OUTPUT[newline_insert] != "\n") { + OUTPUT = OUTPUT.slice(0, newline_insert) + "\n" + OUTPUT.slice(newline_insert); + current_pos++; + current_line++; + } + newline_insert++; + } : options.max_line_len ? function() { + ensure_line_len(); + might_add_newline = OUTPUT.length; + } : noop; + + var semicolon = options.beautify ? function() { + print(";"); + } : function() { + might_need_semicolon = true; + }; + + function force_semicolon() { + might_need_semicolon = false; + print(";"); + } + + function next_indent() { + return indentation + options.indent_level; + } + + function with_block(cont) { + var ret; + print("{"); + newline(); + with_indent(next_indent(), function() { + ret = cont(); + }); + indent(); + print("}"); + return ret; + } + + function with_parens(cont) { + print("("); + //XXX: still nice to have that for argument lists + //var ret = with_indent(current_col, cont); + var ret = cont(); + print(")"); + return ret; + } + + function with_square(cont) { + print("["); + //var ret = with_indent(current_col, cont); + var ret = cont(); + print("]"); + return ret; + } + + function comma() { + print(","); + space(); + } + + function colon() { + print(":"); + space(); + } + + var add_mapping = mappings ? function(token, name) { + mapping_token = token; + mapping_name = name; + } : noop; + + function get() { + if (might_add_newline) { + ensure_line_len(); + } + return OUTPUT; + } + + function has_nlb() { + var index = OUTPUT.lastIndexOf("\n"); + return /^ *$/.test(OUTPUT.slice(index + 1)); + } + + function prepend_comments(node) { + var self = this; + var start = node.start; + if (!start) return; + if (start.comments_before && start.comments_before._dumped === self) return; + var comments = start.comments_before; + if (!comments) { + comments = start.comments_before = []; + } + comments._dumped = self; + + if (node instanceof AST_Exit && node.value) { + var tw = new TreeWalker(function(node) { + var parent = tw.parent(); + if (parent instanceof AST_Exit + || parent instanceof AST_Binary && parent.left === node + || parent.TYPE == "Call" && parent.expression === node + || parent instanceof AST_Conditional && parent.condition === node + || parent instanceof AST_Dot && parent.expression === node + || parent instanceof AST_Sequence && parent.expressions[0] === node + || parent instanceof AST_Sub && parent.expression === node + || parent instanceof AST_UnaryPostfix) { + if (!node.start) return; + var text = node.start.comments_before; + if (text && text._dumped !== self) { + text._dumped = self; + comments = comments.concat(text); + } + } else { + return true; + } + }); + tw.push(node); + node.value.walk(tw); + } + + if (current_pos == 0) { + if (comments.length > 0 && options.shebang && comments[0].type == "comment5") { + print("#!" + comments.shift().value + "\n"); + indent(); + } + var preamble = options.preamble; + if (preamble) { + print(preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n")); + } + } + + comments = comments.filter(comment_filter, node); + if (comments.length == 0) return; + var last_nlb = has_nlb(); + comments.forEach(function(c, i) { + if (!last_nlb) { + if (c.nlb) { + print("\n"); + indent(); + last_nlb = true; + } else if (i > 0) { + space(); + } + } + if (/comment[134]/.test(c.type)) { + print("//" + c.value.replace(/[@#]__PURE__/g, " ") + "\n"); + indent(); + last_nlb = true; + } else if (c.type == "comment2") { + print("/*" + c.value.replace(/[@#]__PURE__/g, " ") + "*/"); + last_nlb = false; + } + }); + if (!last_nlb) { + if (start.nlb) { + print("\n"); + indent(); + } else { + space(); + } + } + } + + function append_comments(node, tail) { + var self = this; + var token = node.end; + if (!token) return; + var comments = token[tail ? "comments_before" : "comments_after"]; + if (!comments || comments._dumped === self) return; + if (!(node instanceof AST_Statement || all(comments, function(c) { + return !/comment[134]/.test(c.type); + }))) return; + comments._dumped = self; + var insert = OUTPUT.length; + comments.filter(comment_filter, node).forEach(function(c, i) { + need_space = false; + if (need_newline_indented) { + print("\n"); + indent(); + need_newline_indented = false; + } else if (c.nlb && (i > 0 || !has_nlb())) { + print("\n"); + indent(); + } else if (i > 0 || !tail) { + space(); + } + if (/comment[134]/.test(c.type)) { + print("//" + c.value.replace(/[@#]__PURE__/g, " ")); + need_newline_indented = true; + } else if (c.type == "comment2") { + print("/*" + c.value.replace(/[@#]__PURE__/g, " ") + "*/"); + need_space = true; + } + }); + if (OUTPUT.length > insert) newline_insert = insert; + } + + var stack = []; + return { + get : get, + toString : get, + indent : indent, + indentation : function() { return indentation; }, + current_width : function() { return current_col - indentation; }, + should_break : function() { return options.width && this.current_width() >= options.width; }, + has_parens : function() { return has_parens; }, + newline : newline, + print : print, + star : star, + space : space, + comma : comma, + colon : colon, + last : function() { return last; }, + semicolon : semicolon, + force_semicolon : force_semicolon, + to_utf8 : to_utf8, + print_name : function(name) { print(make_name(name)); }, + print_string : function(str, quote, escape_directive) { + var encoded = encode_string(str, quote); + if (escape_directive === true && encoded.indexOf("\\") === -1) { + // Insert semicolons to break directive prologue + if (!EXPECT_DIRECTIVE.test(OUTPUT)) { + force_semicolon(); + } + force_semicolon(); + } + print(encoded); + }, + print_template_string_chars: function(str) { + var encoded = encode_string(str, "`").replace(/\${/g, "\\${"); + return print(encoded.substr(1, encoded.length - 2)); + }, + encode_string : encode_string, + next_indent : next_indent, + with_indent : with_indent, + with_block : with_block, + with_parens : with_parens, + with_square : with_square, + add_mapping : add_mapping, + option : function(opt) { return options[opt]; }, + prepend_comments: readonly ? noop : prepend_comments, + append_comments : readonly || comment_filter === return_false ? noop : append_comments, + line : function() { return current_line; }, + col : function() { return current_col; }, + pos : function() { return current_pos; }, + push_node : function(node) { stack.push(node); }, + pop_node : function() { return stack.pop(); }, + parent : function(n) { + return stack[stack.length - 2 - (n || 0)]; + } + }; + +} + +/* -----[ code generators ]----- */ + +(function() { + + /* -----[ utils ]----- */ + + function DEFPRINT(nodetype, generator) { + nodetype.DEFMETHOD("_codegen", generator); + } + + var in_directive = false; + var active_scope = null; + var use_asm = null; + + AST_Node.DEFMETHOD("print", function(stream, force_parens) { + var self = this, generator = self._codegen; + if (self instanceof AST_Scope) { + active_scope = self; + } else if (!use_asm && self instanceof AST_Directive && self.value == "use asm") { + use_asm = active_scope; + } + function doit() { + stream.prepend_comments(self); + self.add_source_map(stream); + generator(self, stream); + stream.append_comments(self); + } + stream.push_node(self); + if (force_parens || self.needs_parens(stream)) { + stream.with_parens(doit); + } else { + doit(); + } + stream.pop_node(); + if (self === use_asm) { + use_asm = null; + } + }); + AST_Node.DEFMETHOD("_print", AST_Node.prototype.print); + + AST_Node.DEFMETHOD("print_to_string", function(options) { + var s = OutputStream(options); + this.print(s); + return s.get(); + }); + + /* -----[ PARENTHESES ]----- */ + + function PARENS(nodetype, func) { + if (Array.isArray(nodetype)) { + nodetype.forEach(function(nodetype) { + PARENS(nodetype, func); + }); + } else { + nodetype.DEFMETHOD("needs_parens", func); + } + } + + PARENS(AST_Node, return_false); + + // a function expression needs parens around it when it's provably + // the first token to appear in a statement. + PARENS(AST_Function, function(output) { + if (!output.has_parens() && first_in_statement(output)) { + return true; + } + + if (output.option("webkit")) { + var p = output.parent(); + if (p instanceof AST_PropAccess && p.expression === this) { + return true; + } + } + + if (output.option("wrap_iife")) { + var p = output.parent(); + return p instanceof AST_Call && p.expression === this; + } + + return false; + }); + + PARENS(AST_Arrow, function(output) { + var p = output.parent(); + return p instanceof AST_PropAccess && p.expression === this; + }); + + // same goes for an object literal, because otherwise it would be + // interpreted as a block of code. + PARENS(AST_Object, function(output) { + return !output.has_parens() && first_in_statement(output); + }); + + PARENS(AST_ClassExpression, first_in_statement); + + PARENS(AST_Unary, function(output) { + var p = output.parent(); + return p instanceof AST_PropAccess && p.expression === this + || p instanceof AST_Call && p.expression === this + || p instanceof AST_Binary + && p.operator === "**" + && this instanceof AST_UnaryPrefix + && p.left === this + && this.operator !== "++" + && this.operator !== "--"; + }); + + PARENS(AST_Await, function(output) { + var p = output.parent(); + return p instanceof AST_PropAccess && p.expression === this + || p instanceof AST_Call && p.expression === this + || output.option("safari10") && p instanceof AST_UnaryPrefix; + }); + + PARENS(AST_Sequence, function(output) { + var p = output.parent(); + return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) + || p instanceof AST_Unary // !(foo, bar, baz) + || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8 + || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4 + || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2 + || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ] + || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2 + || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30) + * ==> 20 (side effect, set a := 10 and b := 20) */ + || p instanceof AST_Arrow // x => (x, x) + || p instanceof AST_DefaultAssign // x => (x = (0, function(){})) + || p instanceof AST_Expansion // [...(a, b)] + || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {} + || p instanceof AST_Yield // yield (foo, bar) + || p instanceof AST_Export // export default (foo, bar) + ; + }); + + PARENS(AST_Binary, function(output) { + var p = output.parent(); + // (foo && bar)() + if (p instanceof AST_Call && p.expression === this) + return true; + // typeof (foo && bar) + if (p instanceof AST_Unary) + return true; + // (foo && bar)["prop"], (foo && bar).prop + if (p instanceof AST_PropAccess && p.expression === this) + return true; + // this deals with precedence: 3 * (2 + 1) + if (p instanceof AST_Binary) { + var po = p.operator, pp = PRECEDENCE[po]; + var so = this.operator, sp = PRECEDENCE[so]; + if (pp > sp + || (pp == sp + && (this === p.right || po == "**"))) { + return true; + } + } + }); + + PARENS(AST_Yield, function(output) { + var p = output.parent(); + // (yield 1) + (yield 2) + // a = yield 3 + if (p instanceof AST_Binary && p.operator !== "=") + return true; + // (yield 1)() + // new (yield 1)() + if (p instanceof AST_Call && p.expression === this) + return true; + // (yield 1) ? yield 2 : yield 3 + if (p instanceof AST_Conditional && p.condition === this) + return true; + // -(yield 4) + if (p instanceof AST_Unary) + return true; + // (yield x).foo + // (yield x)['foo'] + if (p instanceof AST_PropAccess && p.expression === this) + return true; + }); + + PARENS(AST_PropAccess, function(output) { + var p = output.parent(); + if (p instanceof AST_New && p.expression === this) { + // i.e. new (foo.bar().baz) + // + // if there's one call into this subtree, then we need + // parens around it too, otherwise the call will be + // interpreted as passing the arguments to the upper New + // expression. + var parens = false; + this.walk(new TreeWalker(function(node) { + if (parens || node instanceof AST_Scope) return true; + if (node instanceof AST_Call) { + parens = true; + return true; + } + })); + return parens; + } + }); + + PARENS(AST_Call, function(output) { + var p = output.parent(), p1; + if (p instanceof AST_New && p.expression === this + || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function) + return true; + + // workaround for Safari bug. + // https://bugs.webkit.org/show_bug.cgi?id=123506 + return this.expression instanceof AST_Function + && p instanceof AST_PropAccess + && p.expression === this + && (p1 = output.parent(1)) instanceof AST_Assign + && p1.left === p; + }); + + PARENS(AST_New, function(output) { + var p = output.parent(); + if (!need_constructor_parens(this, output) + && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() + || p instanceof AST_Call && p.expression === this)) // (new foo)(bar) + return true; + }); + + PARENS(AST_Number, function(output) { + var p = output.parent(); + if (p instanceof AST_PropAccess && p.expression === this) { + var value = this.getValue(); + if (value < 0 || /^0/.test(make_num(value))) { + return true; + } + } + }); + + PARENS([ AST_Assign, AST_Conditional ], function(output) { + var p = output.parent(); + // !(a = false) → true + if (p instanceof AST_Unary) + return true; + // 1 + (a = 2) + 3 → 6, side effect setting a = 2 + if (p instanceof AST_Binary && !(p instanceof AST_Assign)) + return true; + // (a = func)() —or— new (a = Object)() + if (p instanceof AST_Call && p.expression === this) + return true; + // (a = foo) ? bar : baz + if (p instanceof AST_Conditional && p.condition === this) + return true; + // (a = foo)["prop"] —or— (a = foo).prop + if (p instanceof AST_PropAccess && p.expression === this) + return true; + // ({a, b} = {a: 1, b: 2}), a destructuring assignment + if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false) + return true; + }); + + /* -----[ PRINTERS ]----- */ + + DEFPRINT(AST_Directive, function(self, output) { + output.print_string(self.value, self.quote); + output.semicolon(); + }); + + DEFPRINT(AST_Expansion, function (self, output) { + output.print("..."); + self.expression.print(output); + }); + + DEFPRINT(AST_Destructuring, function (self, output) { + output.print(self.is_array ? "[" : "{"); + var len = self.names.length; + self.names.forEach(function (name, i) { + if (i > 0) output.comma(); + name.print(output); + // If the final element is a hole, we need to make sure it + // doesn't look like a trailing comma, by inserting an actual + // trailing comma. + if (i == len - 1 && name instanceof AST_Hole) output.comma(); + }); + output.print(self.is_array ? "]" : "}"); + }); + + DEFPRINT(AST_Debugger, function(self, output) { + output.print("debugger"); + output.semicolon(); + }); + + /* -----[ statements ]----- */ + + function display_body(body, is_toplevel, output, allow_directives) { + var last = body.length - 1; + in_directive = allow_directives; + body.forEach(function(stmt, i) { + if (in_directive === true && !(stmt instanceof AST_Directive || + stmt instanceof AST_EmptyStatement || + (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String) + )) { + in_directive = false; + } + if (!(stmt instanceof AST_EmptyStatement)) { + output.indent(); + stmt.print(output); + if (!(i == last && is_toplevel)) { + output.newline(); + if (is_toplevel) output.newline(); + } + } + if (in_directive === true && + stmt instanceof AST_SimpleStatement && + stmt.body instanceof AST_String + ) { + in_directive = false; + } + }); + in_directive = false; + } + + AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { + force_statement(this.body, output); + }); + + DEFPRINT(AST_Statement, function(self, output) { + self.body.print(output); + output.semicolon(); + }); + DEFPRINT(AST_Toplevel, function(self, output) { + display_body(self.body, true, output, true); + output.print(""); + }); + DEFPRINT(AST_LabeledStatement, function(self, output) { + self.label.print(output); + output.colon(); + self.body.print(output); + }); + DEFPRINT(AST_SimpleStatement, function(self, output) { + self.body.print(output); + output.semicolon(); + }); + function print_braced_empty(self, output) { + output.print("{"); + output.with_indent(output.next_indent(), function() { + output.append_comments(self, true); + }); + output.print("}"); + } + function print_braced(self, output, allow_directives) { + if (self.body.length > 0) { + output.with_block(function() { + display_body(self.body, false, output, allow_directives); + }); + } else print_braced_empty(self, output); + } + DEFPRINT(AST_BlockStatement, function(self, output) { + print_braced(self, output); + }); + DEFPRINT(AST_EmptyStatement, function(self, output) { + output.semicolon(); + }); + DEFPRINT(AST_Do, function(self, output) { + output.print("do"); + output.space(); + make_block(self.body, output); + output.space(); + output.print("while"); + output.space(); + output.with_parens(function() { + self.condition.print(output); + }); + output.semicolon(); + }); + DEFPRINT(AST_While, function(self, output) { + output.print("while"); + output.space(); + output.with_parens(function() { + self.condition.print(output); + }); + output.space(); + self._do_print_body(output); + }); + DEFPRINT(AST_For, function(self, output) { + output.print("for"); + output.space(); + output.with_parens(function() { + if (self.init) { + if (self.init instanceof AST_Definitions) { + self.init.print(output); + } else { + parenthesize_for_noin(self.init, output, true); + } + output.print(";"); + output.space(); + } else { + output.print(";"); + } + if (self.condition) { + self.condition.print(output); + output.print(";"); + output.space(); + } else { + output.print(";"); + } + if (self.step) { + self.step.print(output); + } + }); + output.space(); + self._do_print_body(output); + }); + DEFPRINT(AST_ForIn, function(self, output) { + output.print("for"); + if (self.await) { + output.space(); + output.print("await"); + } + output.space(); + output.with_parens(function() { + self.init.print(output); + output.space(); + output.print(self instanceof AST_ForOf ? "of" : "in"); + output.space(); + self.object.print(output); + }); + output.space(); + self._do_print_body(output); + }); + DEFPRINT(AST_With, function(self, output) { + output.print("with"); + output.space(); + output.with_parens(function() { + self.expression.print(output); + }); + output.space(); + self._do_print_body(output); + }); + + /* -----[ functions ]----- */ + AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { + var self = this; + if (!nokeyword) { + if (self.async) { + output.print("async"); + output.space(); + } + output.print("function"); + if (self.is_generator) { + output.star(); + } + if (self.name) { + output.space(); + } + } + if (self.name instanceof AST_Symbol) { + self.name.print(output); + } else if (nokeyword && self.name instanceof AST_Node) { + output.with_square(function() { + self.name.print(output); // Computed method name + }); + } + output.with_parens(function() { + self.argnames.forEach(function(arg, i) { + if (i) output.comma(); + arg.print(output); + }); + }); + output.space(); + print_braced(self, output, true); + }); + DEFPRINT(AST_Lambda, function(self, output) { + self._do_print(output); + }); + + DEFPRINT(AST_PrefixedTemplateString, function(self, output) { + var tag = self.prefix; + var parenthesize_tag = tag instanceof AST_Arrow + || tag instanceof AST_Binary + || tag instanceof AST_Conditional + || tag instanceof AST_Sequence + || tag instanceof AST_Unary; + if (parenthesize_tag) output.print("("); + self.prefix.print(output); + if (parenthesize_tag) output.print(")"); + self.template_string.print(output); + }); + DEFPRINT(AST_TemplateString, function(self, output) { + var is_tagged = output.parent() instanceof AST_PrefixedTemplateString; + + output.print("`"); + for (var i = 0; i < self.segments.length; i++) { + if (!(self.segments[i] instanceof AST_TemplateSegment)) { + output.print("${"); + self.segments[i].print(output); + output.print("}"); + } else if (is_tagged) { + output.print(self.segments[i].raw); + } else { + output.print_template_string_chars(self.segments[i].value); + } + } + output.print("`"); + }); + + AST_Arrow.DEFMETHOD("_do_print", function(output) { + var self = this; + var parent = output.parent(); + var needs_parens = parent instanceof AST_Binary || + parent instanceof AST_Unary || + (parent instanceof AST_Call && self === parent.expression); + if (needs_parens) { output.print("("); } + if (self.async) { + output.print("async"); + output.space(); + } + if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) { + self.argnames[0].print(output); + } else { + output.with_parens(function() { + self.argnames.forEach(function(arg, i) { + if (i) output.comma(); + arg.print(output); + }); + }); + } + output.space(); + output.print("=>"); + output.space(); + if (self.body instanceof AST_Node) { + self.body.print(output); + } else { + print_braced(self, output); + } + if (needs_parens) { output.print(")"); } + }); + + /* -----[ exits ]----- */ + AST_Exit.DEFMETHOD("_do_print", function(output, kind) { + output.print(kind); + if (this.value) { + output.space(); + this.value.print(output); + } + output.semicolon(); + }); + DEFPRINT(AST_Return, function(self, output) { + self._do_print(output, "return"); + }); + DEFPRINT(AST_Throw, function(self, output) { + self._do_print(output, "throw"); + }); + + /* -----[ yield ]----- */ + + DEFPRINT(AST_Yield, function(self, output) { + var star = self.is_star ? "*" : ""; + output.print("yield" + star); + if (self.expression) { + output.space(); + self.expression.print(output); + } + }); + + DEFPRINT(AST_Await, function(self, output) { + output.print("await"); + output.space(); + var e = self.expression; + var parens = !( + e instanceof AST_Call + || e instanceof AST_SymbolRef + || e instanceof AST_PropAccess + || e instanceof AST_Unary + || e instanceof AST_Constant + ); + if (parens) output.print("("); + self.expression.print(output); + if (parens) output.print(")"); + }); + + /* -----[ loop control ]----- */ + AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { + output.print(kind); + if (this.label) { + output.space(); + this.label.print(output); + } + output.semicolon(); + }); + DEFPRINT(AST_Break, function(self, output) { + self._do_print(output, "break"); + }); + DEFPRINT(AST_Continue, function(self, output) { + self._do_print(output, "continue"); + }); + + /* -----[ if ]----- */ + function make_then(self, output) { + var b = self.body; + if (output.option("braces") + || output.option("ie8") && b instanceof AST_Do) + return make_block(b, output); + // The squeezer replaces "block"-s that contain only a single + // statement with the statement itself; technically, the AST + // is correct, but this can create problems when we output an + // IF having an ELSE clause where the THEN clause ends in an + // IF *without* an ELSE block (then the outer ELSE would refer + // to the inner IF). This function checks for this case and + // adds the block braces if needed. + if (!b) return output.force_semicolon(); + while (true) { + if (b instanceof AST_If) { + if (!b.alternative) { + make_block(self.body, output); + return; + } + b = b.alternative; + } else if (b instanceof AST_StatementWithBody) { + b = b.body; + } else break; + } + force_statement(self.body, output); + } + DEFPRINT(AST_If, function(self, output) { + output.print("if"); + output.space(); + output.with_parens(function() { + self.condition.print(output); + }); + output.space(); + if (self.alternative) { + make_then(self, output); + output.space(); + output.print("else"); + output.space(); + if (self.alternative instanceof AST_If) + self.alternative.print(output); + else + force_statement(self.alternative, output); + } else { + self._do_print_body(output); + } + }); + + /* -----[ switch ]----- */ + DEFPRINT(AST_Switch, function(self, output) { + output.print("switch"); + output.space(); + output.with_parens(function() { + self.expression.print(output); + }); + output.space(); + var last = self.body.length - 1; + if (last < 0) print_braced_empty(self, output); + else output.with_block(function() { + self.body.forEach(function(branch, i) { + output.indent(true); + branch.print(output); + if (i < last && branch.body.length > 0) + output.newline(); + }); + }); + }); + AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { + output.newline(); + this.body.forEach(function(stmt) { + output.indent(); + stmt.print(output); + output.newline(); + }); + }); + DEFPRINT(AST_Default, function(self, output) { + output.print("default:"); + self._do_print_body(output); + }); + DEFPRINT(AST_Case, function(self, output) { + output.print("case"); + output.space(); + self.expression.print(output); + output.print(":"); + self._do_print_body(output); + }); + + /* -----[ exceptions ]----- */ + DEFPRINT(AST_Try, function(self, output) { + output.print("try"); + output.space(); + print_braced(self, output); + if (self.bcatch) { + output.space(); + self.bcatch.print(output); + } + if (self.bfinally) { + output.space(); + self.bfinally.print(output); + } + }); + DEFPRINT(AST_Catch, function(self, output) { + output.print("catch"); + if (self.argname) { + output.space(); + output.with_parens(function() { + self.argname.print(output); + }); + } + output.space(); + print_braced(self, output); + }); + DEFPRINT(AST_Finally, function(self, output) { + output.print("finally"); + output.space(); + print_braced(self, output); + }); + + /* -----[ var/const ]----- */ + AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { + output.print(kind); + output.space(); + this.definitions.forEach(function(def, i) { + if (i) output.comma(); + def.print(output); + }); + var p = output.parent(); + var in_for = p instanceof AST_For || p instanceof AST_ForIn; + var output_semicolon = !in_for || p && p.init !== this; + if (output_semicolon) + output.semicolon(); + }); + DEFPRINT(AST_Let, function(self, output) { + self._do_print(output, "let"); + }); + DEFPRINT(AST_Var, function(self, output) { + self._do_print(output, "var"); + }); + DEFPRINT(AST_Const, function(self, output) { + self._do_print(output, "const"); + }); + DEFPRINT(AST_Import, function(self, output) { + output.print("import"); + output.space(); + if (self.imported_name) { + self.imported_name.print(output); + } + if (self.imported_name && self.imported_names) { + output.print(","); + output.space(); + } + if (self.imported_names) { + if (self.imported_names.length === 1 && self.imported_names[0].foreign_name.name === "*") { + self.imported_names[0].print(output); + } else { + output.print("{"); + self.imported_names.forEach(function (name_import, i) { + output.space(); + name_import.print(output); + if (i < self.imported_names.length - 1) { + output.print(","); + } + }); + output.space(); + output.print("}"); + } + } + if (self.imported_name || self.imported_names) { + output.space(); + output.print("from"); + output.space(); + } + self.module_name.print(output); + output.semicolon(); + }); + + DEFPRINT(AST_NameMapping, function(self, output) { + var is_import = output.parent() instanceof AST_Import; + var definition = self.name.definition(); + var names_are_different = + (definition && definition.mangled_name || self.name.name) !== + self.foreign_name.name; + if (names_are_different) { + if (is_import) { + output.print(self.foreign_name.name); + } else { + self.name.print(output); + } + output.space(); + output.print("as"); + output.space(); + if (is_import) { + self.name.print(output); + } else { + output.print(self.foreign_name.name); + } + } else { + self.name.print(output); + } + }); + + DEFPRINT(AST_Export, function(self, output) { + output.print("export"); + output.space(); + if (self.is_default) { + output.print("default"); + output.space(); + } + if (self.exported_names) { + if (self.exported_names.length === 1 && self.exported_names[0].name.name === "*") { + self.exported_names[0].print(output); + } else { + output.print("{"); + self.exported_names.forEach(function(name_export, i) { + output.space(); + name_export.print(output); + if (i < self.exported_names.length - 1) { + output.print(","); + } + }); + output.space(); + output.print("}"); + } + } else if (self.exported_value) { + self.exported_value.print(output); + } else if (self.exported_definition) { + self.exported_definition.print(output); + if (self.exported_definition instanceof AST_Definitions) return; + } + if (self.module_name) { + output.space(); + output.print("from"); + output.space(); + self.module_name.print(output); + } + if (self.exported_value + && !(self.exported_value instanceof AST_Defun || + self.exported_value instanceof AST_Function || + self.exported_value instanceof AST_Class) + || self.module_name + || self.exported_names + ) { + output.semicolon(); + } + }); + + function parenthesize_for_noin(node, output, noin) { + var parens = false; + // need to take some precautions here: + // https://github.com/mishoo/UglifyJS2/issues/60 + if (noin) node.walk(new TreeWalker(function(node) { + if (parens || node instanceof AST_Scope) return true; + if (node instanceof AST_Binary && node.operator == "in") { + parens = true; + return true; + } + })); + node.print(output, parens); + } + + DEFPRINT(AST_VarDef, function(self, output) { + self.name.print(output); + if (self.value) { + output.space(); + output.print("="); + output.space(); + var p = output.parent(1); + var noin = p instanceof AST_For || p instanceof AST_ForIn; + parenthesize_for_noin(self.value, output, noin); + } + }); + + /* -----[ other expressions ]----- */ + DEFPRINT(AST_Call, function(self, output) { + self.expression.print(output); + if (self instanceof AST_New && !need_constructor_parens(self, output)) + return; + if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) { + output.add_mapping(self.start); + } + output.with_parens(function() { + self.args.forEach(function(expr, i) { + if (i) output.comma(); + expr.print(output); + }); + }); + }); + DEFPRINT(AST_New, function(self, output) { + output.print("new"); + output.space(); + AST_Call.prototype._codegen(self, output); + }); + + AST_Sequence.DEFMETHOD("_do_print", function(output) { + this.expressions.forEach(function(node, index) { + if (index > 0) { + output.comma(); + if (output.should_break()) { + output.newline(); + output.indent(); + } + } + node.print(output); + }); + }); + DEFPRINT(AST_Sequence, function(self, output) { + self._do_print(output); + // var p = output.parent(); + // if (p instanceof AST_Statement) { + // output.with_indent(output.next_indent(), function(){ + // self._do_print(output); + // }); + // } else { + // self._do_print(output); + // } + }); + DEFPRINT(AST_Dot, function(self, output) { + var expr = self.expression; + expr.print(output); + var prop = self.property; + if (output.option("ie8") && RESERVED_WORDS(prop)) { + output.print("["); + output.add_mapping(self.end); + output.print_string(prop); + output.print("]"); + } else { + if (expr instanceof AST_Number && expr.getValue() >= 0) { + if (!/[xa-f.)]/i.test(output.last())) { + output.print("."); + } + } + output.print("."); + // the name after dot would be mapped about here. + output.add_mapping(self.end); + output.print_name(prop); + } + }); + DEFPRINT(AST_Sub, function(self, output) { + self.expression.print(output); + output.print("["); + self.property.print(output); + output.print("]"); + }); + DEFPRINT(AST_UnaryPrefix, function(self, output) { + var op = self.operator; + output.print(op); + if (/^[a-z]/i.test(op) + || (/[+-]$/.test(op) + && self.expression instanceof AST_UnaryPrefix + && /^[+-]/.test(self.expression.operator))) { + output.space(); + } + self.expression.print(output); + }); + DEFPRINT(AST_UnaryPostfix, function(self, output) { + self.expression.print(output); + output.print(self.operator); + }); + DEFPRINT(AST_Binary, function(self, output) { + var op = self.operator; + self.left.print(output); + if (op[0] == ">" /* ">>" ">>>" ">" ">=" */ + && self.left instanceof AST_UnaryPostfix + && self.left.operator == "--") { + // space is mandatory to avoid outputting --> + output.print(" "); + } else { + // the space is optional depending on "beautify" + output.space(); + } + output.print(op); + if ((op == "<" || op == "<<") + && self.right instanceof AST_UnaryPrefix + && self.right.operator == "!" + && self.right.expression instanceof AST_UnaryPrefix + && self.right.expression.operator == "--") { + // space is mandatory to avoid outputting ") && S.newline_before) { + forward(3); + skip_line_comment("comment4"); + continue; + } + } + var ch = peek(); + if (!ch) return token("eof"); + var code = ch.charCodeAt(0); + switch (code) { + case 34: case 39: return read_string(ch); + case 46: return handle_dot(); + case 47: { + var tok = handle_slash(); + if (tok === next_token) continue; + return tok; + } + case 61: return handle_eq_sign(); + case 96: return read_template_characters(true); + case 123: + S.brace_counter++; + break; + case 125: + S.brace_counter--; + if (S.template_braces.length > 0 + && S.template_braces[S.template_braces.length - 1] === S.brace_counter) + return read_template_characters(false); + break; + } + if (is_digit(code)) return read_num(); + if (PUNC_CHARS(ch)) return token("punc", next()); + if (OPERATOR_CHARS(ch)) return read_operator(); + if (code == 92 || is_identifier_start(ch)) return read_word(); + break; + } + parse_error("Unexpected character '" + ch + "'"); + } + + next_token.next = next; + next_token.peek = peek; + + next_token.context = function(nc) { + if (nc) S = nc; + return S; + }; + + next_token.add_directive = function(directive) { + S.directive_stack[S.directive_stack.length - 1].push(directive); + + if (S.directives[directive] === undefined) { + S.directives[directive] = 1; + } else { + S.directives[directive]++; + } + }; + + next_token.push_directives_stack = function() { + S.directive_stack.push([]); + }; + + next_token.pop_directives_stack = function() { + var directives = S.directive_stack[S.directive_stack.length - 1]; + + for (var i = 0; i < directives.length; i++) { + S.directives[directives[i]]--; + } + + S.directive_stack.pop(); + }; + + next_token.has_directive = function(directive) { + return S.directives[directive] > 0; + }; + + return next_token; + +} + +/* -----[ Parser (constants) ]----- */ + +var UNARY_PREFIX = makePredicate([ + "typeof", + "void", + "delete", + "--", + "++", + "!", + "~", + "-", + "+" +]); + +var UNARY_POSTFIX = makePredicate([ "--", "++" ]); + +var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); + +var PRECEDENCE = (function(a, ret) { + for (var i = 0; i < a.length; ++i) { + var b = a[i]; + for (var j = 0; j < b.length; ++j) { + ret[b[j]] = i + 1; + } + } + return ret; +})( + [ + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "===", "!=", "!=="], + ["<", ">", "<=", ">=", "in", "instanceof"], + [">>", "<<", ">>>"], + ["+", "-"], + ["*", "/", "%"], + ["**"] + ], + {} +); + +var ATOMIC_START_TOKEN = makePredicate([ "atom", "num", "string", "regexp", "name" ]); + +/* -----[ Parser ]----- */ + +function parse($TEXT, options) { + + options = defaults(options, { + bare_returns : false, + ecma : 8, + expression : false, + filename : null, + html5_comments : true, + module : false, + shebang : true, + strict : false, + toplevel : null, + }, true); + + var S = { + input : (typeof $TEXT == "string" + ? tokenizer($TEXT, options.filename, + options.html5_comments, options.shebang) + : $TEXT), + token : null, + prev : null, + peeked : null, + in_function : 0, + in_async : -1, + in_generator : -1, + in_directives : true, + in_loop : 0, + labels : [] + }; + + S.token = next(); + + function is(type, value) { + return is_token(S.token, type, value); + } + + function peek() { return S.peeked || (S.peeked = S.input()); } + + function next() { + S.prev = S.token; + + if (!S.peeked) peek(); + S.token = S.peeked; + S.peeked = null; + S.in_directives = S.in_directives && ( + S.token.type == "string" || is("punc", ";") + ); + return S.token; + } + + function prev() { + return S.prev; + } + + function croak(msg, line, col, pos) { + var ctx = S.input.context(); + js_error(msg, + ctx.filename, + line != null ? line : ctx.tokline, + col != null ? col : ctx.tokcol, + pos != null ? pos : ctx.tokpos); + } + + function token_error(token, msg) { + croak(msg, token.line, token.col); + } + + function unexpected(token) { + if (token == null) + token = S.token; + token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); + } + + function expect_token(type, val) { + if (is(type, val)) { + return next(); + } + token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); + } + + function expect(punc) { return expect_token("punc", punc); } + + function has_newline_before(token) { + return token.nlb || !all(token.comments_before, function(comment) { + return !comment.nlb; + }); + } + + function can_insert_semicolon() { + return !options.strict + && (is("eof") || is("punc", "}") || has_newline_before(S.token)); + } + + function is_in_generator() { + return S.in_generator === S.in_function; + } + + function is_in_async() { + return S.in_async === S.in_function; + } + + function semicolon(optional) { + if (is("punc", ";")) next(); + else if (!optional && !can_insert_semicolon()) unexpected(); + } + + function parenthesised() { + expect("("); + var exp = expression(true); + expect(")"); + return exp; + } + + function embed_tokens(parser) { + return function() { + var start = S.token; + var expr = parser.apply(null, arguments); + var end = prev(); + expr.start = start; + expr.end = end; + return expr; + }; + } + + function handle_regexp() { + if (is("operator", "/") || is("operator", "/=")) { + S.peeked = null; + S.token = S.input(S.token.value.substr(1)); // force regexp + } + } + + var statement = embed_tokens(function(is_export_default, is_for_body, is_if_body) { + handle_regexp(); + switch (S.token.type) { + case "string": + if (S.in_directives) { + var token = peek(); + if (S.token.raw.indexOf("\\") == -1 + && (is_token(token, "punc", ";") + || is_token(token, "punc", "}") + || has_newline_before(token) + || is_token(token, "eof"))) { + S.input.add_directive(S.token.value); + } else { + S.in_directives = false; + } + } + var dir = S.in_directives, stat = simple_statement(); + return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat; + case "template_head": + case "num": + case "regexp": + case "operator": + case "atom": + return simple_statement(); + + case "name": + if (S.token.value == "async" && is_token(peek(), "keyword", "function")) { + next(); + next(); + if (is_for_body) { + croak("functions are not allowed as the body of a loop"); + } + return function_(AST_Defun, false, true, is_export_default); + } + if (S.token.value == "import" && !is_token(peek(), "punc", "(")) { + next(); + var node = import_(); + semicolon(); + return node; + } + return is_token(peek(), "punc", ":") + ? labeled_statement() + : simple_statement(); + + case "punc": + switch (S.token.value) { + case "{": + return new AST_BlockStatement({ + start : S.token, + body : block_(), + end : prev() + }); + case "[": + case "(": + return simple_statement(); + case ";": + S.in_directives = false; + next(); + return new AST_EmptyStatement(); + default: + unexpected(); + } + + case "keyword": + switch (S.token.value) { + case "break": + next(); + return break_cont(AST_Break); + + case "continue": + next(); + return break_cont(AST_Continue); + + case "debugger": + next(); + semicolon(); + return new AST_Debugger(); + + case "do": + next(); + var body = in_loop(statement); + expect_token("keyword", "while"); + var condition = parenthesised(); + semicolon(true); + return new AST_Do({ + body : body, + condition : condition + }); + + case "while": + next(); + return new AST_While({ + condition : parenthesised(), + body : in_loop(function() { return statement(false, true); }) + }); + + case "for": + next(); + return for_(); + + case "class": + next(); + if (is_for_body) { + croak("classes are not allowed as the body of a loop"); + } + if (is_if_body) { + croak("classes are not allowed as the body of an if"); + } + return class_(AST_DefClass); + + case "function": + next(); + if (is_for_body) { + croak("functions are not allowed as the body of a loop"); + } + return function_(AST_Defun, false, false, is_export_default); + + case "if": + next(); + return if_(); + + case "return": + if (S.in_function == 0 && !options.bare_returns) + croak("'return' outside of function"); + next(); + var value = null; + if (is("punc", ";")) { + next(); + } else if (!can_insert_semicolon()) { + value = expression(true); + semicolon(); + } + return new AST_Return({ + value: value + }); + + case "switch": + next(); + return new AST_Switch({ + expression : parenthesised(), + body : in_loop(switch_body_) + }); + + case "throw": + next(); + if (has_newline_before(S.token)) + croak("Illegal newline after 'throw'"); + var value = expression(true); + semicolon(); + return new AST_Throw({ + value: value + }); + + case "try": + next(); + return try_(); + + case "var": + next(); + var node = var_(); + semicolon(); + return node; + + case "let": + next(); + var node = let_(); + semicolon(); + return node; + + case "const": + next(); + var node = const_(); + semicolon(); + return node; + + case "with": + if (S.input.has_directive("use strict")) { + croak("Strict mode may not include a with statement"); + } + next(); + return new AST_With({ + expression : parenthesised(), + body : statement() + }); + + case "export": + if (!is_token(peek(), "punc", "(")) { + next(); + var node = export_(); + if (is("punc", ";")) semicolon(); + return node; + } + } + } + unexpected(); + }); + + function labeled_statement() { + var label = as_symbol(AST_Label); + if (label.name === "await" && is_in_async()) { + token_error(S.prev, "await cannot be used as label inside async function"); + } + if (find_if(function(l) { return l.name == label.name; }, S.labels)) { + // ECMA-262, 12.12: An ECMAScript program is considered + // syntactically incorrect if it contains a + // LabelledStatement that is enclosed by a + // LabelledStatement with the same Identifier as label. + croak("Label " + label.name + " defined twice"); + } + expect(":"); + S.labels.push(label); + var stat = statement(); + S.labels.pop(); + if (!(stat instanceof AST_IterationStatement)) { + // check for `continue` that refers to this label. + // those should be reported as syntax errors. + // https://github.com/mishoo/UglifyJS2/issues/287 + label.references.forEach(function(ref) { + if (ref instanceof AST_Continue) { + ref = ref.label.start; + croak("Continue label `" + label.name + "` refers to non-IterationStatement.", + ref.line, ref.col, ref.pos); + } + }); + } + return new AST_LabeledStatement({ body: stat, label: label }); + } + + function simple_statement(tmp) { + return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); + } + + function break_cont(type) { + var label = null, ldef; + if (!can_insert_semicolon()) { + label = as_symbol(AST_LabelRef, true); + } + if (label != null) { + ldef = find_if(function(l) { return l.name == label.name; }, S.labels); + if (!ldef) + croak("Undefined label " + label.name); + label.thedef = ldef; + } else if (S.in_loop == 0) + croak(type.TYPE + " not inside a loop or switch"); + semicolon(); + var stat = new type({ label: label }); + if (ldef) ldef.references.push(stat); + return stat; + } + + function for_() { + var for_await_error = "`for await` invalid in this context"; + var await_tok = S.token; + if (await_tok.type == "name" && await_tok.value == "await") { + if (!is_in_async()) { + token_error(await_tok, for_await_error); + } + next(); + } else { + await_tok = false; + } + expect("("); + var init = null; + if (!is("punc", ";")) { + init = + is("keyword", "var") ? (next(), var_(true)) : + is("keyword", "let") ? (next(), let_(true)) : + is("keyword", "const") ? (next(), const_(true)) : + expression(true, true); + var is_in = is("operator", "in"); + var is_of = is("name", "of"); + if (await_tok && !is_of) { + token_error(await_tok, for_await_error); + } + if (is_in || is_of) { + if (init instanceof AST_Definitions) { + if (init.definitions.length > 1) + token_error(init.start, "Only one variable declaration allowed in for..in loop"); + } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) { + token_error(init.start, "Invalid left-hand side in for..in loop"); + } + next(); + if (is_in) { + return for_in(init); + } else { + return for_of(init, !!await_tok); + } + } + } else if (await_tok) { + token_error(await_tok, for_await_error); + } + return regular_for(init); + } + + function regular_for(init) { + expect(";"); + var test = is("punc", ";") ? null : expression(true); + expect(";"); + var step = is("punc", ")") ? null : expression(true); + expect(")"); + return new AST_For({ + init : init, + condition : test, + step : step, + body : in_loop(function() { return statement(false, true); }) + }); + } + + function for_of(init, is_await) { + var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null; + var obj = expression(true); + expect(")"); + return new AST_ForOf({ + await : is_await, + init : init, + name : lhs, + object : obj, + body : in_loop(function() { return statement(false, true); }) + }); + } + + function for_in(init) { + var obj = expression(true); + expect(")"); + return new AST_ForIn({ + init : init, + object : obj, + body : in_loop(function() { return statement(false, true); }) + }); + } + + var arrow_function = function(start, argnames, is_async) { + if (has_newline_before(S.token)) { + croak("Unexpected newline before arrow (=>)"); + } + + expect_token("arrow", "=>"); + + var body = _function_body(is("punc", "{"), false, is_async); + + var end = + body instanceof Array && body.length ? body[body.length - 1].end : + body instanceof Array ? start : + body.end; + + return new AST_Arrow({ + start : start, + end : end, + async : is_async, + argnames : argnames, + body : body + }); + }; + + var function_ = function(ctor, is_generator_property, is_async, is_export_default) { + var start = S.token; + + var in_statement = ctor === AST_Defun; + var is_generator = is("operator", "*"); + if (is_generator) { + next(); + } + + var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null; + if (in_statement && !name) { + if (is_export_default) { + ctor = AST_Function; + } else { + unexpected(); + } + } + + if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration)) + unexpected(prev()); + + var args = []; + var body = _function_body(true, is_generator || is_generator_property, is_async, name, args); + return new ctor({ + start : args.start, + end : body.end, + is_generator: is_generator, + async : is_async, + name : name, + argnames: args, + body : body + }); + }; + + function track_used_binding_identifiers(is_parameter, strict) { + var parameters = {}; + var duplicate = false; + var default_assignment = false; + var spread = false; + var strict_mode = !!strict; + var tracker = { + add_parameter: function(token) { + if (parameters["$" + token.value] !== undefined) { + if (duplicate === false) { + duplicate = token; + } + tracker.check_strict(); + } else { + parameters["$" + token.value] = true; + if (is_parameter) { + switch (token.value) { + case "arguments": + case "eval": + case "yield": + if (strict_mode) { + token_error(token, "Unexpected " + token.value + " identifier as parameter inside strict mode"); + } + break; + default: + if (RESERVED_WORDS(token.value)) { + unexpected(); + } + } + } + } + }, + mark_default_assignment: function(token) { + if (default_assignment === false) { + default_assignment = token; + } + }, + mark_spread: function(token) { + if (spread === false) { + spread = token; + } + }, + mark_strict_mode: function() { + strict_mode = true; + }, + is_strict: function() { + return default_assignment !== false || spread !== false || strict_mode; + }, + check_strict: function() { + if (tracker.is_strict() && duplicate !== false) { + token_error(duplicate, "Parameter " + duplicate.value + " was used already"); + } + } + }; + + return tracker; + } + + function parameters(params) { + var start = S.token; + var used_parameters = track_used_binding_identifiers(true, S.input.has_directive("use strict")); + + expect("("); + + while (!is("punc", ")")) { + var param = parameter(used_parameters); + params.push(param); + + if (!is("punc", ")")) { + expect(","); + if (is("punc", ")") && options.ecma < 8) unexpected(); + } + + if (param instanceof AST_Expansion) { + break; + } + } + + next(); + } + + function parameter(used_parameters, symbol_type) { + var param; + var expand = false; + if (used_parameters === undefined) { + used_parameters = track_used_binding_identifiers(true, S.input.has_directive("use strict")); + } + if (is("expand", "...")) { + expand = S.token; + used_parameters.mark_spread(S.token); + next(); + } + param = binding_element(used_parameters, symbol_type); + + if (is("operator", "=") && expand === false) { + used_parameters.mark_default_assignment(S.token); + next(); + param = new AST_DefaultAssign({ + start: param.start, + left: param, + operator: "=", + right: expression(false), + end: S.token + }); + } + + if (expand !== false) { + if (!is("punc", ")")) { + unexpected(); + } + param = new AST_Expansion({ + start: expand, + expression: param, + end: expand + }); + } + used_parameters.check_strict(); + + return param; + } + + function binding_element(used_parameters, symbol_type) { + var elements = []; + var first = true; + var is_expand = false; + var expand_token; + var first_token = S.token; + if (used_parameters === undefined) { + used_parameters = track_used_binding_identifiers(false, S.input.has_directive("use strict")); + } + symbol_type = symbol_type === undefined ? AST_SymbolFunarg : symbol_type; + if (is("punc", "[")) { + next(); + while (!is("punc", "]")) { + if (first) { + first = false; + } else { + expect(","); + } + + if (is("expand", "...")) { + is_expand = true; + expand_token = S.token; + used_parameters.mark_spread(S.token); + next(); + } + if (is("punc")) { + switch (S.token.value) { + case ",": + elements.push(new AST_Hole({ + start: S.token, + end: S.token + })); + continue; + case "]": // Trailing comma after last element + break; + case "[": + case "{": + elements.push(binding_element(used_parameters, symbol_type)); + break; + default: + unexpected(); + } + } else if (is("name")) { + used_parameters.add_parameter(S.token); + elements.push(as_symbol(symbol_type)); + } else { + croak("Invalid function parameter"); + } + if (is("operator", "=") && is_expand === false) { + used_parameters.mark_default_assignment(S.token); + next(); + elements[elements.length - 1] = new AST_DefaultAssign({ + start: elements[elements.length - 1].start, + left: elements[elements.length - 1], + operator: "=", + right: expression(false), + end: S.token + }); + } + if (is_expand) { + if (!is("punc", "]")) { + croak("Rest element must be last element"); + } + elements[elements.length - 1] = new AST_Expansion({ + start: expand_token, + expression: elements[elements.length - 1], + end: expand_token + }); + } + } + expect("]"); + used_parameters.check_strict(); + return new AST_Destructuring({ + start: first_token, + names: elements, + is_array: true, + end: prev() + }); + } else if (is("punc", "{")) { + next(); + while (!is("punc", "}")) { + if (first) { + first = false; + } else { + expect(","); + } + if (is("expand", "...")) { + is_expand = true; + expand_token = S.token; + used_parameters.mark_spread(S.token); + next(); + } + if (is("name") && (is_token(peek(), "punc") || is_token(peek(), "operator")) && [",", "}", "="].indexOf(peek().value) !== -1) { + used_parameters.add_parameter(S.token); + var start = prev(); + var value = as_symbol(symbol_type); + if (is_expand) { + elements.push(new AST_Expansion({ + start: expand_token, + expression: value, + end: value.end, + })); + } else { + elements.push(new AST_ObjectKeyVal({ + start: start, + key: value.name, + value: value, + end: value.end, + })); + } + } else if (is("punc", "}")) { + continue; // Allow trailing hole + } else { + var property_token = S.token; + var property = as_property_name(); + if (property === null) { + unexpected(prev()); + } else if (prev().type === "name" && !is("punc", ":")) { + elements.push(new AST_ObjectKeyVal({ + start: prev(), + key: property, + value: new symbol_type({ + start: prev(), + name: property, + end: prev() + }), + end: prev() + })); + } else { + expect(":"); + elements.push(new AST_ObjectKeyVal({ + start: property_token, + quote: property_token.quote, + key: property, + value: binding_element(used_parameters, symbol_type), + end: prev() + })); + } + } + if (is_expand) { + if (!is("punc", "}")) { + croak("Rest element must be last element"); + } + } else if (is("operator", "=")) { + used_parameters.mark_default_assignment(S.token); + next(); + elements[elements.length - 1].value = new AST_DefaultAssign({ + start: elements[elements.length - 1].value.start, + left: elements[elements.length - 1].value, + operator: "=", + right: expression(false), + end: S.token + }); + } + } + expect("}"); + used_parameters.check_strict(); + return new AST_Destructuring({ + start: first_token, + names: elements, + is_array: false, + end: prev() + }); + } else if (is("name")) { + used_parameters.add_parameter(S.token); + return as_symbol(symbol_type); + } else { + croak("Invalid function parameter"); + } + } + + function params_or_seq_(allow_arrows, maybe_sequence) { + var spread_token; + var invalid_sequence; + var trailing_comma; + var a = []; + expect("("); + while (!is("punc", ")")) { + if (spread_token) unexpected(spread_token); + if (is("expand", "...")) { + spread_token = S.token; + if (maybe_sequence) invalid_sequence = S.token; + next(); + a.push(new AST_Expansion({ + start: prev(), + expression: expression(), + end: S.token, + })); + } else { + a.push(expression()); + } + if (!is("punc", ")")) { + expect(","); + if (is("punc", ")")) { + if (options.ecma < 8) unexpected(); + trailing_comma = prev(); + if (maybe_sequence) invalid_sequence = trailing_comma; + } + } + } + expect(")"); + if (allow_arrows && is("arrow", "=>")) { + if (spread_token && trailing_comma) unexpected(trailing_comma); + } else if (invalid_sequence) { + unexpected(invalid_sequence); + } + return a; + } + + function _function_body(block, generator, is_async, name, args) { + var loop = S.in_loop; + var labels = S.labels; + var current_generator = S.in_generator; + var current_async = S.in_async; + ++S.in_function; + if (generator) + S.in_generator = S.in_function; + if (is_async) + S.in_async = S.in_function; + if (args) parameters(args); + if (block) + S.in_directives = true; + S.in_loop = 0; + S.labels = []; + if (block) { + S.input.push_directives_stack(); + var a = block_(); + if (name) _verify_symbol(name); + if (args) args.forEach(_verify_symbol); + S.input.pop_directives_stack(); + } else { + var a = expression(false); + } + --S.in_function; + S.in_loop = loop; + S.labels = labels; + S.in_generator = current_generator; + S.in_async = current_async; + return a; + } + + function _await_expression() { + // Previous token must be "await" and not be interpreted as an identifier + if (!is_in_async()) { + croak("Unexpected await expression outside async function", + S.prev.line, S.prev.col, S.prev.pos); + } + // the await expression is parsed as a unary expression in Babel + return new AST_Await({ + start: prev(), + end: S.token, + expression : maybe_unary(true), + }); + } + + function _yield_expression() { + // Previous token must be keyword yield and not be interpret as an identifier + if (!is_in_generator()) { + croak("Unexpected yield expression outside generator function", + S.prev.line, S.prev.col, S.prev.pos); + } + var start = S.token; + var star = false; + var has_expression = true; + + // Attempt to get expression or star (and then the mandatory expression) + // behind yield on the same line. + // + // If nothing follows on the same line of the yieldExpression, + // it should default to the value `undefined` for yield to return. + // In that case, the `undefined` stored as `null` in ast. + // + // Note 1: It isn't allowed for yield* to close without an expression + // Note 2: If there is a nlb between yield and star, it is interpret as + // yield * + if (can_insert_semicolon() || + (is("punc") && PUNC_AFTER_EXPRESSION(S.token.value))) { + has_expression = false; + + } else if (is("operator", "*")) { + star = true; + next(); + } + + return new AST_Yield({ + start : start, + is_star : star, + expression : has_expression ? expression() : null, + end : prev() + }); + } + + function if_() { + var cond = parenthesised(), body = statement(false, false, true), belse = null; + if (is("keyword", "else")) { + next(); + belse = statement(false, false, true); + } + return new AST_If({ + condition : cond, + body : body, + alternative : belse + }); + } + + function block_() { + expect("{"); + var a = []; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + a.push(statement()); + } + next(); + return a; + } + + function switch_body_() { + expect("{"); + var a = [], cur = null, branch = null, tmp; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + if (is("keyword", "case")) { + if (branch) branch.end = prev(); + cur = []; + branch = new AST_Case({ + start : (tmp = S.token, next(), tmp), + expression : expression(true), + body : cur + }); + a.push(branch); + expect(":"); + } else if (is("keyword", "default")) { + if (branch) branch.end = prev(); + cur = []; + branch = new AST_Default({ + start : (tmp = S.token, next(), expect(":"), tmp), + body : cur + }); + a.push(branch); + } else { + if (!cur) unexpected(); + cur.push(statement()); + } + } + if (branch) branch.end = prev(); + next(); + return a; + } + + function try_() { + var body = block_(), bcatch = null, bfinally = null; + if (is("keyword", "catch")) { + var start = S.token; + next(); + if (is("punc", "{")) { + var name = null; + } else { + expect("("); + var name = parameter(undefined, AST_SymbolCatch); + expect(")"); + } + bcatch = new AST_Catch({ + start : start, + argname : name, + body : block_(), + end : prev() + }); + } + if (is("keyword", "finally")) { + var start = S.token; + next(); + bfinally = new AST_Finally({ + start : start, + body : block_(), + end : prev() + }); + } + if (!bcatch && !bfinally) + croak("Missing catch/finally blocks"); + return new AST_Try({ + body : body, + bcatch : bcatch, + bfinally : bfinally + }); + } + + function vardefs(no_in, kind) { + var a = []; + var def; + for (;;) { + var sym_type = + kind === "var" ? AST_SymbolVar : + kind === "const" ? AST_SymbolConst : + kind === "let" ? AST_SymbolLet : null; + if (is("punc", "{") || is("punc", "[")) { + def = new AST_VarDef({ + start: S.token, + name: binding_element(undefined ,sym_type), + value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null, + end: prev() + }); + } else { + def = new AST_VarDef({ + start : S.token, + name : as_symbol(sym_type), + value : is("operator", "=") + ? (next(), expression(false, no_in)) + : !no_in && kind === "const" + ? croak("Missing initializer in const declaration") : null, + end : prev() + }); + if (def.name.name == "import") croak("Unexpected token: import"); + } + a.push(def); + if (!is("punc", ",")) + break; + next(); + } + return a; + } + + var var_ = function(no_in) { + return new AST_Var({ + start : prev(), + definitions : vardefs(no_in, "var"), + end : prev() + }); + }; + + var let_ = function(no_in) { + return new AST_Let({ + start : prev(), + definitions : vardefs(no_in, "let"), + end : prev() + }); + }; + + var const_ = function(no_in) { + return new AST_Const({ + start : prev(), + definitions : vardefs(no_in, "const"), + end : prev() + }); + }; + + var new_ = function(allow_calls) { + var start = S.token; + expect_token("operator", "new"); + if (is("punc", ".")) { + next(); + expect_token("name", "target"); + return subscripts(new AST_NewTarget({ + start : start, + end : prev() + }), allow_calls); + } + var newexp = expr_atom(false), args; + if (is("punc", "(")) { + next(); + args = expr_list(")", options.ecma >= 8); + } else { + args = []; + } + var call = new AST_New({ + start : start, + expression : newexp, + args : args, + end : prev() + }); + mark_pure(call); + return subscripts(call, allow_calls); + }; + + function as_atom_node() { + var tok = S.token, ret; + switch (tok.type) { + case "name": + ret = _make_symbol(AST_SymbolRef); + break; + case "num": + ret = new AST_Number({ start: tok, end: tok, value: tok.value }); + break; + case "string": + ret = new AST_String({ + start : tok, + end : tok, + value : tok.value, + quote : tok.quote + }); + break; + case "regexp": + ret = new AST_RegExp({ start: tok, end: tok, value: tok.value }); + break; + case "atom": + switch (tok.value) { + case "false": + ret = new AST_False({ start: tok, end: tok }); + break; + case "true": + ret = new AST_True({ start: tok, end: tok }); + break; + case "null": + ret = new AST_Null({ start: tok, end: tok }); + break; + } + break; + } + next(); + return ret; + } + + function to_fun_args(ex, _, __, default_seen_above) { + var insert_default = function(ex, default_value) { + if (default_value) { + return new AST_DefaultAssign({ + start: ex.start, + left: ex, + operator: "=", + right: default_value, + end: default_value.end + }); + } + return ex; + }; + if (ex instanceof AST_Object) { + return insert_default(new AST_Destructuring({ + start: ex.start, + end: ex.end, + is_array: false, + names: ex.properties.map(to_fun_args) + }), default_seen_above); + } else if (ex instanceof AST_ObjectKeyVal) { + ex.value = to_fun_args(ex.value, 0, [ex.key]); + return insert_default(ex, default_seen_above); + } else if (ex instanceof AST_Hole) { + return ex; + } else if (ex instanceof AST_Destructuring) { + ex.names = ex.names.map(to_fun_args); + return insert_default(ex, default_seen_above); + } else if (ex instanceof AST_SymbolRef) { + return insert_default(new AST_SymbolFunarg({ + name: ex.name, + start: ex.start, + end: ex.end + }), default_seen_above); + } else if (ex instanceof AST_Expansion) { + ex.expression = to_fun_args(ex.expression); + return insert_default(ex, default_seen_above); + } else if (ex instanceof AST_Array) { + return insert_default(new AST_Destructuring({ + start: ex.start, + end: ex.end, + is_array: true, + names: ex.elements.map(to_fun_args) + }), default_seen_above); + } else if (ex instanceof AST_Assign) { + return insert_default(to_fun_args(ex.left, undefined, undefined, ex.right), default_seen_above); + } else if (ex instanceof AST_DefaultAssign) { + ex.left = to_fun_args(ex.left, 0, [ex.left]); + return ex; + } else { + croak("Invalid function parameter", ex.start.line, ex.start.col); + } + } + + var expr_atom = function(allow_calls, allow_arrows) { + if (is("operator", "new")) { + return new_(allow_calls); + } + var start = S.token; + var peeked; + var async = is("name", "async") + && (peeked = peek()).value != "[" + && peeked.type != "arrow" + && as_atom_node(); + if (is("punc")) { + switch (S.token.value) { + case "(": + if (async && !allow_calls) break; + var exprs = params_or_seq_(allow_arrows, !async); + if (allow_arrows && is("arrow", "=>")) { + return arrow_function(start, exprs.map(to_fun_args), !!async); + } + var ex = async ? new AST_Call({ + expression: async, + args: exprs + }) : exprs.length == 1 ? exprs[0] : new AST_Sequence({ + expressions: exprs + }); + if (ex.start) { + var len = start.comments_before.length; + [].unshift.apply(ex.start.comments_before, start.comments_before); + start.comments_before = ex.start.comments_before; + start.comments_before_length = len; + if (len == 0 && start.comments_before.length > 0) { + var comment = start.comments_before[0]; + if (!comment.nlb) { + comment.nlb = start.nlb; + start.nlb = false; + } + } + start.comments_after = ex.start.comments_after; + } + ex.start = start; + var end = prev(); + if (ex.end) { + end.comments_before = ex.end.comments_before; + [].push.apply(ex.end.comments_after, end.comments_after); + end.comments_after = ex.end.comments_after; + } + ex.end = end; + if (ex instanceof AST_Call) mark_pure(ex); + return subscripts(ex, allow_calls); + case "[": + return subscripts(array_(), allow_calls); + case "{": + return subscripts(object_or_destructuring_(), allow_calls); + } + if (!async) unexpected(); + } + if (allow_arrows && is("name") && is_token(peek(), "arrow")) { + var param = new AST_SymbolFunarg({ + name: S.token.value, + start: start, + end: start, + }); + next(); + return arrow_function(start, [param], !!async); + } + if (is("keyword", "function")) { + next(); + var func = function_(AST_Function, false, !!async); + func.start = start; + func.end = prev(); + return subscripts(func, allow_calls); + } + if (async) return subscripts(async, allow_calls); + if (is("keyword", "class")) { + next(); + var cls = class_(AST_ClassExpression); + cls.start = start; + cls.end = prev(); + return subscripts(cls, allow_calls); + } + if (is("template_head")) { + return subscripts(template_string(false), allow_calls); + } + if (ATOMIC_START_TOKEN(S.token.type)) { + return subscripts(as_atom_node(), allow_calls); + } + unexpected(); + }; + + function template_string(tagged) { + var segments = [], start = S.token; + + segments.push(new AST_TemplateSegment({ + start: S.token, + raw: S.token.raw, + value: S.token.value, + end: S.token + })); + while (S.token.end === false) { + next(); + handle_regexp(); + segments.push(expression(true)); + + if (!is_token("template_substitution")) { + unexpected(); + } + + segments.push(new AST_TemplateSegment({ + start: S.token, + raw: S.token.raw, + value: S.token.value, + end: S.token + })); + } + next(); + + return new AST_TemplateString({ + start: start, + segments: segments, + end: S.token + }); + } + + function expr_list(closing, allow_trailing_comma, allow_empty) { + var first = true, a = []; + while (!is("punc", closing)) { + if (first) first = false; else expect(","); + if (allow_trailing_comma && is("punc", closing)) break; + if (is("punc", ",") && allow_empty) { + a.push(new AST_Hole({ start: S.token, end: S.token })); + } else if (is("expand", "...")) { + next(); + a.push(new AST_Expansion({start: prev(), expression: expression(),end: S.token})); + } else { + a.push(expression(false)); + } + } + next(); + return a; + } + + var array_ = embed_tokens(function() { + expect("["); + return new AST_Array({ + elements: expr_list("]", !options.strict, true) + }); + }); + + var create_accessor = embed_tokens(function(is_generator, is_async) { + return function_(AST_Accessor, is_generator, is_async); + }); + + var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() { + var start = S.token, first = true, a = []; + expect("{"); + while (!is("punc", "}")) { + if (first) first = false; else expect(","); + if (!options.strict && is("punc", "}")) + // allow trailing comma + break; + + start = S.token; + if (start.type == "expand") { + next(); + a.push(new AST_Expansion({ + start: start, + expression: expression(false), + end: prev(), + })); + continue; + } + + var name = as_property_name(); + var value; + + // Check property and fetch value + if (!is("punc", ":")) { + var concise = concise_method_or_getset(name, start); + if (concise) { + a.push(concise); + continue; + } + + value = new AST_SymbolRef({ + start: prev(), + name: name, + end: prev() + }); + } else if (name === null) { + unexpected(prev()); + } else { + next(); // `:` - see first condition + value = expression(false); + } + + // Check for default value and alter value accordingly if necessary + if (is("operator", "=")) { + next(); + value = new AST_Assign({ + start: start, + left: value, + operator: "=", + right: expression(false), + end: prev() + }); + } + + // Create property + a.push(new AST_ObjectKeyVal({ + start: start, + quote: start.quote, + key: name instanceof AST_Node ? name : "" + name, + value: value, + end: prev() + })); + } + next(); + return new AST_Object({ properties: a }); + }); + + function class_(KindOfClass) { + var start, method, class_name, extends_, a = []; + + S.input.push_directives_stack(); // Push directive stack, but not scope stack + S.input.add_directive("use strict"); + + if (S.token.type == "name" && S.token.value != "extends") { + class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass); + } + + if (KindOfClass === AST_DefClass && !class_name) { + unexpected(); + } + + if (S.token.value == "extends") { + next(); + extends_ = expression(true); + } + + expect("{"); + + if (is("punc", ";")) { next(); } // Leading semicolons are okay in class bodies. + while (!is("punc", "}")) { + start = S.token; + method = concise_method_or_getset(as_property_name(), start, true); + if (!method) { unexpected(); } + a.push(method); + if (is("punc", ";")) { next(); } + } + + S.input.pop_directives_stack(); + + next(); + + return new KindOfClass({ + start: start, + name: class_name, + extends: extends_, + properties: a, + end: prev(), + }); + } + + function concise_method_or_getset(name, start, is_class) { + var get_ast = function(name, token) { + if (typeof name === "string" || typeof name === "number") { + return new AST_SymbolMethod({ + start: token, + name: "" + name, + end: prev() + }); + } else if (name === null) { + unexpected(); + } + return name; + }; + var is_async = false; + var is_static = false; + var is_generator = false; + var property_token = start; + if (is_class && name === "static" && !is("punc", "(")) { + is_static = true; + property_token = S.token; + name = as_property_name(); + } + if (name === "async" && !is("punc", "(") && !is("punc", ",") && !is("punc", "}")) { + is_async = true; + property_token = S.token; + name = as_property_name(); + } + if (name === null) { + is_generator = true; + property_token = S.token; + name = as_property_name(); + if (name === null) { + unexpected(); + } + } + if (is("punc", "(")) { + name = get_ast(name, start); + var node = new AST_ConciseMethod({ + start : start, + static : is_static, + is_generator: is_generator, + async : is_async, + key : name, + quote : name instanceof AST_SymbolMethod ? + property_token.quote : undefined, + value : create_accessor(is_generator, is_async), + end : prev() + }); + return node; + } + property_token = S.token; + if (name == "get") { + if (!is("punc") || is("punc", "[")) { + name = get_ast(as_property_name(), start); + return new AST_ObjectGetter({ + start : start, + static: is_static, + key : name, + quote : name instanceof AST_SymbolMethod ? + property_token.quote : undefined, + value : create_accessor(), + end : prev() + }); + } + } else if (name == "set") { + if (!is("punc") || is("punc", "[")) { + name = get_ast(as_property_name(), start); + return new AST_ObjectSetter({ + start : start, + static: is_static, + key : name, + quote : name instanceof AST_SymbolMethod ? + property_token.quote : undefined, + value : create_accessor(), + end : prev() + }); + } + } + } + + function import_() { + var start = prev(); + var imported_name; + var imported_names; + if (is("name")) { + imported_name = as_symbol(AST_SymbolImport); + } + + if (is("punc", ",")) { + next(); + } + + imported_names = map_names(true); + + if (imported_names || imported_name) { + expect_token("name", "from"); + } + var mod_str = S.token; + if (mod_str.type !== "string") { + unexpected(); + } + next(); + return new AST_Import({ + start: start, + imported_name: imported_name, + imported_names: imported_names, + module_name: new AST_String({ + start: mod_str, + value: mod_str.value, + quote: mod_str.quote, + end: mod_str, + }), + end: S.token, + }); + } + + function map_name(is_import) { + function make_symbol(type) { + return new type({ + name: as_property_name(), + start: prev(), + end: prev() + }); + } + + var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; + var type = is_import ? AST_SymbolImport : AST_SymbolExport; + var start = S.token; + var foreign_name; + var name; + + if (is_import) { + foreign_name = make_symbol(foreign_type); + } else { + name = make_symbol(type); + } + if (is("name", "as")) { + next(); // The "as" word + if (is_import) { + name = make_symbol(type); + } else { + foreign_name = make_symbol(foreign_type); + } + } else if (is_import) { + name = new type(foreign_name); + } else { + foreign_name = new foreign_type(name); + } + + return new AST_NameMapping({ + start: start, + foreign_name: foreign_name, + name: name, + end: prev(), + }); + } + + function map_nameAsterisk(is_import, name) { + var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; + var type = is_import ? AST_SymbolImport : AST_SymbolExport; + var start = S.token; + var foreign_name; + var end = prev(); + + name = name || new type({ + name: "*", + start: start, + end: end, + }); + + foreign_name = new foreign_type({ + name: "*", + start: start, + end: end, + }); + + return new AST_NameMapping({ + start: start, + foreign_name: foreign_name, + name: name, + end: end, + }); + } + + function map_names(is_import) { + var names; + if (is("punc", "{")) { + next(); + names = []; + while (!is("punc", "}")) { + names.push(map_name(is_import)); + if (is("punc", ",")) { + next(); + } + } + next(); + } else if (is("operator", "*")) { + var name; + next(); + if (is_import && is("name", "as")) { + next(); // The "as" word + name = as_symbol(is_import ? AST_SymbolImport : AST_SymbolExportForeign); + } + names = [map_nameAsterisk(is_import, name)]; + } + return names; + } + + function export_() { + var start = S.token; + var is_default; + var exported_names; + + if (is("keyword", "default")) { + is_default = true; + next(); + } else if (exported_names = map_names(false)) { + if (is("name", "from")) { + next(); + + var mod_str = S.token; + if (mod_str.type !== "string") { + unexpected(); + } + next(); + + return new AST_Export({ + start: start, + is_default: is_default, + exported_names: exported_names, + module_name: new AST_String({ + start: mod_str, + value: mod_str.value, + quote: mod_str.quote, + end: mod_str, + }), + end: prev(), + }); + } else { + return new AST_Export({ + start: start, + is_default: is_default, + exported_names: exported_names, + end: prev(), + }); + } + } + + var node; + var exported_value; + var exported_definition; + if (is("punc", "{") + || is_default + && (is("keyword", "class") || is("keyword", "function")) + && is_token(peek(), "punc")) { + exported_value = expression(false); + semicolon(); + } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) { + unexpected(node.start); + } else if (node instanceof AST_Definitions || node instanceof AST_Lambda || node instanceof AST_DefClass) { + exported_definition = node; + } else if (node instanceof AST_SimpleStatement) { + exported_value = node.body; + } else { + unexpected(node.start); + } + + return new AST_Export({ + start: start, + is_default: is_default, + exported_value: exported_value, + exported_definition: exported_definition, + end: prev(), + }); + } + + function as_property_name() { + var tmp = S.token; + switch (tmp.type) { + case "punc": + if (tmp.value === "[") { + next(); + var ex = expression(false); + expect("]"); + return ex; + } else unexpected(tmp); + case "operator": + if (tmp.value === "*") { + next(); + return null; + } + if (["delete", "in", "instanceof", "new", "typeof", "void"].indexOf(tmp.value) === -1) { + unexpected(tmp); + } + case "name": + if (tmp.value == "yield") { + if (is_in_generator()) { + token_error(tmp, "Yield cannot be used as identifier inside generators"); + } else if (!is_token(peek(), "punc", ":") + && !is_token(peek(), "punc", "(") + && S.input.has_directive("use strict")) { + token_error(tmp, "Unexpected yield identifier inside strict mode"); + } + } + case "string": + case "num": + case "keyword": + case "atom": + next(); + return tmp.value; + default: + unexpected(tmp); + } + } + + function as_name() { + var tmp = S.token; + if (tmp.type != "name") unexpected(); + next(); + return tmp.value; + } + + function _make_symbol(type) { + var name = S.token.value; + return new (name == "this" ? AST_This : + name == "super" ? AST_Super : + type)({ + name : String(name), + start : S.token, + end : S.token + }); + } + + function _verify_symbol(sym) { + var name = sym.name; + if (is_in_generator() && name == "yield") { + token_error(sym.start, "Yield cannot be used as identifier inside generators"); + } + if (S.input.has_directive("use strict")) { + if (name == "yield") { + token_error(sym.start, "Unexpected yield identifier inside strict mode"); + } + if (sym instanceof AST_SymbolDeclaration && (name == "arguments" || name == "eval")) { + token_error(sym.start, "Unexpected " + name + " in strict mode"); + } + } + } + + function as_symbol(type, noerror) { + if (!is("name")) { + if (!noerror) croak("Name expected"); + return null; + } + var sym = _make_symbol(type); + _verify_symbol(sym); + next(); + return sym; + } + + function mark_pure(call) { + var start = call.start; + var comments = start.comments_before; + var i = HOP(start, "comments_before_length") ? start.comments_before_length : comments.length; + while (--i >= 0) { + var comment = comments[i]; + if (/[@#]__PURE__/.test(comment.value)) { + call.pure = comment; + break; + } + } + } + + var subscripts = function(expr, allow_calls) { + var start = expr.start; + if (is("punc", ".")) { + next(); + return subscripts(new AST_Dot({ + start : start, + expression : expr, + property : as_name(), + end : prev() + }), allow_calls); + } + if (is("punc", "[")) { + next(); + var prop = expression(true); + expect("]"); + return subscripts(new AST_Sub({ + start : start, + expression : expr, + property : prop, + end : prev() + }), allow_calls); + } + if (allow_calls && is("punc", "(")) { + next(); + var call = new AST_Call({ + start : start, + expression : expr, + args : call_args(), + end : prev() + }); + mark_pure(call); + return subscripts(call, true); + } + if (is("template_head")) { + return subscripts(new AST_PrefixedTemplateString({ + start: start, + prefix: expr, + template_string: template_string(true), + end: prev() + }), allow_calls); + } + return expr; + }; + + var call_args = embed_tokens(function _call_args() { + var args = []; + while (!is("punc", ")")) { + if (is("expand", "...")) { + next(); + args.push(new AST_Expansion({ + start: prev(), + expression: expression(false), + end: prev() + })); + } else { + args.push(expression(false)); + } + if (!is("punc", ")")) { + expect(","); + if (is("punc", ")") && options.ecma < 8) unexpected(); + } + } + next(); + return args; + }); + + var maybe_unary = function(allow_calls, allow_arrows) { + var start = S.token; + if (start.type == "name" && start.value == "await") { + if (is_in_async()) { + next(); + return _await_expression(); + } else if (S.input.has_directive("use strict")) { + token_error(S.token, "Unexpected await identifier inside strict mode"); + } + } + if (is("operator") && UNARY_PREFIX(start.value)) { + next(); + handle_regexp(); + var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls)); + ex.start = start; + ex.end = prev(); + return ex; + } + var val = expr_atom(allow_calls, allow_arrows); + while (is("operator") && UNARY_POSTFIX(S.token.value) && !has_newline_before(S.token)) { + if (val instanceof AST_Arrow) unexpected(); + val = make_unary(AST_UnaryPostfix, S.token, val); + val.start = start; + val.end = S.token; + next(); + } + return val; + }; + + function make_unary(ctor, token, expr) { + var op = token.value; + switch (op) { + case "++": + case "--": + if (!is_assignable(expr)) + croak("Invalid use of " + op + " operator", token.line, token.col, token.pos); + break; + case "delete": + if (expr instanceof AST_SymbolRef && S.input.has_directive("use strict")) + croak("Calling delete on expression not allowed in strict mode", expr.start.line, expr.start.col, expr.start.pos); + break; + } + return new ctor({ operator: op, expression: expr }); + } + + var expr_op = function(left, min_prec, no_in) { + var op = is("operator") ? S.token.value : null; + if (op == "in" && no_in) op = null; + if (op == "**" && left instanceof AST_UnaryPrefix + /* unary token in front not allowed - parenthesis required */ + && !is_token(left.start, "punc", "(") + && left.operator !== "--" && left.operator !== "++") + unexpected(left.start); + var prec = op != null ? PRECEDENCE[op] : null; + if (prec != null && (prec > min_prec || (op === "**" && min_prec === prec))) { + next(); + var right = expr_op(maybe_unary(true), prec, no_in); + return expr_op(new AST_Binary({ + start : left.start, + left : left, + operator : op, + right : right, + end : right.end + }), min_prec, no_in); + } + return left; + }; + + function expr_ops(no_in) { + return expr_op(maybe_unary(true, true), 0, no_in); + } + + var maybe_conditional = function(no_in) { + var start = S.token; + var expr = expr_ops(no_in); + if (is("operator", "?")) { + next(); + var yes = expression(false); + expect(":"); + return new AST_Conditional({ + start : start, + condition : expr, + consequent : yes, + alternative : expression(false, no_in), + end : prev() + }); + } + return expr; + }; + + function is_assignable(expr) { + return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef; + } + + function to_destructuring(node) { + if (node instanceof AST_Object) { + node = new AST_Destructuring({ + start: node.start, + names: node.properties.map(to_destructuring), + is_array: false, + end: node.end + }); + } else if (node instanceof AST_Array) { + var names = []; + + for (var i = 0; i < node.elements.length; i++) { + // Only allow expansion as last element + if (node.elements[i] instanceof AST_Expansion) { + if (i + 1 !== node.elements.length) { + token_error(node.elements[i].start, "Spread must the be last element in destructuring array"); + } + node.elements[i].expression = to_destructuring(node.elements[i].expression); + } + + names.push(to_destructuring(node.elements[i])); + } + + node = new AST_Destructuring({ + start: node.start, + names: names, + is_array: true, + end: node.end + }); + } else if (node instanceof AST_ObjectProperty) { + node.value = to_destructuring(node.value); + } else if (node instanceof AST_Assign) { + node = new AST_DefaultAssign({ + start: node.start, + left: node.left, + operator: "=", + right: node.right, + end: node.end + }); + } + return node; + } + + // In ES6, AssignmentExpression can also be an ArrowFunction + var maybe_assign = function(no_in) { + handle_regexp(); + var start = S.token; + + if (start.type == "name" && start.value == "yield") { + if (is_in_generator()) { + next(); + return _yield_expression(); + } else if (S.input.has_directive("use strict")) { + token_error(S.token, "Unexpected yield identifier inside strict mode"); + } + } + + var left = maybe_conditional(no_in); + var val = S.token.value; + + if (is("operator") && ASSIGNMENT(val)) { + if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { + next(); + return new AST_Assign({ + start : start, + left : left, + operator : val, + right : maybe_assign(no_in), + end : prev() + }); + } + croak("Invalid assignment"); + } + return left; + }; + + var expression = function(commas, no_in) { + var start = S.token; + var exprs = []; + while (true) { + exprs.push(maybe_assign(no_in)); + if (!commas || !is("punc", ",")) break; + next(); + commas = true; + } + return exprs.length == 1 ? exprs[0] : new AST_Sequence({ + start : start, + expressions : exprs, + end : peek() + }); + }; + + function in_loop(cont) { + ++S.in_loop; + var ret = cont(); + --S.in_loop; + return ret; + } + + if (options.expression) { + return expression(true); + } + + return (function() { + var start = S.token; + var body = []; + S.input.push_directives_stack(); + if (options.module) S.input.add_directive("use strict"); + while (!is("eof")) + body.push(statement()); + S.input.pop_directives_stack(); + var end = prev(); + var toplevel = options.toplevel; + if (toplevel) { + toplevel.body = toplevel.body.concat(body); + toplevel.end = end; + } else { + toplevel = new AST_Toplevel({ start: start, body: body, end: end }); + } + return toplevel; + })(); + +} diff --git a/tools/node_modules/terser/lib/propmangle.js b/tools/node_modules/terser/lib/propmangle.js new file mode 100644 index 000000000000..f0c749fedcc6 --- /dev/null +++ b/tools/node_modules/terser/lib/propmangle.js @@ -0,0 +1,271 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function find_builtins(reserved) { + reserved.push.apply(reserved, domprops); + + // Compatibility fix for some standard defined globals not defined on every js environment + var new_globals = ["Symbol", "Map", "Promise", "Proxy", "Reflect", "Set", "WeakMap", "WeakSet"]; + var objects = {}; + var global_ref = typeof global === "object" ? global : self; + + new_globals.forEach(function (new_global) { + objects[new_global] = global_ref[new_global] || new Function(); + }); + + // NaN will be included due to Number.NaN + [ + "null", + "true", + "false", + "Infinity", + "-Infinity", + "undefined", + ].forEach(add); + [ Object, Array, Function, Number, + String, Boolean, Error, Math, + Date, RegExp, objects.Symbol, ArrayBuffer, + DataView, decodeURI, decodeURIComponent, + encodeURI, encodeURIComponent, eval, EvalError, + Float32Array, Float64Array, Int8Array, Int16Array, + Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat, + parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError, + objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array, + Uint8ClampedArray, Uint16Array, Uint32Array, URIError, + objects.WeakMap, objects.WeakSet + ].forEach(function(ctor) { + Object.getOwnPropertyNames(ctor).map(add); + if (ctor.prototype) { + Object.getOwnPropertyNames(ctor.prototype).map(add); + } + }); + function add(name) { + push_uniq(reserved, name); + } +} + +function reserve_quoted_keys(ast, reserved) { + function add(name) { + push_uniq(reserved, name); + } + + ast.walk(new TreeWalker(function(node) { + if (node instanceof AST_ObjectKeyVal && node.quote) { + add(node.key); + } else if (node instanceof AST_ObjectProperty && node.quote) { + add(node.key.name); + } else if (node instanceof AST_Sub) { + addStrings(node.property, add); + } + })); +} + +function addStrings(node, add) { + node.walk(new TreeWalker(function(node) { + if (node instanceof AST_Sequence) { + addStrings(node.tail_node(), add); + } else if (node instanceof AST_String) { + add(node.value); + } else if (node instanceof AST_Conditional) { + addStrings(node.consequent, add); + addStrings(node.alternative, add); + } + return true; + })); +} + +function mangle_properties(ast, options) { + options = defaults(options, { + builtins: false, + cache: null, + debug: false, + keep_quoted: false, + only_cache: false, + regex: null, + reserved: null, + }, true); + + var reserved = options.reserved; + if (!Array.isArray(reserved)) reserved = [reserved]; + if (!options.builtins) find_builtins(reserved); + + var cname = -1; + var cache; + if (options.cache) { + cache = options.cache.props; + cache.each(function(mangled_name) { + push_uniq(reserved, mangled_name); + }); + } else { + cache = new Dictionary(); + } + + var regex = options.regex; + + // note debug is either false (disabled), or a string of the debug suffix to use (enabled). + // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true' + // the same as passing an empty string. + var debug = options.debug !== false; + var debug_name_suffix; + if (debug) { + debug_name_suffix = (options.debug === true ? "" : options.debug); + } + + var names_to_mangle = []; + var unmangleable = []; + + // step 1: find candidates to mangle + ast.walk(new TreeWalker(function(node) { + if (node instanceof AST_ObjectKeyVal) { + if (typeof node.key == "string") { + add(node.key); + } + } else if (node instanceof AST_ObjectProperty) { + // setter or getter, since KeyVal is handled above + add(node.key.name); + } else if (node instanceof AST_Dot) { + var root = node; + while (root.expression) { + root = root.expression; + } + if (!(root.thedef && root.thedef.undeclared)) add(node.property); + } else if (node instanceof AST_Sub) { + addStrings(node.property, add); + } else if (node instanceof AST_Call + && node.expression.print_to_string() == "Object.defineProperty") { + addStrings(node.args[1], add); + } + })); + + // step 2: transform the tree, renaming properties + return ast.transform(new TreeTransformer(function(node) { + if (node instanceof AST_ObjectKeyVal) { + if (typeof node.key == "string") { + node.key = mangle(node.key); + } + } else if (node instanceof AST_ObjectProperty) { + // setter or getter + node.key.name = mangle(node.key.name); + } else if (node instanceof AST_Dot) { + node.property = mangle(node.property); + } else if (!options.keep_quoted && node instanceof AST_Sub) { + node.property = mangleStrings(node.property); + } else if (node instanceof AST_Call + && node.expression.print_to_string() == "Object.defineProperty") { + node.args[1] = mangleStrings(node.args[1]); + } + })); + + // only function declarations after this line + + function can_mangle(name) { + if (unmangleable.indexOf(name) >= 0) return false; + if (reserved.indexOf(name) >= 0) return false; + if (options.only_cache) { + return cache.has(name); + } + if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false; + return true; + } + + function should_mangle(name) { + if (regex && !regex.test(name)) return false; + if (reserved.indexOf(name) >= 0) return false; + return cache.has(name) + || names_to_mangle.indexOf(name) >= 0; + } + + function add(name) { + if (can_mangle(name)) + push_uniq(names_to_mangle, name); + + if (!should_mangle(name)) { + push_uniq(unmangleable, name); + } + } + + function mangle(name) { + if (!should_mangle(name)) { + return name; + } + + var mangled = cache.get(name); + if (!mangled) { + if (debug) { + // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo -> o._$foo$NNN_. + var debug_mangled = "_$" + name + "$" + debug_name_suffix + "_"; + + if (can_mangle(debug_mangled)) { + mangled = debug_mangled; + } + } + + // either debug mode is off, or it is on and we could not use the mangled name + if (!mangled) { + do { + mangled = base54(++cname); + } while (!can_mangle(mangled)); + } + + cache.set(name, mangled); + } + return mangled; + } + + function mangleStrings(node) { + return node.transform(new TreeTransformer(function(node) { + if (node instanceof AST_Sequence) { + var last = node.expressions.length - 1; + node.expressions[last] = mangleStrings(node.expressions[last]); + } else if (node instanceof AST_String) { + node.value = mangle(node.value); + } else if (node instanceof AST_Conditional) { + node.consequent = mangleStrings(node.consequent); + node.alternative = mangleStrings(node.alternative); + } + return node; + })); + } +} diff --git a/tools/node_modules/terser/lib/scope.js b/tools/node_modules/terser/lib/scope.js new file mode 100644 index 000000000000..744e65aa9e93 --- /dev/null +++ b/tools/node_modules/terser/lib/scope.js @@ -0,0 +1,723 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function SymbolDef(scope, orig, init) { + this.name = orig.name; + this.orig = [ orig ]; + this.init = init; + this.eliminated = 0; + this.scope = scope; + this.references = []; + this.replaced = 0; + this.global = false; + this.export = false; + this.mangled_name = null; + this.undeclared = false; + this.id = SymbolDef.next_id++; +} + +SymbolDef.next_id = 1; + +var MASK_EXPORT_DONT_MANGLE = 1 << 0; +var MASK_EXPORT_WANT_MANGLE = 1 << 1; + +SymbolDef.prototype = { + unmangleable: function(options) { + if (!options) options = {}; + + return this.global && !options.toplevel + || (this.export & MASK_EXPORT_DONT_MANGLE) + || this.undeclared + || !options.eval && this.scope.pinned() + || (this.orig[0] instanceof AST_SymbolLambda + || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name) + || this.orig[0] instanceof AST_SymbolMethod + || (this.orig[0] instanceof AST_SymbolClass + || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name); + }, + mangle: function(options) { + var cache = options.cache && options.cache.props; + if (this.global && cache && cache.has(this.name)) { + this.mangled_name = cache.get(this.name); + } else if (!this.mangled_name && !this.unmangleable(options)) { + var s = this.scope; + var sym = this.orig[0]; + if (options.ie8 && sym instanceof AST_SymbolLambda) + s = s.parent_scope; + var def; + if (def = this.redefined()) { + this.mangled_name = def.mangled_name || def.name; + } else + this.mangled_name = s.next_mangled(options, this); + if (this.global && cache) { + cache.set(this.name, this.mangled_name); + } + } + }, + redefined: function() { + return this.defun && this.defun.variables.get(this.name); + } +}; + +AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) { + options = defaults(options, { + cache: null, + ie8: false, + safari10: false, + }); + + // pass 1: setup scope chaining and handle definitions + var self = this; + var scope = self.parent_scope = null; + var labels = new Dictionary(); + var defun = null; + var in_destructuring = null; + var for_scopes = []; + var tw = new TreeWalker(function(node, descend) { + if (node.is_block_scope()) { + var save_scope = scope; + node.block_scope = scope = new AST_Scope(node); + scope.init_scope_vars(save_scope); + if (!(node instanceof AST_Scope)) { + scope.uses_with = save_scope.uses_with; + scope.uses_eval = save_scope.uses_eval; + scope.directives = save_scope.directives; + } + if (options.safari10) { + if (node instanceof AST_For || node instanceof AST_ForIn) { + for_scopes.push(scope); + } + } + descend(); + scope = save_scope; + return true; + } + if (node instanceof AST_Destructuring) { + in_destructuring = node; // These don't nest + descend(); + in_destructuring = null; + return true; + } + if (node instanceof AST_Scope) { + node.init_scope_vars(scope); + var save_scope = scope; + var save_defun = defun; + var save_labels = labels; + defun = scope = node; + labels = new Dictionary(); + descend(); + scope = save_scope; + defun = save_defun; + labels = save_labels; + return true; // don't descend again in TreeWalker + } + if (node instanceof AST_LabeledStatement) { + var l = node.label; + if (labels.has(l.name)) { + throw new Error(string_template("Label {name} defined twice", l)); + } + labels.set(l.name, l); + descend(); + labels.del(l.name); + return true; // no descend again + } + if (node instanceof AST_With) { + for (var s = scope; s; s = s.parent_scope) + s.uses_with = true; + return; + } + if (node instanceof AST_Symbol) { + node.scope = scope; + } + if (node instanceof AST_Label) { + node.thedef = node; + node.references = []; + } + if (node instanceof AST_SymbolLambda) { + defun.def_function(node, node.name == "arguments" ? undefined : defun); + } else if (node instanceof AST_SymbolDefun) { + // Careful here, the scope where this should be defined is + // the parent scope. The reason is that we enter a new + // scope when we encounter the AST_Defun node (which is + // instanceof AST_Scope) but we get to the symbol a bit + // later. + mark_export((node.scope = defun.parent_scope.get_defun_scope()).def_function(node, defun), 1); + } else if (node instanceof AST_SymbolClass) { + mark_export(defun.def_variable(node, defun), 1); + } else if (node instanceof AST_SymbolImport) { + scope.def_variable(node); + } else if (node instanceof AST_SymbolDefClass) { + // This deals with the name of the class being available + // inside the class. + mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1); + } else if (node instanceof AST_SymbolVar + || node instanceof AST_SymbolLet + || node instanceof AST_SymbolConst) { + var def; + if (node instanceof AST_SymbolBlockDeclaration) { + def = scope.def_variable(node, null); + } else { + def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : undefined); + } + if (!all(def.orig, function(sym) { + if (sym === node) return true; + if (node instanceof AST_SymbolBlockDeclaration) { + return sym instanceof AST_SymbolLambda; + } + return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst); + })) { + js_error( + node.name + " redeclared", + node.start.file, + node.start.line, + node.start.col, + node.start.pos + ); + } + if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2); + def.destructuring = in_destructuring; + if (defun !== scope) { + node.mark_enclosed(options); + var def = scope.find_variable(node); + if (node.thedef !== def) { + node.thedef = def; + node.reference(options); + } + } + } else if (node instanceof AST_SymbolCatch) { + scope.def_variable(node).defun = defun; + } else if (node instanceof AST_LabelRef) { + var sym = labels.get(node.name); + if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { + name: node.name, + line: node.start.line, + col: node.start.col + })); + node.thedef = sym; + } + if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) { + js_error( + node.TYPE + " statement may only appear at top level", + node.start.file, + node.start.line, + node.start.col, + node.start.pos + ); + } + + function mark_export(def, level) { + if (in_destructuring) { + var i = 0; + do { + level++; + } while (tw.parent(i++) !== in_destructuring); + } + var node = tw.parent(level); + if (def.export = node instanceof AST_Export && MASK_EXPORT_DONT_MANGLE) { + var exported = node.exported_definition; + if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) { + def.export = MASK_EXPORT_WANT_MANGLE; + } + } + } + }); + self.walk(tw); + + // pass 2: find back references and eval + self.globals = new Dictionary(); + var tw = new TreeWalker(function(node, descend) { + if (node instanceof AST_LoopControl && node.label) { + node.label.thedef.references.push(node); + return true; + } + if (node instanceof AST_SymbolRef) { + var name = node.name; + if (name == "eval" && tw.parent() instanceof AST_Call) { + for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) { + s.uses_eval = true; + } + } + var sym; + if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name + || !(sym = node.scope.find_variable(name))) { + sym = self.def_global(node); + if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE; + } else if (sym.scope instanceof AST_Lambda && name == "arguments") { + sym.scope.uses_arguments = true; + } + node.thedef = sym; + node.reference(options); + if (node.scope.is_block_scope() + && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) { + node.scope = node.scope.get_defun_scope(); + } + return true; + } + // ensure mangling works if catch reuses a scope variable + var def; + if (node instanceof AST_SymbolCatch && (def = node.definition().redefined())) { + var s = node.scope; + while (s) { + push_uniq(s.enclosed, def); + if (s === def.scope) break; + s = s.parent_scope; + } + } + }); + self.walk(tw); + + // pass 3: work around IE8 and Safari catch scope bugs + if (options.ie8 || options.safari10) { + self.walk(new TreeWalker(function(node, descend) { + if (node instanceof AST_SymbolCatch) { + var name = node.name; + var refs = node.thedef.references; + var scope = node.thedef.defun; + var def = scope.find_variable(name) || self.globals.get(name) || scope.def_variable(node); + refs.forEach(function(ref) { + ref.thedef = def; + ref.reference(options); + }); + node.thedef = def; + node.reference(options); + return true; + } + })); + } + + // pass 4: add symbol definitions to loop scopes + // Safari/Webkit bug workaround - loop init let variable shadowing argument. + // https://github.com/mishoo/UglifyJS2/issues/1753 + // https://bugs.webkit.org/show_bug.cgi?id=171041 + if (options.safari10) { + for (var i = 0; i < for_scopes.length; i++) { + var scope = for_scopes[i]; + scope.parent_scope.variables.each(function(def) { + push_uniq(scope.enclosed, def); + }); + } + } +}); + +AST_Toplevel.DEFMETHOD("def_global", function(node) { + var globals = this.globals, name = node.name; + if (globals.has(name)) { + return globals.get(name); + } else { + var g = new SymbolDef(this, node); + g.undeclared = true; + g.global = true; + globals.set(name, g); + return g; + } +}); + +AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope) { + this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) + this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope) + this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement + this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` + this.parent_scope = parent_scope; // the parent scope + this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes + this.cname = -1; // the current index for mangling functions/variables +}); + +AST_Node.DEFMETHOD("is_block_scope", return_false); +AST_Class.DEFMETHOD("is_block_scope", return_false); +AST_Lambda.DEFMETHOD("is_block_scope", return_false); +AST_Toplevel.DEFMETHOD("is_block_scope", return_false); +AST_SwitchBranch.DEFMETHOD("is_block_scope", return_false); +AST_Block.DEFMETHOD("is_block_scope", return_true); +AST_IterationStatement.DEFMETHOD("is_block_scope", return_true); + +AST_Lambda.DEFMETHOD("init_scope_vars", function() { + AST_Scope.prototype.init_scope_vars.apply(this, arguments); + this.uses_arguments = false; + this.def_variable(new AST_SymbolFunarg({ + name: "arguments", + start: this.start, + end: this.end + })); +}); + +AST_Arrow.DEFMETHOD("init_scope_vars", function() { + AST_Scope.prototype.init_scope_vars.apply(this, arguments); + this.uses_arguments = false; +}); + +AST_Symbol.DEFMETHOD("mark_enclosed", function(options) { + var def = this.definition(); + var s = this.scope; + while (s) { + push_uniq(s.enclosed, def); + if (options.keep_fnames) { + s.functions.each(function(d) { + if (keep_name(options.keep_fnames, d.name)) { + push_uniq(def.scope.enclosed, d); + } + }); + } + if (s === def.scope) break; + s = s.parent_scope; + } +}); + +AST_Symbol.DEFMETHOD("reference", function(options) { + this.definition().references.push(this); + this.mark_enclosed(options); +}); + +AST_Scope.DEFMETHOD("find_variable", function(name) { + if (name instanceof AST_Symbol) name = name.name; + return this.variables.get(name) + || (this.parent_scope && this.parent_scope.find_variable(name)); +}); + +AST_Scope.DEFMETHOD("def_function", function(symbol, init) { + var def = this.def_variable(symbol, init); + if (!def.init || def.init instanceof AST_Defun) def.init = init; + this.functions.set(symbol.name, def); + return def; +}); + +AST_Scope.DEFMETHOD("def_variable", function(symbol, init) { + var def = this.variables.get(symbol.name); + if (def) { + def.orig.push(symbol); + if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) { + def.init = init; + } + } else { + def = new SymbolDef(this, symbol, init); + this.variables.set(symbol.name, def); + def.global = !this.parent_scope; + } + return symbol.thedef = def; +}); + +function next_mangled(scope, options) { + var ext = scope.enclosed; + out: while (true) { + var m = base54(++scope.cname); + if (!is_identifier(m)) continue; // skip over "do" + + // https://github.com/mishoo/UglifyJS2/issues/242 -- do not + // shadow a name reserved from mangling. + if (member(m, options.reserved)) continue; + + // we must ensure that the mangled name does not shadow a name + // from some parent scope that is referenced in this or in + // inner scopes. + for (var i = ext.length; --i >= 0;) { + var sym = ext[i]; + var name = sym.mangled_name || (sym.unmangleable(options) && sym.name); + if (m == name) continue out; + } + return m; + } +} + +AST_Scope.DEFMETHOD("next_mangled", function(options) { + return next_mangled(this, options); +}); + +AST_Toplevel.DEFMETHOD("next_mangled", function(options) { + var name; + do { + name = next_mangled(this, options); + } while (member(name, this.mangled_names)); + return name; +}); + +AST_Function.DEFMETHOD("next_mangled", function(options, def) { + // #179, #326 + // in Safari strict mode, something like (function x(x){...}) is a syntax error; + // a function expression's argument cannot shadow the function expression's name + + var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition(); + + // the function's mangled_name is null when keep_fnames is true + var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null; + + while (true) { + var name = next_mangled(this, options); + if (!tricky_name || tricky_name != name) + return name; + } +}); + +AST_Symbol.DEFMETHOD("unmangleable", function(options) { + var def = this.definition(); + return !def || def.unmangleable(options); +}); + +// labels are always mangleable +AST_Label.DEFMETHOD("unmangleable", return_false); + +AST_Symbol.DEFMETHOD("unreferenced", function() { + return !this.definition().references.length && !this.scope.pinned(); +}); + +AST_Symbol.DEFMETHOD("definition", function() { + return this.thedef; +}); + +AST_Symbol.DEFMETHOD("global", function() { + return this.definition().global; +}); + +AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options) { + options = defaults(options, { + eval : false, + ie8 : false, + keep_classnames: false, + keep_fnames : false, + module : false, + reserved : [], + toplevel : false, + }); + if (options["module"]) { + options.toplevel = true; + } + if (!Array.isArray(options.reserved)) options.reserved = []; + // Never mangle arguments + push_uniq(options.reserved, "arguments"); + return options; +}); + +AST_Toplevel.DEFMETHOD("mangle_names", function(options) { + options = this._default_mangler_options(options); + + // We only need to mangle declaration nodes. Special logic wired + // into the code generator will display the mangled name if it's + // present (and for AST_SymbolRef-s it'll use the mangled name of + // the AST_SymbolDeclaration that it points to). + var lname = -1; + var to_mangle = []; + + var mangled_names = this.mangled_names = []; + if (options.cache) { + this.globals.each(collect); + if (options.cache.props) { + options.cache.props.each(function(mangled_name) { + push_uniq(mangled_names, mangled_name); + }); + } + } + + var tw = new TreeWalker(function(node, descend) { + if (node instanceof AST_LabeledStatement) { + // lname is incremented when we get to the AST_Label + var save_nesting = lname; + descend(); + lname = save_nesting; + return true; // don't descend again in TreeWalker + } + if (node instanceof AST_Scope) { + node.variables.each(collect); + return; + } + if (node.is_block_scope()) { + node.block_scope.variables.each(collect); + return; + } + if (node instanceof AST_Label) { + var name; + do name = base54(++lname); while (!is_identifier(name)); + node.mangled_name = name; + return true; + } + if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) { + to_mangle.push(node.definition()); + return; + } + }); + this.walk(tw); + to_mangle.forEach(function(def) { def.mangle(options); }); + + function collect(symbol) { + if (!member(symbol.name, options.reserved)) { + if (!(symbol.export & MASK_EXPORT_DONT_MANGLE)) { + to_mangle.push(symbol); + } + } + } +}); + +AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { + var cache = options.cache && options.cache.props; + var avoid = Object.create(null); + options.reserved.forEach(to_avoid); + this.globals.each(add_def); + this.walk(new TreeWalker(function(node) { + if (node instanceof AST_Scope) node.variables.each(add_def); + if (node instanceof AST_SymbolCatch) add_def(node.definition()); + })); + return avoid; + + function to_avoid(name) { + avoid[name] = true; + } + + function add_def(def) { + var name = def.name; + if (def.global && cache && cache.has(name)) name = cache.get(name); + else if (!def.unmangleable(options)) return; + to_avoid(name); + } +}); + +AST_Toplevel.DEFMETHOD("expand_names", function(options) { + base54.reset(); + base54.sort(); + options = this._default_mangler_options(options); + var avoid = this.find_colliding_names(options); + var cname = 0; + this.globals.each(rename); + this.walk(new TreeWalker(function(node) { + if (node instanceof AST_Scope) node.variables.each(rename); + if (node instanceof AST_SymbolCatch) rename(node.definition()); + })); + + function next_name() { + var name; + do { + name = base54(cname++); + } while (avoid[name] || !is_identifier(name)); + return name; + } + + function rename(def) { + if (def.global && options.cache) return; + if (def.unmangleable(options)) return; + if (member(def.name, options.reserved)) return; + var d = def.redefined(); + def.name = d ? d.name : next_name(); + def.orig.forEach(function(sym) { + sym.name = def.name; + }); + def.references.forEach(function(sym) { + sym.name = def.name; + }); + } +}); + +AST_Node.DEFMETHOD("tail_node", return_this); +AST_Sequence.DEFMETHOD("tail_node", function() { + return this.expressions[this.expressions.length - 1]; +}); + +AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { + options = this._default_mangler_options(options); + try { + AST_Node.prototype.print = function(stream, force_parens) { + this._print(stream, force_parens); + if (this instanceof AST_Symbol && !this.unmangleable(options)) { + base54.consider(this.name, -1); + } else if (options.properties) { + if (this instanceof AST_Dot) { + base54.consider(this.property, -1); + } else if (this instanceof AST_Sub) { + skip_string(this.property); + } + } + }; + base54.consider(this.print_to_string(), 1); + } finally { + AST_Node.prototype.print = AST_Node.prototype._print; + } + base54.sort(); + + function skip_string(node) { + if (node instanceof AST_String) { + base54.consider(node.value, -1); + } else if (node instanceof AST_Conditional) { + skip_string(node.consequent); + skip_string(node.alternative); + } else if (node instanceof AST_Sequence) { + skip_string(node.tail_node()); + } + } +}); + +var base54 = (function() { + var leading = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""); + var digits = "0123456789".split(""); + var chars, frequency; + function reset() { + frequency = Object.create(null); + leading.forEach(function(ch) { + frequency[ch] = 0; + }); + digits.forEach(function(ch) { + frequency[ch] = 0; + }); + } + base54.consider = function(str, delta) { + for (var i = str.length; --i >= 0;) { + frequency[str[i]] += delta; + } + }; + function compare(a, b) { + return frequency[b] - frequency[a]; + } + base54.sort = function() { + chars = mergeSort(leading, compare).concat(mergeSort(digits, compare)); + }; + base54.reset = reset; + reset(); + function base54(num) { + var ret = "", base = 54; + num++; + do { + num--; + ret += chars[num % base]; + num = Math.floor(num / base); + base = 64; + } while (num > 0); + return ret; + } + return base54; +})(); diff --git a/tools/node_modules/terser/lib/sourcemap.js b/tools/node_modules/terser/lib/sourcemap.js new file mode 100644 index 000000000000..173d9ed9fa35 --- /dev/null +++ b/tools/node_modules/terser/lib/sourcemap.js @@ -0,0 +1,97 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +// a small wrapper around fitzgen's source-map library +function SourceMap(options) { + options = defaults(options, { + file : null, + root : null, + orig : null, + + orig_line_diff : 0, + dest_line_diff : 0, + }); + var generator = new MOZ_SourceMap.SourceMapGenerator({ + file : options.file, + sourceRoot : options.root + }); + var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig); + + if (orig_map && Array.isArray(options.orig.sources)) { + orig_map._sources.toArray().forEach(function(source) { + var sourceContent = orig_map.sourceContentFor(source, true); + if (sourceContent) { + generator.setSourceContent(source, sourceContent); + } + }); + } + + function add(source, gen_line, gen_col, orig_line, orig_col, name) { + if (orig_map) { + var info = orig_map.originalPositionFor({ + line: orig_line, + column: orig_col + }); + if (info.source === null) { + return; + } + source = info.source; + orig_line = info.line; + orig_col = info.column; + name = info.name || name; + } + generator.addMapping({ + generated : { line: gen_line + options.dest_line_diff, column: gen_col }, + original : { line: orig_line + options.orig_line_diff, column: orig_col }, + source : source, + name : name + }); + } + return { + add : add, + get : function() { return generator; }, + toString : function() { return JSON.stringify(generator.toJSON()); } + }; +} diff --git a/tools/node_modules/terser/lib/transform.js b/tools/node_modules/terser/lib/transform.js new file mode 100644 index 000000000000..a760e51dc883 --- /dev/null +++ b/tools/node_modules/terser/lib/transform.js @@ -0,0 +1,275 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +// Tree transformer helpers. + +function TreeTransformer(before, after) { + TreeWalker.call(this); + this.before = before; + this.after = after; +} +TreeTransformer.prototype = new TreeWalker; + +(function(undefined) { + + function _(node, descend) { + node.DEFMETHOD("transform", function(tw, in_list) { + var x, y; + tw.push(this); + if (tw.before) x = tw.before(this, descend, in_list); + if (x === undefined) { + x = this; + descend(x, tw); + if (tw.after) { + y = tw.after(x, in_list); + if (y !== undefined) x = y; + } + } + tw.pop(); + return x; + }); + } + + function do_list(list, tw) { + return MAP(list, function(node) { + return node.transform(tw, true); + }); + } + + _(AST_Node, noop); + + _(AST_LabeledStatement, function(self, tw) { + self.label = self.label.transform(tw); + self.body = self.body.transform(tw); + }); + + _(AST_SimpleStatement, function(self, tw) { + self.body = self.body.transform(tw); + }); + + _(AST_Block, function(self, tw) { + self.body = do_list(self.body, tw); + }); + + _(AST_Do, function(self, tw) { + self.body = self.body.transform(tw); + self.condition = self.condition.transform(tw); + }); + + _(AST_While, function(self, tw) { + self.condition = self.condition.transform(tw); + self.body = self.body.transform(tw); + }); + + _(AST_For, function(self, tw) { + if (self.init) self.init = self.init.transform(tw); + if (self.condition) self.condition = self.condition.transform(tw); + if (self.step) self.step = self.step.transform(tw); + self.body = self.body.transform(tw); + }); + + _(AST_ForIn, function(self, tw) { + self.init = self.init.transform(tw); + self.object = self.object.transform(tw); + self.body = self.body.transform(tw); + }); + + _(AST_With, function(self, tw) { + self.expression = self.expression.transform(tw); + self.body = self.body.transform(tw); + }); + + _(AST_Exit, function(self, tw) { + if (self.value) self.value = self.value.transform(tw); + }); + + _(AST_LoopControl, function(self, tw) { + if (self.label) self.label = self.label.transform(tw); + }); + + _(AST_If, function(self, tw) { + self.condition = self.condition.transform(tw); + self.body = self.body.transform(tw); + if (self.alternative) self.alternative = self.alternative.transform(tw); + }); + + _(AST_Switch, function(self, tw) { + self.expression = self.expression.transform(tw); + self.body = do_list(self.body, tw); + }); + + _(AST_Case, function(self, tw) { + self.expression = self.expression.transform(tw); + self.body = do_list(self.body, tw); + }); + + _(AST_Try, function(self, tw) { + self.body = do_list(self.body, tw); + if (self.bcatch) self.bcatch = self.bcatch.transform(tw); + if (self.bfinally) self.bfinally = self.bfinally.transform(tw); + }); + + _(AST_Catch, function(self, tw) { + if (self.argname) self.argname = self.argname.transform(tw); + self.body = do_list(self.body, tw); + }); + + _(AST_Definitions, function(self, tw) { + self.definitions = do_list(self.definitions, tw); + }); + + _(AST_VarDef, function(self, tw) { + self.name = self.name.transform(tw); + if (self.value) self.value = self.value.transform(tw); + }); + + _(AST_Destructuring, function(self, tw) { + self.names = do_list(self.names, tw); + }); + + _(AST_Lambda, function(self, tw) { + if (self.name) self.name = self.name.transform(tw); + self.argnames = do_list(self.argnames, tw); + if (self.body instanceof AST_Node) { + self.body = self.body.transform(tw); + } else { + self.body = do_list(self.body, tw); + } + }); + + _(AST_Call, function(self, tw) { + self.expression = self.expression.transform(tw); + self.args = do_list(self.args, tw); + }); + + _(AST_Sequence, function(self, tw) { + self.expressions = do_list(self.expressions, tw); + }); + + _(AST_Dot, function(self, tw) { + self.expression = self.expression.transform(tw); + }); + + _(AST_Sub, function(self, tw) { + self.expression = self.expression.transform(tw); + self.property = self.property.transform(tw); + }); + + _(AST_Yield, function(self, tw) { + if (self.expression) self.expression = self.expression.transform(tw); + }); + + _(AST_Await, function(self, tw) { + self.expression = self.expression.transform(tw); + }); + + _(AST_Unary, function(self, tw) { + self.expression = self.expression.transform(tw); + }); + + _(AST_Binary, function(self, tw) { + self.left = self.left.transform(tw); + self.right = self.right.transform(tw); + }); + + _(AST_Conditional, function(self, tw) { + self.condition = self.condition.transform(tw); + self.consequent = self.consequent.transform(tw); + self.alternative = self.alternative.transform(tw); + }); + + _(AST_Array, function(self, tw) { + self.elements = do_list(self.elements, tw); + }); + + _(AST_Object, function(self, tw) { + self.properties = do_list(self.properties, tw); + }); + + _(AST_ObjectProperty, function(self, tw) { + if (self.key instanceof AST_Node) { + self.key = self.key.transform(tw); + } + self.value = self.value.transform(tw); + }); + + _(AST_Class, function(self, tw) { + if (self.name) self.name = self.name.transform(tw); + if (self.extends) self.extends = self.extends.transform(tw); + self.properties = do_list(self.properties, tw); + }); + + _(AST_Expansion, function(self, tw) { + self.expression = self.expression.transform(tw); + }); + + _(AST_NameMapping, function(self, tw) { + self.foreign_name = self.foreign_name.transform(tw); + self.name = self.name.transform(tw); + }); + + _(AST_Import, function(self, tw) { + if (self.imported_name) self.imported_name = self.imported_name.transform(tw); + if (self.imported_names) do_list(self.imported_names, tw); + self.module_name = self.module_name.transform(tw); + }); + + _(AST_Export, function(self, tw) { + if (self.exported_definition) self.exported_definition = self.exported_definition.transform(tw); + if (self.exported_value) self.exported_value = self.exported_value.transform(tw); + if (self.exported_names) do_list(self.exported_names, tw); + if (self.module_name) self.module_name = self.module_name.transform(tw); + }); + + _(AST_TemplateString, function(self, tw) { + self.segments = do_list(self.segments, tw); + }); + + _(AST_PrefixedTemplateString, function(self, tw) { + self.prefix = self.prefix.transform(tw); + self.template_string = self.template_string.transform(tw); + }); + +})(); diff --git a/tools/node_modules/terser/lib/utils.js b/tools/node_modules/terser/lib/utils.js new file mode 100644 index 000000000000..6678c568136a --- /dev/null +++ b/tools/node_modules/terser/lib/utils.js @@ -0,0 +1,350 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function characters(str) { + return str.split(""); +} + +function member(name, array) { + return array.indexOf(name) >= 0; +} + +function find_if(func, array) { + for (var i = 0, n = array.length; i < n; ++i) { + if (func(array[i])) + return array[i]; + } +} + +function repeat_string(str, i) { + if (i <= 0) return ""; + if (i == 1) return str; + var d = repeat_string(str, i >> 1); + d += d; + if (i & 1) d += str; + return d; +} + +function configure_error_stack(fn) { + Object.defineProperty(fn.prototype, "stack", { + get: function() { + var err = new Error(this.message); + err.name = this.name; + try { + throw err; + } catch(e) { + return e.stack; + } + } + }); +} + +function DefaultsError(msg, defs) { + this.message = msg; + this.defs = defs; +} +DefaultsError.prototype = Object.create(Error.prototype); +DefaultsError.prototype.constructor = DefaultsError; +DefaultsError.prototype.name = "DefaultsError"; +configure_error_stack(DefaultsError); + +DefaultsError.croak = function(msg, defs) { + throw new DefaultsError(msg, defs); +}; + +function defaults(args, defs, croak) { + if (args === true) + args = {}; + var ret = args || {}; + if (croak) for (var i in ret) if (HOP(ret, i) && !HOP(defs, i)) + DefaultsError.croak("`" + i + "` is not a supported option", defs); + for (var i in defs) if (HOP(defs, i)) { + ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; + } + return ret; +} + +function merge(obj, ext) { + var count = 0; + for (var i in ext) if (HOP(ext, i)) { + obj[i] = ext[i]; + count++; + } + return count; +} + +function noop() {} +function return_false() { return false; } +function return_true() { return true; } +function return_this() { return this; } +function return_null() { return null; } + +var MAP = (function() { + function MAP(a, f, backwards) { + var ret = [], top = [], i; + function doit() { + var val = f(a[i], i); + var is_last = val instanceof Last; + if (is_last) val = val.v; + if (val instanceof AtTop) { + val = val.v; + if (val instanceof Splice) { + top.push.apply(top, backwards ? val.v.slice().reverse() : val.v); + } else { + top.push(val); + } + } else if (val !== skip) { + if (val instanceof Splice) { + ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v); + } else { + ret.push(val); + } + } + return is_last; + } + if (a instanceof Array) { + if (backwards) { + for (i = a.length; --i >= 0;) if (doit()) break; + ret.reverse(); + top.reverse(); + } else { + for (i = 0; i < a.length; ++i) if (doit()) break; + } + } else { + for (i in a) if (HOP(a, i)) if (doit()) break; + } + return top.concat(ret); + } + MAP.at_top = function(val) { return new AtTop(val); }; + MAP.splice = function(val) { return new Splice(val); }; + MAP.last = function(val) { return new Last(val); }; + var skip = MAP.skip = {}; + function AtTop(val) { this.v = val; } + function Splice(val) { this.v = val; } + function Last(val) { this.v = val; } + return MAP; +})(); + +function push_uniq(array, el) { + if (array.indexOf(el) < 0) + array.push(el); +} + +function string_template(text, props) { + return text.replace(/\{(.+?)\}/g, function(str, p) { + return props && props[p]; + }); +} + +function remove(array, el) { + for (var i = array.length; --i >= 0;) { + if (array[i] === el) array.splice(i, 1); + } +} + +function mergeSort(array, cmp) { + if (array.length < 2) return array.slice(); + function merge(a, b) { + var r = [], ai = 0, bi = 0, i = 0; + while (ai < a.length && bi < b.length) { + cmp(a[ai], b[bi]) <= 0 + ? r[i++] = a[ai++] + : r[i++] = b[bi++]; + } + if (ai < a.length) r.push.apply(r, a.slice(ai)); + if (bi < b.length) r.push.apply(r, b.slice(bi)); + return r; + } + function _ms(a) { + if (a.length <= 1) + return a; + var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); + left = _ms(left); + right = _ms(right); + return merge(left, right); + } + return _ms(array); +} + +// this function is taken from Acorn [1], written by Marijn Haverbeke +// [1] https://github.com/marijnh/acorn +function makePredicate(words) { + if (!(words instanceof Array)) words = words.split(" "); + var f = "", cats = []; + out: for (var i = 0; i < words.length; ++i) { + for (var j = 0; j < cats.length; ++j) + if (cats[j][0].length == words[i].length) { + cats[j].push(words[i]); + continue out; + } + cats.push([words[i]]); + } + function quote(word) { + return JSON.stringify(word).replace(/[\u2028\u2029]/g, function(s) { + switch (s) { + case "\u2028": return "\\u2028"; + case "\u2029": return "\\u2029"; + } + return s; + }); + } + function compareTo(arr) { + if (arr.length == 1) return f += "return str === " + quote(arr[0]) + ";"; + f += "switch(str){"; + for (var i = 0; i < arr.length; ++i) f += "case " + quote(arr[i]) + ":"; + f += "return true}return false;"; + } + // When there are more than three length categories, an outer + // switch first dispatches on the lengths, to save on comparisons. + if (cats.length > 3) { + cats.sort(function(a, b) {return b.length - a.length;}); + f += "switch(str.length){"; + for (var i = 0; i < cats.length; ++i) { + var cat = cats[i]; + f += "case " + cat[0].length + ":"; + compareTo(cat); + } + f += "}"; + // Otherwise, simply generate a flat `switch` statement. + } else { + compareTo(words); + } + return new Function("str", f); +} + +function all(array, predicate) { + for (var i = array.length; --i >= 0;) + if (!predicate(array[i])) + return false; + return true; +} + +function Dictionary() { + this._values = Object.create(null); + this._size = 0; +} +Dictionary.prototype = { + set: function(key, val) { + if (!this.has(key)) ++this._size; + this._values["$" + key] = val; + return this; + }, + add: function(key, val) { + if (this.has(key)) { + this.get(key).push(val); + } else { + this.set(key, [ val ]); + } + return this; + }, + get: function(key) { return this._values["$" + key]; }, + del: function(key) { + if (this.has(key)) { + --this._size; + delete this._values["$" + key]; + } + return this; + }, + has: function(key) { return ("$" + key) in this._values; }, + each: function(f) { + for (var i in this._values) + f(this._values[i], i.substr(1)); + }, + size: function() { + return this._size; + }, + map: function(f) { + var ret = []; + for (var i in this._values) + ret.push(f(this._values[i], i.substr(1))); + return ret; + }, + clone: function() { + var ret = new Dictionary(); + for (var i in this._values) + ret._values[i] = this._values[i]; + ret._size = this._size; + return ret; + }, + toObject: function() { return this._values; } +}; +Dictionary.fromObject = function(obj) { + var dict = new Dictionary(); + dict._size = merge(dict._values, obj); + return dict; +}; +exports.Dictionary = Dictionary; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +// return true if the node at the top of the stack (that means the +// innermost node in the current output) is lexically the first in +// a statement. +function first_in_statement(stack) { + var node = stack.parent(-1); + for (var i = 0, p; p = stack.parent(i); i++) { + if (p instanceof AST_Statement && p.body === node) + return true; + if ((p instanceof AST_Sequence && p.expressions[0] === node) || + (p.TYPE == "Call" && p.expression === node ) || + (p instanceof AST_Dot && p.expression === node ) || + (p instanceof AST_Sub && p.expression === node ) || + (p instanceof AST_Conditional && p.condition === node ) || + (p instanceof AST_Binary && p.left === node ) || + (p instanceof AST_UnaryPostfix && p.expression === node ) + ) { + node = p; + } else { + return false; + } + } +} + +function keep_name(keep_setting, name) { + return keep_setting === true + || (keep_setting instanceof RegExp && keep_setting.test(name)); +} diff --git a/tools/node_modules/terser/node_modules/source-map/CHANGELOG.md b/tools/node_modules/terser/node_modules/source-map/CHANGELOG.md new file mode 100644 index 000000000000..3a8c066c66b1 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/CHANGELOG.md @@ -0,0 +1,301 @@ +# Change Log + +## 0.5.6 + +* Fix for regression when people were using numbers as names in source maps. See + #236. + +## 0.5.5 + +* Fix "regression" of unsupported, implementation behavior that half the world + happens to have come to depend on. See #235. + +* Fix regression involving function hoisting in SpiderMonkey. See #233. + +## 0.5.4 + +* Large performance improvements to source-map serialization. See #228 and #229. + +## 0.5.3 + +* Do not include unnecessary distribution files. See + commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. + +## 0.5.2 + +* Include browser distributions of the library in package.json's `files`. See + issue #212. + +## 0.5.1 + +* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See + ff05274becc9e6e1295ed60f3ea090d31d843379. + +## 0.5.0 + +* Node 0.8 is no longer supported. + +* Use webpack instead of dryice for bundling. + +* Big speedups serializing source maps. See pull request #203. + +* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that + explicitly start with the source root. See issue #199. + +## 0.4.4 + +* Fix an issue where using a `SourceMapGenerator` after having created a + `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See + issue #191. + +* Fix an issue with where `SourceMapGenerator` would mistakenly consider + different mappings as duplicates of each other and avoid generating them. See + issue #192. + +## 0.4.3 + +* A very large number of performance improvements, particularly when parsing + source maps. Collectively about 75% of time shaved off of the source map + parsing benchmark! + +* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy + searching in the presence of a column option. See issue #177. + +* Fix a bug with joining a source and its source root when the source is above + the root. See issue #182. + +* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to + determine when all sources' contents are inlined into the source map. See + issue #190. + +## 0.4.2 + +* Add an `.npmignore` file so that the benchmarks aren't pulled down by + dependent projects. Issue #169. + +* Add an optional `column` argument to + `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines + with no mappings. Issues #172 and #173. + +## 0.4.1 + +* Fix accidentally defining a global variable. #170. + +## 0.4.0 + +* The default direction for fuzzy searching was changed back to its original + direction. See #164. + +* There is now a `bias` option you can supply to `SourceMapConsumer` to control + the fuzzy searching direction. See #167. + +* About an 8% speed up in parsing source maps. See #159. + +* Added a benchmark for parsing and generating source maps. + +## 0.3.0 + +* Change the default direction that searching for positions fuzzes when there is + not an exact match. See #154. + +* Support for environments using json2.js for JSON serialization. See #156. + +## 0.2.0 + +* Support for consuming "indexed" source maps which do not have any remote + sections. See pull request #127. This introduces a minor backwards + incompatibility if you are monkey patching `SourceMapConsumer.prototype` + methods. + +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + +## 0.1.40 + +* Performance improvements for parsing source maps in SourceMapConsumer. + +## 0.1.39 + +* Fix a bug where setting a source's contents to null before any source content + had been set before threw a TypeError. See issue #131. + +## 0.1.38 + +* Fix a bug where finding relative paths from an empty path were creating + absolute paths. See issue #129. + +## 0.1.37 + +* Fix a bug where if the source root was an empty string, relative source paths + would turn into absolute source paths. Issue #124. + +## 0.1.36 + +* Allow the `names` mapping property to be an empty string. Issue #121. + +## 0.1.35 + +* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` + to specify a path that relative sources in the second parameter should be + relative to. Issue #105. + +* If no file property is given to a `SourceMapGenerator`, then the resulting + source map will no longer have a `null` file property. The property will + simply not exist. Issue #104. + +* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. + Issue #116. + +## 0.1.34 + +* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. + +* Fix bug involving source contents and the + `SourceMapGenerator.prototype.applySourceMap`. Issue #100. + +## 0.1.33 + +* Fix some edge cases surrounding path joining and URL resolution. + +* Add a third parameter for relative path to + `SourceMapGenerator.prototype.applySourceMap`. + +* Fix issues with mappings and EOLs. + +## 0.1.32 + +* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns + (issue 92). + +* Fixed test runner to actually report number of failed tests as its process + exit code. + +* Fixed a typo when reporting bad mappings (issue 87). + +## 0.1.31 + +* Delay parsing the mappings in SourceMapConsumer until queried for a source + location. + +* Support Sass source maps (which at the time of writing deviate from the spec + in small ways) in SourceMapConsumer. + +## 0.1.30 + +* Do not join source root with a source, when the source is a data URI. + +* Extend the test runner to allow running single specific test files at a time. + +* Performance improvements in `SourceNode.prototype.walk` and + `SourceMapConsumer.prototype.eachMapping`. + +* Source map browser builds will now work inside Workers. + +* Better error messages when attempting to add an invalid mapping to a + `SourceMapGenerator`. + +## 0.1.29 + +* Allow duplicate entries in the `names` and `sources` arrays of source maps + (usually from TypeScript) we are parsing. Fixes github issue 72. + +## 0.1.28 + +* Skip duplicate mappings when creating source maps from SourceNode; github + issue 75. + +## 0.1.27 + +* Don't throw an error when the `file` property is missing in SourceMapConsumer, + we don't use it anyway. + +## 0.1.26 + +* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. + +## 0.1.25 + +* Make compatible with browserify + +## 0.1.24 + +* Fix issue with absolute paths and `file://` URIs. See + https://bugzilla.mozilla.org/show_bug.cgi?id=885597 + +## 0.1.23 + +* Fix issue with absolute paths and sourcesContent, github issue 64. + +## 0.1.22 + +* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. + +## 0.1.21 + +* Fixed handling of sources that start with a slash so that they are relative to + the source root's host. + +## 0.1.20 + +* Fixed github issue #43: absolute URLs aren't joined with the source root + anymore. + +## 0.1.19 + +* Using Travis CI to run tests. + +## 0.1.18 + +* Fixed a bug in the handling of sourceRoot. + +## 0.1.17 + +* Added SourceNode.fromStringWithSourceMap. + +## 0.1.16 + +* Added missing documentation. + +* Fixed the generating of empty mappings in SourceNode. + +## 0.1.15 + +* Added SourceMapGenerator.applySourceMap. + +## 0.1.14 + +* The sourceRoot is now handled consistently. + +## 0.1.13 + +* Added SourceMapGenerator.fromSourceMap. + +## 0.1.12 + +* SourceNode now generates empty mappings too. + +## 0.1.11 + +* Added name support to SourceNode. + +## 0.1.10 + +* Added sourcesContent support to the customer and generator. diff --git a/tools/node_modules/terser/node_modules/source-map/LICENSE b/tools/node_modules/terser/node_modules/source-map/LICENSE new file mode 100644 index 000000000000..ed1b7cf27e97 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/LICENSE @@ -0,0 +1,28 @@ + +Copyright (c) 2009-2011, Mozilla Foundation and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the names of the Mozilla Foundation nor the names of project + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/terser/node_modules/source-map/README.md b/tools/node_modules/terser/node_modules/source-map/README.md new file mode 100644 index 000000000000..fea4beb193f3 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/README.md @@ -0,0 +1,742 @@ +# Source Map + +[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) + +[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) + +This is a library to generate and consume the source map format +[described here][format]. + +[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit + +## Use with Node + + $ npm install source-map + +## Use on the Web + + + +-------------------------------------------------------------------------------- + + + + + +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + + + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. Line numbers in + this library are 1-based (note that the underlying source map + specification uses 0-based line numbers -- this library handles the + translation). + +* `column`: The column number in the generated source. Column numbers + in this library are 0-based. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. The line number is 1-based. + +* `column`: The column number in the original source, or null if this + information is not available. The column number is 0-based. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: The column number in the original source. The column + number is 0-based. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: Optional. The column number in the original source. The + column number is 0-based. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. The line number is 1-based. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. The column number + is 0-based. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/tools/node_modules/terser/node_modules/source-map/dist/source-map.debug.js b/tools/node_modules/terser/node_modules/source-map/dist/source-map.debug.js new file mode 100644 index 000000000000..aad0620d70e1 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/dist/source-map.debug.js @@ -0,0 +1,3234 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["sourceMap"] = factory(); + else + root["sourceMap"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + /* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; + exports.SourceNode = __webpack_require__(10).SourceNode; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = __webpack_require__(2); + var util = __webpack_require__(4); + var ArraySet = __webpack_require__(5).ArraySet; + var MappingList = __webpack_require__(6).MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + exports.SourceMapGenerator = SourceMapGenerator; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = __webpack_require__(3); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var binarySearch = __webpack_require__(8); + var ArraySet = __webpack_require__(5).ArraySet; + var base64VLQ = __webpack_require__(2); + var quickSort = __webpack_require__(9).quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + } + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + var util = __webpack_require__(4); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + exports.SourceNode = SourceNode; + + +/***/ }) +/******/ ]) +}); +; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAxNjI0YzcyOTliODg3ZjdiZGY2NCIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL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5hbENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHByZXZpb3VzT3JpZ2luYWxDb2x1bW4pO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsQ29sdW1uID0gbWFwcGluZy5vcmlnaW5hbENvbHVtbjtcblxuICAgICAgICBpZiAobWFwcGluZy5uYW1lICE9IG51bGwpIHtcbiAgICAgICAgICBuYW1lSWR4ID0gdGhpcy5fbmFtZXMuaW5kZXhPZihtYXBwaW5nLm5hbWUpO1xuICAgICAgICAgIG5leHQgKz0gYmFzZTY0VkxRLmVuY29kZShuYW1lSWR4IC0gcHJldmlvdXNOYW1lKTtcbiAgICAgICAgICBwcmV2aW91c05hbWUgPSBuYW1lSWR4O1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJlc3VsdCArPSBuZXh0O1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG4gIH07XG5cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuX2dlbmVyYXRlU291cmNlc0NvbnRlbnQgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBHZW5lcmF0b3JfZ2VuZXJhdGVTb3VyY2VzQ29udGVudChhU291cmNlcywgYVNvdXJjZVJvb3QpIHtcbiAgICByZXR1cm4gYVNvdXJjZXMubWFwKGZ1bmN0aW9uIChzb3VyY2UpIHtcbiAgICAgIGlmICghdGhpcy5fc291cmNlc0NvbnRlbnRzKSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfVxuICAgICAgaWYgKGFTb3VyY2VSb290ICE9IG51bGwpIHtcbiAgICAgICAgc291cmNlID0gdXRpbC5yZWxhdGl2ZShhU291cmNlUm9vdCwgc291cmNlKTtcbiAgICAgIH1cbiAgICAgIHZhciBrZXkgPSB1dGlsLnRvU2V0U3RyaW5nKHNvdXJjZSk7XG4gICAgICByZXR1cm4gT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHRoaXMu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nY29sdW1uJywgMClcbiAgICB9O1xuXG4gICAgbmVlZGxlLnNvdXJjZSA9IHRoaXMuX2ZpbmRTb3VyY2VJbmRleChuZWVkbGUuc291cmNlKTtcbiAgICBpZiAobmVlZGxlLnNvdXJjZSA8IDApIHtcbiAgICAgIHJldHVybiBbXTtcbiAgICB9XG5cbiAgICB2YXIgbWFwcGluZ3MgPSBbXTtcblxuICAgIHZhciBpbmRleCA9IHRoaXMuX2ZpbmRNYXBwaW5nKG5lZWRsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9vcmlnaW5hbE1hcHBpbmdzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwib3JpZ2luYWxMaW5lXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvcmlnaW5hbENvbHVtblwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHV0aWwuY29tcGFyZUJ5T3JpZ2luYWxQb3NpdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmluYXJ5U2VhcmNoLkxFQVNUX1VQUEVSX0JPVU5EKTtcbiAgICBpZiAoaW5kZXggPj0gMCkge1xuICAgICAgdmFyIG1hcHBpbmcgPSB0aGlzLl9vcmlnaW5hbE1hcHBpbmdzW2luZGV4XTtcblxuICAgICAgaWYgKGFBcmdzLmNvbHVtbiA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHZhciBvcmlnaW5hbExpbmUgPSBtYXBwaW5nLm9yaWdpbmFsTGluZTtcblxuICAgICAgICAvLyBJdGVyYXRlIHVudGlsIGVpdGhlciB3ZSBydW4gb3V0IG9mIG1hcHBpbmdzLCBvciB3ZSBydW4gaW50b1xuICAgICAgICAvLyBhIG1hcHBpbmcgZm9yIGEgZGlmZmVyZW50IGxpbmUgdGhhbiB0aGUgb25lIHdlIGZvdW5kLiBTaW5jZVxuICAgICAgICAvLyBtYXBwaW5ncyBhcm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ICAgICAgICAvLyBHZW5lcmF0ZWQgY29sdW1uLlxuICAgICAgICBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbiA9IHByZXZpb3VzR2VuZXJhdGVkQ29sdW1uICsgc2VnbWVudFswXTtcbiAgICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgLy8gT3JpZ2luYWwgc291cmNlLlxuICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gcHJldmlvdXNTb3VyY2UgKyBzZWdtZW50WzFdO1xuICAgICAgICAgIHByZXZpb3VzU291cmNlICs9IHNlZ21lbnRbMV07XG5cbiAgICAgICAgICAvLyBPcmlnaW5hbCBsaW5lLlxuICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxMaW5lID0gcHJldmlvdXNPcmlnaW5hbExpbmUgKyBzZWdtZW50WzJdO1xuICAgICAgICAgIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gbWFwcGluZy5vcmlnaW5hbExpbmU7XG4gICAgICAgICAgLy8gTGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkXG4gICAgICAgICAgbWFwcGluZy5vcmlnaW5hbExpbmUgKz0gMTtcblxuICAgICAgICAgIC8vIE9yaWdpbmFsIGNvbHVtbi5cbiAgICAgICAgICBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uID0gcHJldmlvdXNPcmlnaW5hbENvbHVtbiArIHNlZ21lbnRbM107XG4gICAgICAgICAgcHJldmlvdXNPcmlnaW5hbENvbHVtbiA9IG1hcHBpbmcub3JpZ2luYWxDb2x1bW47XG5cbiAgICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiA0KSB7XG4gICAgICAgICAgICAvLyBPcmlnaW5hbCBuYW1lLlxuICAgICAgICAgICAgbWFwcGluZy5uYW1lID0gcHJldmlvdXNOYW1lICsgc2VnbWVudF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KSB7XG4gICAgICBpZiAobWFwcGluZyA9PT0gbnVsbCB8fCBtYXBwaW5nLnNvdXJjZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIG5vZGUuYWRkKGNvZGUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHNvdXJjZSA9IGFSZWxhdGl2ZVBhdGhcbiAgICAgICAgICA/IHV0aWwuam9pbihhUmVsYXRpdmVQYXRoLCBtYXBwaW5nLnNvdXJjZSlcbiAgICAgICAgICA6IG1hcHBpbmcuc291cmNlO1xuICAgICAgICBub2RlLmFkZChuZXcgU291cmNlTm9kZShtYXBwaW5nLm9yaWdpbmFsTGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwcGluZy5vcmlnaW5hbENvbHVtbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBwaW5nLm5hbWUpKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbi8qKlxuICogQWRkIGEgY2h1bmsgb2YgZ2VuZXJhdGVkIEpTIHRvIHRoaXMgc291cmNlIG5vZGUuXG4gKlxuICogQHBhcmFtIGFDaHVuayBBIHN0cmluZyBzbmlwcGV0IG9mIGdlbmVyYXRlZCBKUyBjb2RlLCBhbm90aGVyIGluc3RhbmNlIG9mXG4gKiAgICAgICAgU291cmNlTm9kZSwgb3IgYW4gYXJyYXkgd2hlcmUgZWFjaCBtZW1iZXIgaXMgb25lIG9mIHRob3NlIHRoaW5ncy5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24gU291cmNlTm9kZV9hZGQoYUNodW5rKSB7XG4gIGlmIChBcnJheS5pc0FycmF5KGFDaHVuaykpIHtcbiAgICBhQ2h1bmsuZm9yRWFjaChmdW5jdGlvbiAoY2h1bmspIHtcbi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3VyY2VNYXBwaW5nQWN0aXZlKSB7XG4gICAgICAgICAgbWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgc291cmNlOiBvcmlnaW5hbC5zb3VyY2UsXG4gICAgICAgICAgICBvcmlnaW5hbDoge1xuICAgICAgICAgICAgICBsaW5lOiBvcmlnaW5hbC5saW5lLFxuICAgICAgICAgICAgICBjb2x1bW46IG9yaWdpbmFsLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWQubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWQuY29sdW1uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmFtZTogb3JpZ2luYWwubmFtZVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBnZW5lcmF0ZWQuY29sdW1uKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbiAgdGhpcy53YWxrU291cmNlQ29udGVudHMoZnVuY3Rpb24gKHNvdXJjZUZpbGUsIHNvdXJjZUNvbnRlbnQpIHtcbiAgICBtYXAuc2V0U291cmNlQ29udGVudChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KTtcbiAgfSk7XG5cbiAgcmV0dXJuIHsgY29kZTogZ2VuZXJhdGVkLmNvZGUsIG1hcDogbWFwIH07XG59O1xuXG5leHBvcnRzLlNvdXJjZU5vZGUgPSBTb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW5vZGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/tools/node_modules/terser/node_modules/source-map/dist/source-map.js b/tools/node_modules/terser/node_modules/source-map/dist/source-map.js new file mode 100644 index 000000000000..b4eb08742598 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/dist/source-map.js @@ -0,0 +1,3233 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["sourceMap"] = factory(); + else + root["sourceMap"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + /* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; + exports.SourceNode = __webpack_require__(10).SourceNode; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = __webpack_require__(2); + var util = __webpack_require__(4); + var ArraySet = __webpack_require__(5).ArraySet; + var MappingList = __webpack_require__(6).MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + exports.SourceMapGenerator = SourceMapGenerator; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = __webpack_require__(3); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var binarySearch = __webpack_require__(8); + var ArraySet = __webpack_require__(5).ArraySet; + var base64VLQ = __webpack_require__(2); + var quickSort = __webpack_require__(9).quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + } + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + var util = __webpack_require__(4); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + exports.SourceNode = SourceNode; + + +/***/ }) +/******/ ]) +}); +; \ No newline at end of file diff --git a/tools/node_modules/terser/node_modules/source-map/dist/source-map.min.js b/tools/node_modules/terser/node_modules/source-map/dist/source-map.min.js new file mode 100644 index 000000000000..c7c72dad8b59 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/dist/source-map.min.js @@ -0,0 +1,2 @@ +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var o=t;null!==n&&(o=i.relative(n,t)),r._sources.has(o)||r._sources.add(o);var s=e.sourceContentFor(t);null!=s&&r.setSourceContent(t,s)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(y))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=f(e.source,n.source);return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:f(e.name,n.name)))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=f(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:f(e.name,n.name)))))}function f(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}function m(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function _(e,n,r){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),r){var a=t(r);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var u=a.path.lastIndexOf("/");u>=0&&(a.path=a.path.substring(0,u+1))}n=s(o(a),n)}return i(n)}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,y=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||v.test(e)},n.relative=a;var C=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=C?u:l,n.fromSetString=C?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d,n.parseSourceMapInput=m,n.computeSourceURL=_},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e,n){var r=e;return"string"==typeof e&&(r=a.parseSourceMapInput(e)),null!=r.sections?new s(r,n):new o(r,n)}function o(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var t=a.getArg(r,"version"),o=a.getArg(r,"sources"),i=a.getArg(r,"names",[]),s=a.getArg(r,"sourceRoot",null),u=a.getArg(r,"sourcesContent",null),c=a.getArg(r,"mappings"),g=a.getArg(r,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);s&&(s=a.normalize(s)),o=o.map(String).map(a.normalize).map(function(e){return s&&a.isAbsolute(s)&&a.isAbsolute(e)?a.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return a.computeSourceURL(s,e,n)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=n,this.file=g}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var o=a.getArg(r,"version"),i=a.getArg(r,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=a.getArg(e,"offset"),o=a.getArg(r,"line"),i=a.getArg(r,"column");if(o=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(e){var n=e;if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),A.push(r),"number"==typeof r.originalLine&&S.push(r)}g(A,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,g(S,a.compareByOriginalPositions),this.__originalMappings=S},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=a.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var t=e;null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t));var o;if(null!=this.sourceRoot&&(o=a.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!o.path||"/"==o.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(n)return null;throw new Error('"'+t+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r0){for(n=[],r=0;r 0 && aGenerated.column >= 0\n\t && !aOriginal && !aSource && !aName) {\n\t // Case 1.\n\t return;\n\t }\n\t else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n\t && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n\t && aGenerated.line > 0 && aGenerated.column >= 0\n\t && aOriginal.line > 0 && aOriginal.column >= 0\n\t && aSource) {\n\t // Cases 2 and 3.\n\t return;\n\t }\n\t else {\n\t throw new Error('Invalid mapping: ' + JSON.stringify({\n\t generated: aGenerated,\n\t source: aSource,\n\t original: aOriginal,\n\t name: aName\n\t }));\n\t }\n\t };\n\t\n\t/**\n\t * Serialize the accumulated mappings in to the stream of base 64 VLQs\n\t * specified by the source map format.\n\t */\n\tSourceMapGenerator.prototype._serializeMappings =\n\t function SourceMapGenerator_serializeMappings() {\n\t var previousGeneratedColumn = 0;\n\t var previousGeneratedLine = 1;\n\t var previousOriginalColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousName = 0;\n\t var previousSource = 0;\n\t var result = '';\n\t var next;\n\t var mapping;\n\t var nameIdx;\n\t var sourceIdx;\n\t\n\t var mappings = this._mappings.toArray();\n\t for (var i = 0, len = mappings.length; i < len; i++) {\n\t mapping = mappings[i];\n\t next = ''\n\t\n\t if (mapping.generatedLine !== previousGeneratedLine) {\n\t previousGeneratedColumn = 0;\n\t while (mapping.generatedLine !== previousGeneratedLine) {\n\t next += ';';\n\t previousGeneratedLine++;\n\t }\n\t }\n\t else {\n\t if (i > 0) {\n\t if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n\t continue;\n\t }\n\t next += ',';\n\t }\n\t }\n\t\n\t next += base64VLQ.encode(mapping.generatedColumn\n\t - previousGeneratedColumn);\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (mapping.source != null) {\n\t sourceIdx = this._sources.indexOf(mapping.source);\n\t next += base64VLQ.encode(sourceIdx - previousSource);\n\t previousSource = sourceIdx;\n\t\n\t // lines are stored 0-based in SourceMap spec version 3\n\t next += base64VLQ.encode(mapping.originalLine - 1\n\t - previousOriginalLine);\n\t previousOriginalLine = mapping.originalLine - 1;\n\t\n\t next += base64VLQ.encode(mapping.originalColumn\n\t - previousOriginalColumn);\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (mapping.name != null) {\n\t nameIdx = this._names.indexOf(mapping.name);\n\t next += base64VLQ.encode(nameIdx - previousName);\n\t previousName = nameIdx;\n\t }\n\t }\n\t\n\t result += next;\n\t }\n\t\n\t return result;\n\t };\n\t\n\tSourceMapGenerator.prototype._generateSourcesContent =\n\t function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n\t return aSources.map(function (source) {\n\t if (!this._sourcesContents) {\n\t return null;\n\t }\n\t if (aSourceRoot != null) {\n\t source = util.relative(aSourceRoot, source);\n\t }\n\t var key = util.toSetString(source);\n\t return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n\t ? this._sourcesContents[key]\n\t : null;\n\t }, this);\n\t };\n\t\n\t/**\n\t * Externalize the source map.\n\t */\n\tSourceMapGenerator.prototype.toJSON =\n\t function SourceMapGenerator_toJSON() {\n\t var map = {\n\t version: this._version,\n\t sources: this._sources.toArray(),\n\t names: this._names.toArray(),\n\t mappings: this._serializeMappings()\n\t };\n\t if (this._file != null) {\n\t map.file = this._file;\n\t }\n\t if (this._sourceRoot != null) {\n\t map.sourceRoot = this._sourceRoot;\n\t }\n\t if (this._sourcesContents) {\n\t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n\t }\n\t\n\t return map;\n\t };\n\t\n\t/**\n\t * Render the source map being generated to a string.\n\t */\n\tSourceMapGenerator.prototype.toString =\n\t function SourceMapGenerator_toString() {\n\t return JSON.stringify(this.toJSON());\n\t };\n\t\n\texports.SourceMapGenerator = SourceMapGenerator;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t *\n\t * Based on the Base 64 VLQ implementation in Closure Compiler:\n\t * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n\t *\n\t * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * * Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t * * Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t * * Neither the name of Google Inc. nor the names of its\n\t * contributors may be used to endorse or promote products derived\n\t * from this software without specific prior written permission.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\t * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\t * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\t * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\t * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n\t * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n\t * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\t * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n\t * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t */\n\t\n\tvar base64 = __webpack_require__(3);\n\t\n\t// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n\t// length quantities we use in the source map spec, the first bit is the sign,\n\t// the next four bits are the actual value, and the 6th bit is the\n\t// continuation bit. The continuation bit tells us whether there are more\n\t// digits in this value following this digit.\n\t//\n\t// Continuation\n\t// | Sign\n\t// | |\n\t// V V\n\t// 101011\n\t\n\tvar VLQ_BASE_SHIFT = 5;\n\t\n\t// binary: 100000\n\tvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\t\n\t// binary: 011111\n\tvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\t\n\t// binary: 100000\n\tvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\t\n\t/**\n\t * Converts from a two-complement value to a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n\t * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n\t */\n\tfunction toVLQSigned(aValue) {\n\t return aValue < 0\n\t ? ((-aValue) << 1) + 1\n\t : (aValue << 1) + 0;\n\t}\n\t\n\t/**\n\t * Converts to a two-complement value from a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n\t * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n\t */\n\tfunction fromVLQSigned(aValue) {\n\t var isNegative = (aValue & 1) === 1;\n\t var shifted = aValue >> 1;\n\t return isNegative\n\t ? -shifted\n\t : shifted;\n\t}\n\t\n\t/**\n\t * Returns the base 64 VLQ encoded value.\n\t */\n\texports.encode = function base64VLQ_encode(aValue) {\n\t var encoded = \"\";\n\t var digit;\n\t\n\t var vlq = toVLQSigned(aValue);\n\t\n\t do {\n\t digit = vlq & VLQ_BASE_MASK;\n\t vlq >>>= VLQ_BASE_SHIFT;\n\t if (vlq > 0) {\n\t // There are still more digits in this value, so we must make sure the\n\t // continuation bit is marked.\n\t digit |= VLQ_CONTINUATION_BIT;\n\t }\n\t encoded += base64.encode(digit);\n\t } while (vlq > 0);\n\t\n\t return encoded;\n\t};\n\t\n\t/**\n\t * Decodes the next base 64 VLQ value from the given string and returns the\n\t * value and the rest of the string via the out parameter.\n\t */\n\texports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n\t var strLen = aStr.length;\n\t var result = 0;\n\t var shift = 0;\n\t var continuation, digit;\n\t\n\t do {\n\t if (aIndex >= strLen) {\n\t throw new Error(\"Expected more digits in base 64 VLQ value.\");\n\t }\n\t\n\t digit = base64.decode(aStr.charCodeAt(aIndex++));\n\t if (digit === -1) {\n\t throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n\t }\n\t\n\t continuation = !!(digit & VLQ_CONTINUATION_BIT);\n\t digit &= VLQ_BASE_MASK;\n\t result = result + (digit << shift);\n\t shift += VLQ_BASE_SHIFT;\n\t } while (continuation);\n\t\n\t aOutParam.value = fromVLQSigned(result);\n\t aOutParam.rest = aIndex;\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\t\n\t/**\n\t * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n\t */\n\texports.encode = function (number) {\n\t if (0 <= number && number < intToCharMap.length) {\n\t return intToCharMap[number];\n\t }\n\t throw new TypeError(\"Must be between 0 and 63: \" + number);\n\t};\n\t\n\t/**\n\t * Decode a single base 64 character code digit to an integer. Returns -1 on\n\t * failure.\n\t */\n\texports.decode = function (charCode) {\n\t var bigA = 65; // 'A'\n\t var bigZ = 90; // 'Z'\n\t\n\t var littleA = 97; // 'a'\n\t var littleZ = 122; // 'z'\n\t\n\t var zero = 48; // '0'\n\t var nine = 57; // '9'\n\t\n\t var plus = 43; // '+'\n\t var slash = 47; // '/'\n\t\n\t var littleOffset = 26;\n\t var numberOffset = 52;\n\t\n\t // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\t if (bigA <= charCode && charCode <= bigZ) {\n\t return (charCode - bigA);\n\t }\n\t\n\t // 26 - 51: abcdefghijklmnopqrstuvwxyz\n\t if (littleA <= charCode && charCode <= littleZ) {\n\t return (charCode - littleA + littleOffset);\n\t }\n\t\n\t // 52 - 61: 0123456789\n\t if (zero <= charCode && charCode <= nine) {\n\t return (charCode - zero + numberOffset);\n\t }\n\t\n\t // 62: +\n\t if (charCode == plus) {\n\t return 62;\n\t }\n\t\n\t // 63: /\n\t if (charCode == slash) {\n\t return 63;\n\t }\n\t\n\t // Invalid base64 digit.\n\t return -1;\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t/**\n\t * This is a helper function for getting values from parameter/options\n\t * objects.\n\t *\n\t * @param args The object we are extracting values from\n\t * @param name The name of the property we are getting.\n\t * @param defaultValue An optional value to return if the property is missing\n\t * from the object. If this is not specified and the property is missing, an\n\t * error will be thrown.\n\t */\n\tfunction getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}\n\texports.getArg = getArg;\n\t\n\tvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\n\tvar dataUrlRegexp = /^data:.+\\,.+$/;\n\t\n\tfunction urlParse(aUrl) {\n\t var match = aUrl.match(urlRegexp);\n\t if (!match) {\n\t return null;\n\t }\n\t return {\n\t scheme: match[1],\n\t auth: match[2],\n\t host: match[3],\n\t port: match[4],\n\t path: match[5]\n\t };\n\t}\n\texports.urlParse = urlParse;\n\t\n\tfunction urlGenerate(aParsedUrl) {\n\t var url = '';\n\t if (aParsedUrl.scheme) {\n\t url += aParsedUrl.scheme + ':';\n\t }\n\t url += '//';\n\t if (aParsedUrl.auth) {\n\t url += aParsedUrl.auth + '@';\n\t }\n\t if (aParsedUrl.host) {\n\t url += aParsedUrl.host;\n\t }\n\t if (aParsedUrl.port) {\n\t url += \":\" + aParsedUrl.port\n\t }\n\t if (aParsedUrl.path) {\n\t url += aParsedUrl.path;\n\t }\n\t return url;\n\t}\n\texports.urlGenerate = urlGenerate;\n\t\n\t/**\n\t * Normalizes a path, or the path portion of a URL:\n\t *\n\t * - Replaces consecutive slashes with one slash.\n\t * - Removes unnecessary '.' parts.\n\t * - Removes unnecessary '/..' parts.\n\t *\n\t * Based on code in the Node.js 'path' core module.\n\t *\n\t * @param aPath The path or url to normalize.\n\t */\n\tfunction normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}\n\texports.normalize = normalize;\n\t\n\t/**\n\t * Joins two paths/URLs.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be joined with the root.\n\t *\n\t * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n\t * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n\t * first.\n\t * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n\t * is updated with the result and aRoot is returned. Otherwise the result\n\t * is returned.\n\t * - If aPath is absolute, the result is aPath.\n\t * - Otherwise the two paths are joined with a slash.\n\t * - Joining for example 'http://' and 'www.example.com' is also supported.\n\t */\n\tfunction join(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t if (aPath === \"\") {\n\t aPath = \".\";\n\t }\n\t var aPathUrl = urlParse(aPath);\n\t var aRootUrl = urlParse(aRoot);\n\t if (aRootUrl) {\n\t aRoot = aRootUrl.path || '/';\n\t }\n\t\n\t // `join(foo, '//www.example.org')`\n\t if (aPathUrl && !aPathUrl.scheme) {\n\t if (aRootUrl) {\n\t aPathUrl.scheme = aRootUrl.scheme;\n\t }\n\t return urlGenerate(aPathUrl);\n\t }\n\t\n\t if (aPathUrl || aPath.match(dataUrlRegexp)) {\n\t return aPath;\n\t }\n\t\n\t // `join('http://', 'www.example.com')`\n\t if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n\t aRootUrl.host = aPath;\n\t return urlGenerate(aRootUrl);\n\t }\n\t\n\t var joined = aPath.charAt(0) === '/'\n\t ? aPath\n\t : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\t\n\t if (aRootUrl) {\n\t aRootUrl.path = joined;\n\t return urlGenerate(aRootUrl);\n\t }\n\t return joined;\n\t}\n\texports.join = join;\n\t\n\texports.isAbsolute = function (aPath) {\n\t return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n\t};\n\t\n\t/**\n\t * Make a path relative to a URL or another path.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be made relative to aRoot.\n\t */\n\tfunction relative(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t\n\t aRoot = aRoot.replace(/\\/$/, '');\n\t\n\t // It is possible for the path to be above the root. In this case, simply\n\t // checking whether the root is a prefix of the path won't work. Instead, we\n\t // need to remove components from the root one by one, until either we find\n\t // a prefix that fits, or we run out of components to remove.\n\t var level = 0;\n\t while (aPath.indexOf(aRoot + '/') !== 0) {\n\t var index = aRoot.lastIndexOf(\"/\");\n\t if (index < 0) {\n\t return aPath;\n\t }\n\t\n\t // If the only part of the root that is left is the scheme (i.e. http://,\n\t // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n\t // have exhausted all components, so the path is not relative to the root.\n\t aRoot = aRoot.slice(0, index);\n\t if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n\t return aPath;\n\t }\n\t\n\t ++level;\n\t }\n\t\n\t // Make sure we add a \"../\" for each component we removed from the root.\n\t return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n\t}\n\texports.relative = relative;\n\t\n\tvar supportsNullProto = (function () {\n\t var obj = Object.create(null);\n\t return !('__proto__' in obj);\n\t}());\n\t\n\tfunction identity (s) {\n\t return s;\n\t}\n\t\n\t/**\n\t * Because behavior goes wacky when you set `__proto__` on objects, we\n\t * have to prefix all the strings in our set with an arbitrary character.\n\t *\n\t * See https://github.com/mozilla/source-map/pull/31 and\n\t * https://github.com/mozilla/source-map/issues/30\n\t *\n\t * @param String aStr\n\t */\n\tfunction toSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return '$' + aStr;\n\t }\n\t\n\t return aStr;\n\t}\n\texports.toSetString = supportsNullProto ? identity : toSetString;\n\t\n\tfunction fromSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return aStr.slice(1);\n\t }\n\t\n\t return aStr;\n\t}\n\texports.fromSetString = supportsNullProto ? identity : fromSetString;\n\t\n\tfunction isProtoString(s) {\n\t if (!s) {\n\t return false;\n\t }\n\t\n\t var length = s.length;\n\t\n\t if (length < 9 /* \"__proto__\".length */) {\n\t return false;\n\t }\n\t\n\t if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n\t s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n\t s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n\t s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 9) !== 95 /* '_' */) {\n\t return false;\n\t }\n\t\n\t for (var i = length - 10; i >= 0; i--) {\n\t if (s.charCodeAt(i) !== 36 /* '$' */) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings where the original positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same original source/line/column, but different generated\n\t * line and column the same. Useful when searching for a mapping with a\n\t * stubbed out mapping.\n\t */\n\tfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n\t var cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0 || onlyCompareOriginal) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByOriginalPositions = compareByOriginalPositions;\n\t\n\t/**\n\t * Comparator between two mappings with deflated source and name indices where\n\t * the generated positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same generated line and column, but different\n\t * source/name/original line and column the same. Useful when searching for a\n\t * mapping with a stubbed out mapping.\n\t */\n\tfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0 || onlyCompareGenerated) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\t\n\tfunction strcmp(aStr1, aStr2) {\n\t if (aStr1 === aStr2) {\n\t return 0;\n\t }\n\t\n\t if (aStr1 === null) {\n\t return 1; // aStr2 !== null\n\t }\n\t\n\t if (aStr2 === null) {\n\t return -1; // aStr1 !== null\n\t }\n\t\n\t if (aStr1 > aStr2) {\n\t return 1;\n\t }\n\t\n\t return -1;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings with inflated source and name strings where\n\t * the generated positions are compared.\n\t */\n\tfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\t\n\t/**\n\t * Strip any JSON XSSI avoidance prefix from the string (as documented\n\t * in the source maps specification), and then parse the string as\n\t * JSON.\n\t */\n\tfunction parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}\n\texports.parseSourceMapInput = parseSourceMapInput;\n\t\n\t/**\n\t * Compute the URL of a source given the the source root, the source's\n\t * URL, and the source map's URL.\n\t */\n\tfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n\t sourceURL = sourceURL || '';\n\t\n\t if (sourceRoot) {\n\t // This follows what Chrome does.\n\t if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n\t sourceRoot += '/';\n\t }\n\t // The spec says:\n\t // Line 4: An optional source root, useful for relocating source\n\t // files on a server or removing repeated values in the\n\t // “sources” entry. This value is prepended to the individual\n\t // entries in the “source” field.\n\t sourceURL = sourceRoot + sourceURL;\n\t }\n\t\n\t // Historically, SourceMapConsumer did not take the sourceMapURL as\n\t // a parameter. This mode is still somewhat supported, which is why\n\t // this code block is conditional. However, it's preferable to pass\n\t // the source map URL to SourceMapConsumer, so that this function\n\t // can implement the source URL resolution algorithm as outlined in\n\t // the spec. This block is basically the equivalent of:\n\t // new URL(sourceURL, sourceMapURL).toString()\n\t // ... except it avoids using URL, which wasn't available in the\n\t // older releases of node still supported by this library.\n\t //\n\t // The spec says:\n\t // If the sources are not absolute URLs after prepending of the\n\t // “sourceRoot”, the sources are resolved relative to the\n\t // SourceMap (like resolving script src in a html document).\n\t if (sourceMapURL) {\n\t var parsed = urlParse(sourceMapURL);\n\t if (!parsed) {\n\t throw new Error(\"sourceMapURL could not be parsed\");\n\t }\n\t if (parsed.path) {\n\t // Strip the last path component, but keep the \"/\".\n\t var index = parsed.path.lastIndexOf('/');\n\t if (index >= 0) {\n\t parsed.path = parsed.path.substring(0, index + 1);\n\t }\n\t }\n\t sourceURL = join(urlGenerate(parsed), sourceURL);\n\t }\n\t\n\t return normalize(sourceURL);\n\t}\n\texports.computeSourceURL = computeSourceURL;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar hasNativeMap = typeof Map !== \"undefined\";\n\t\n\t/**\n\t * A data structure which is a combination of an array and a set. Adding a new\n\t * member is O(1), testing for membership is O(1), and finding the index of an\n\t * element is O(1). Removing elements from the set is not supported. Only\n\t * strings are supported for membership.\n\t */\n\tfunction ArraySet() {\n\t this._array = [];\n\t this._set = hasNativeMap ? new Map() : Object.create(null);\n\t}\n\t\n\t/**\n\t * Static method for creating ArraySet instances from an existing array.\n\t */\n\tArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n\t var set = new ArraySet();\n\t for (var i = 0, len = aArray.length; i < len; i++) {\n\t set.add(aArray[i], aAllowDuplicates);\n\t }\n\t return set;\n\t};\n\t\n\t/**\n\t * Return how many unique items are in this ArraySet. If duplicates have been\n\t * added, than those do not count towards the size.\n\t *\n\t * @returns Number\n\t */\n\tArraySet.prototype.size = function ArraySet_size() {\n\t return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n\t};\n\t\n\t/**\n\t * Add the given string to this set.\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n\t var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n\t var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n\t var idx = this._array.length;\n\t if (!isDuplicate || aAllowDuplicates) {\n\t this._array.push(aStr);\n\t }\n\t if (!isDuplicate) {\n\t if (hasNativeMap) {\n\t this._set.set(aStr, idx);\n\t } else {\n\t this._set[sStr] = idx;\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Is the given string a member of this set?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.has = function ArraySet_has(aStr) {\n\t if (hasNativeMap) {\n\t return this._set.has(aStr);\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t return has.call(this._set, sStr);\n\t }\n\t};\n\t\n\t/**\n\t * What is the index of the given string in the array?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n\t if (hasNativeMap) {\n\t var idx = this._set.get(aStr);\n\t if (idx >= 0) {\n\t return idx;\n\t }\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t if (has.call(this._set, sStr)) {\n\t return this._set[sStr];\n\t }\n\t }\n\t\n\t throw new Error('\"' + aStr + '\" is not in the set.');\n\t};\n\t\n\t/**\n\t * What is the element at the given index?\n\t *\n\t * @param Number aIdx\n\t */\n\tArraySet.prototype.at = function ArraySet_at(aIdx) {\n\t if (aIdx >= 0 && aIdx < this._array.length) {\n\t return this._array[aIdx];\n\t }\n\t throw new Error('No element indexed by ' + aIdx);\n\t};\n\t\n\t/**\n\t * Returns the array representation of this set (which has the proper indices\n\t * indicated by indexOf). Note that this is a copy of the internal array used\n\t * for storing the members so that no one can mess with internal state.\n\t */\n\tArraySet.prototype.toArray = function ArraySet_toArray() {\n\t return this._array.slice();\n\t};\n\t\n\texports.ArraySet = ArraySet;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2014 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\t\n\t/**\n\t * Determine whether mappingB is after mappingA with respect to generated\n\t * position.\n\t */\n\tfunction generatedPositionAfter(mappingA, mappingB) {\n\t // Optimized for most common case\n\t var lineA = mappingA.generatedLine;\n\t var lineB = mappingB.generatedLine;\n\t var columnA = mappingA.generatedColumn;\n\t var columnB = mappingB.generatedColumn;\n\t return lineB > lineA || lineB == lineA && columnB >= columnA ||\n\t util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n\t}\n\t\n\t/**\n\t * A data structure to provide a sorted view of accumulated mappings in a\n\t * performance conscious manner. It trades a neglibable overhead in general\n\t * case for a large speedup in case of mappings being added in order.\n\t */\n\tfunction MappingList() {\n\t this._array = [];\n\t this._sorted = true;\n\t // Serves as infimum\n\t this._last = {generatedLine: -1, generatedColumn: 0};\n\t}\n\t\n\t/**\n\t * Iterate through internal items. This method takes the same arguments that\n\t * `Array.prototype.forEach` takes.\n\t *\n\t * NOTE: The order of the mappings is NOT guaranteed.\n\t */\n\tMappingList.prototype.unsortedForEach =\n\t function MappingList_forEach(aCallback, aThisArg) {\n\t this._array.forEach(aCallback, aThisArg);\n\t };\n\t\n\t/**\n\t * Add the given source mapping.\n\t *\n\t * @param Object aMapping\n\t */\n\tMappingList.prototype.add = function MappingList_add(aMapping) {\n\t if (generatedPositionAfter(this._last, aMapping)) {\n\t this._last = aMapping;\n\t this._array.push(aMapping);\n\t } else {\n\t this._sorted = false;\n\t this._array.push(aMapping);\n\t }\n\t};\n\t\n\t/**\n\t * Returns the flat, sorted array of mappings. The mappings are sorted by\n\t * generated position.\n\t *\n\t * WARNING: This method returns internal data without copying, for\n\t * performance. The return value must NOT be mutated, and should be treated as\n\t * an immutable borrow. If you want to take ownership, you must make your own\n\t * copy.\n\t */\n\tMappingList.prototype.toArray = function MappingList_toArray() {\n\t if (!this._sorted) {\n\t this._array.sort(util.compareByGeneratedPositionsInflated);\n\t this._sorted = true;\n\t }\n\t return this._array;\n\t};\n\t\n\texports.MappingList = MappingList;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar binarySearch = __webpack_require__(8);\n\tvar ArraySet = __webpack_require__(5).ArraySet;\n\tvar base64VLQ = __webpack_require__(2);\n\tvar quickSort = __webpack_require__(9).quickSort;\n\t\n\tfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t return sourceMap.sections != null\n\t ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n\t : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n\t}\n\t\n\tSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n\t return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n\t}\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tSourceMapConsumer.prototype._version = 3;\n\t\n\t// `__generatedMappings` and `__originalMappings` are arrays that hold the\n\t// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n\t// are lazily instantiated, accessed via the `_generatedMappings` and\n\t// `_originalMappings` getters respectively, and we only parse the mappings\n\t// and create these arrays once queried for a source location. We jump through\n\t// these hoops because there can be many thousands of mappings, and parsing\n\t// them is expensive, so we only want to do it if we must.\n\t//\n\t// Each object in the arrays is of the form:\n\t//\n\t// {\n\t// generatedLine: The line number in the generated code,\n\t// generatedColumn: The column number in the generated code,\n\t// source: The path to the original source file that generated this\n\t// chunk of code,\n\t// originalLine: The line number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// originalColumn: The column number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// name: The name of the original symbol which generated this chunk of\n\t// code.\n\t// }\n\t//\n\t// All properties except for `generatedLine` and `generatedColumn` can be\n\t// `null`.\n\t//\n\t// `_generatedMappings` is ordered by the generated positions.\n\t//\n\t// `_originalMappings` is ordered by the original positions.\n\t\n\tSourceMapConsumer.prototype.__generatedMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__generatedMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__generatedMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype.__originalMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__originalMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__originalMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype._charIsMappingSeparator =\n\t function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n\t var c = aStr.charAt(index);\n\t return c === \";\" || c === \",\";\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t throw new Error(\"Subclasses must implement _parseMappings\");\n\t };\n\t\n\tSourceMapConsumer.GENERATED_ORDER = 1;\n\tSourceMapConsumer.ORIGINAL_ORDER = 2;\n\t\n\tSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\n\tSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Iterate over each mapping between an original source/line/column and a\n\t * generated line/column in this source map.\n\t *\n\t * @param Function aCallback\n\t * The function that is called with each mapping.\n\t * @param Object aContext\n\t * Optional. If specified, this object will be the value of `this` every\n\t * time that `aCallback` is called.\n\t * @param aOrder\n\t * Either `SourceMapConsumer.GENERATED_ORDER` or\n\t * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n\t * iterate over the mappings sorted by the generated file's line/column\n\t * order or the original's source/line/column order, respectively. Defaults to\n\t * `SourceMapConsumer.GENERATED_ORDER`.\n\t */\n\tSourceMapConsumer.prototype.eachMapping =\n\t function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n\t var context = aContext || null;\n\t var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\t\n\t var mappings;\n\t switch (order) {\n\t case SourceMapConsumer.GENERATED_ORDER:\n\t mappings = this._generatedMappings;\n\t break;\n\t case SourceMapConsumer.ORIGINAL_ORDER:\n\t mappings = this._originalMappings;\n\t break;\n\t default:\n\t throw new Error(\"Unknown order of iteration.\");\n\t }\n\t\n\t var sourceRoot = this.sourceRoot;\n\t mappings.map(function (mapping) {\n\t var source = mapping.source === null ? null : this._sources.at(mapping.source);\n\t source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n\t return {\n\t source: source,\n\t generatedLine: mapping.generatedLine,\n\t generatedColumn: mapping.generatedColumn,\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: mapping.name === null ? null : this._names.at(mapping.name)\n\t };\n\t }, this).forEach(aCallback, context);\n\t };\n\t\n\t/**\n\t * Returns all generated line and column information for the original source,\n\t * line, and column provided. If no column is provided, returns all mappings\n\t * corresponding to a either the line we are searching for or the next\n\t * closest line that has any mappings. Otherwise, returns all mappings\n\t * corresponding to the given line and either the column we are searching for\n\t * or the next closest column that has any offsets.\n\t *\n\t * The only argument is an object with the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number is 1-based.\n\t * - column: Optional. the column number in the original source.\n\t * The column number is 0-based.\n\t *\n\t * and an array of objects is returned, each with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tSourceMapConsumer.prototype.allGeneratedPositionsFor =\n\t function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n\t var line = util.getArg(aArgs, 'line');\n\t\n\t // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n\t // returns the index of the closest mapping less than the needle. By\n\t // setting needle.originalColumn to 0, we thus find the last mapping for\n\t // the given line, provided such a mapping exists.\n\t var needle = {\n\t source: util.getArg(aArgs, 'source'),\n\t originalLine: line,\n\t originalColumn: util.getArg(aArgs, 'column', 0)\n\t };\n\t\n\t needle.source = this._findSourceIndex(needle.source);\n\t if (needle.source < 0) {\n\t return [];\n\t }\n\t\n\t var mappings = [];\n\t\n\t var index = this._findMapping(needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t binarySearch.LEAST_UPPER_BOUND);\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (aArgs.column === undefined) {\n\t var originalLine = mapping.originalLine;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we found. Since\n\t // mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we found.\n\t while (mapping && mapping.originalLine === originalLine) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t } else {\n\t var originalColumn = mapping.originalColumn;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we were searching for.\n\t // Since mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we are searching for.\n\t while (mapping &&\n\t mapping.originalLine === line &&\n\t mapping.originalColumn == originalColumn) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t }\n\t }\n\t\n\t return mappings;\n\t };\n\t\n\texports.SourceMapConsumer = SourceMapConsumer;\n\t\n\t/**\n\t * A BasicSourceMapConsumer instance represents a parsed source map which we can\n\t * query for information about the original file positions by giving it a file\n\t * position in the generated source.\n\t *\n\t * The first parameter is the raw source map (either as a JSON string, or\n\t * already parsed to an object). According to the spec, source maps have the\n\t * following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - sources: An array of URLs to the original source files.\n\t * - names: An array of identifiers which can be referrenced by individual mappings.\n\t * - sourceRoot: Optional. The URL root from which all sources are relative.\n\t * - sourcesContent: Optional. An array of contents of the original source files.\n\t * - mappings: A string of base64 VLQs which contain the actual mappings.\n\t * - file: Optional. The generated file this source map is associated with.\n\t *\n\t * Here is an example source map, taken from the source map spec[0]:\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"out.js\",\n\t * sourceRoot : \"\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AA,AB;;ABCDE;\"\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n\t */\n\tfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sources = util.getArg(sourceMap, 'sources');\n\t // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n\t // requires the array) to play nice here.\n\t var names = util.getArg(sourceMap, 'names', []);\n\t var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n\t var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n\t var mappings = util.getArg(sourceMap, 'mappings');\n\t var file = util.getArg(sourceMap, 'file', null);\n\t\n\t // Once again, Sass deviates from the spec and supplies the version as a\n\t // string rather than a number, so we use loose equality checking here.\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t if (sourceRoot) {\n\t sourceRoot = util.normalize(sourceRoot);\n\t }\n\t\n\t sources = sources\n\t .map(String)\n\t // Some source maps produce relative source paths like \"./foo.js\" instead of\n\t // \"foo.js\". Normalize these first so that future comparisons will succeed.\n\t // See bugzil.la/1090768.\n\t .map(util.normalize)\n\t // Always ensure that absolute sources are internally stored relative to\n\t // the source root, if the source root is absolute. Not doing this would\n\t // be particularly problematic when the source root is a prefix of the\n\t // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n\t .map(function (source) {\n\t return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n\t ? util.relative(sourceRoot, source)\n\t : source;\n\t });\n\t\n\t // Pass `true` below to allow duplicate names and sources. While source maps\n\t // are intended to be compressed and deduplicated, the TypeScript compiler\n\t // sometimes generates source maps with duplicates in them. See Github issue\n\t // #72 and bugzil.la/889492.\n\t this._names = ArraySet.fromArray(names.map(String), true);\n\t this._sources = ArraySet.fromArray(sources, true);\n\t\n\t this._absoluteSources = this._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t this.sourceRoot = sourceRoot;\n\t this.sourcesContent = sourcesContent;\n\t this._mappings = mappings;\n\t this._sourceMapURL = aSourceMapURL;\n\t this.file = file;\n\t}\n\t\n\tBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\t\n\t/**\n\t * Utility function to find the index of a source. Returns -1 if not\n\t * found.\n\t */\n\tBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t if (this._sources.has(relativeSource)) {\n\t return this._sources.indexOf(relativeSource);\n\t }\n\t\n\t // Maybe aSource is an absolute URL as returned by |sources|. In\n\t // this case we can't simply undo the transform.\n\t var i;\n\t for (i = 0; i < this._absoluteSources.length; ++i) {\n\t if (this._absoluteSources[i] == aSource) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t};\n\t\n\t/**\n\t * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n\t *\n\t * @param SourceMapGenerator aSourceMap\n\t * The source map that will be consumed.\n\t * @param String aSourceMapURL\n\t * The URL at which the source map can be found (optional)\n\t * @returns BasicSourceMapConsumer\n\t */\n\tBasicSourceMapConsumer.fromSourceMap =\n\t function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n\t var smc = Object.create(BasicSourceMapConsumer.prototype);\n\t\n\t var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n\t var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n\t smc.sourceRoot = aSourceMap._sourceRoot;\n\t smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n\t smc.sourceRoot);\n\t smc.file = aSourceMap._file;\n\t smc._sourceMapURL = aSourceMapURL;\n\t smc._absoluteSources = smc._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t // Because we are modifying the entries (by converting string sources and\n\t // names to indices into the sources and names ArraySets), we have to make\n\t // a copy of the entry or else bad things happen. Shared mutable state\n\t // strikes again! See github issue #191.\n\t\n\t var generatedMappings = aSourceMap._mappings.toArray().slice();\n\t var destGeneratedMappings = smc.__generatedMappings = [];\n\t var destOriginalMappings = smc.__originalMappings = [];\n\t\n\t for (var i = 0, length = generatedMappings.length; i < length; i++) {\n\t var srcMapping = generatedMappings[i];\n\t var destMapping = new Mapping;\n\t destMapping.generatedLine = srcMapping.generatedLine;\n\t destMapping.generatedColumn = srcMapping.generatedColumn;\n\t\n\t if (srcMapping.source) {\n\t destMapping.source = sources.indexOf(srcMapping.source);\n\t destMapping.originalLine = srcMapping.originalLine;\n\t destMapping.originalColumn = srcMapping.originalColumn;\n\t\n\t if (srcMapping.name) {\n\t destMapping.name = names.indexOf(srcMapping.name);\n\t }\n\t\n\t destOriginalMappings.push(destMapping);\n\t }\n\t\n\t destGeneratedMappings.push(destMapping);\n\t }\n\t\n\t quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\t\n\t return smc;\n\t };\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tBasicSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t return this._absoluteSources.slice();\n\t }\n\t});\n\t\n\t/**\n\t * Provide the JIT with a nice shape / hidden class.\n\t */\n\tfunction Mapping() {\n\t this.generatedLine = 0;\n\t this.generatedColumn = 0;\n\t this.source = null;\n\t this.originalLine = null;\n\t this.originalColumn = null;\n\t this.name = null;\n\t}\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tBasicSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t var generatedLine = 1;\n\t var previousGeneratedColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousOriginalColumn = 0;\n\t var previousSource = 0;\n\t var previousName = 0;\n\t var length = aStr.length;\n\t var index = 0;\n\t var cachedSegments = {};\n\t var temp = {};\n\t var originalMappings = [];\n\t var generatedMappings = [];\n\t var mapping, str, segment, end, value;\n\t\n\t while (index < length) {\n\t if (aStr.charAt(index) === ';') {\n\t generatedLine++;\n\t index++;\n\t previousGeneratedColumn = 0;\n\t }\n\t else if (aStr.charAt(index) === ',') {\n\t index++;\n\t }\n\t else {\n\t mapping = new Mapping();\n\t mapping.generatedLine = generatedLine;\n\t\n\t // Because each offset is encoded relative to the previous one,\n\t // many segments often have the same encoding. We can exploit this\n\t // fact by caching the parsed variable length fields of each segment,\n\t // allowing us to avoid a second parse if we encounter the same\n\t // segment again.\n\t for (end = index; end < length; end++) {\n\t if (this._charIsMappingSeparator(aStr, end)) {\n\t break;\n\t }\n\t }\n\t str = aStr.slice(index, end);\n\t\n\t segment = cachedSegments[str];\n\t if (segment) {\n\t index += str.length;\n\t } else {\n\t segment = [];\n\t while (index < end) {\n\t base64VLQ.decode(aStr, index, temp);\n\t value = temp.value;\n\t index = temp.rest;\n\t segment.push(value);\n\t }\n\t\n\t if (segment.length === 2) {\n\t throw new Error('Found a source, but no line and column');\n\t }\n\t\n\t if (segment.length === 3) {\n\t throw new Error('Found a source and line, but no column');\n\t }\n\t\n\t cachedSegments[str] = segment;\n\t }\n\t\n\t // Generated column.\n\t mapping.generatedColumn = previousGeneratedColumn + segment[0];\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (segment.length > 1) {\n\t // Original source.\n\t mapping.source = previousSource + segment[1];\n\t previousSource += segment[1];\n\t\n\t // Original line.\n\t mapping.originalLine = previousOriginalLine + segment[2];\n\t previousOriginalLine = mapping.originalLine;\n\t // Lines are stored 0-based\n\t mapping.originalLine += 1;\n\t\n\t // Original column.\n\t mapping.originalColumn = previousOriginalColumn + segment[3];\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (segment.length > 4) {\n\t // Original name.\n\t mapping.name = previousName + segment[4];\n\t previousName += segment[4];\n\t }\n\t }\n\t\n\t generatedMappings.push(mapping);\n\t if (typeof mapping.originalLine === 'number') {\n\t originalMappings.push(mapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t this.__generatedMappings = generatedMappings;\n\t\n\t quickSort(originalMappings, util.compareByOriginalPositions);\n\t this.__originalMappings = originalMappings;\n\t };\n\t\n\t/**\n\t * Find the mapping that best matches the hypothetical \"needle\" mapping that\n\t * we are searching for in the given \"haystack\" of mappings.\n\t */\n\tBasicSourceMapConsumer.prototype._findMapping =\n\t function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n\t aColumnName, aComparator, aBias) {\n\t // To return the position we are searching for, we must first find the\n\t // mapping for the given position and then return the opposite position it\n\t // points to. Because the mappings are sorted, we can use binary search to\n\t // find the best mapping.\n\t\n\t if (aNeedle[aLineName] <= 0) {\n\t throw new TypeError('Line must be greater than or equal to 1, got '\n\t + aNeedle[aLineName]);\n\t }\n\t if (aNeedle[aColumnName] < 0) {\n\t throw new TypeError('Column must be greater than or equal to 0, got '\n\t + aNeedle[aColumnName]);\n\t }\n\t\n\t return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n\t };\n\t\n\t/**\n\t * Compute the last column for each generated mapping. The last column is\n\t * inclusive.\n\t */\n\tBasicSourceMapConsumer.prototype.computeColumnSpans =\n\t function SourceMapConsumer_computeColumnSpans() {\n\t for (var index = 0; index < this._generatedMappings.length; ++index) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t // Mappings do not contain a field for the last generated columnt. We\n\t // can come up with an optimistic estimate, however, by assuming that\n\t // mappings are contiguous (i.e. given two consecutive mappings, the\n\t // first mapping ends where the second one starts).\n\t if (index + 1 < this._generatedMappings.length) {\n\t var nextMapping = this._generatedMappings[index + 1];\n\t\n\t if (mapping.generatedLine === nextMapping.generatedLine) {\n\t mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n\t continue;\n\t }\n\t }\n\t\n\t // The last mapping for each line spans the entire line.\n\t mapping.lastGeneratedColumn = Infinity;\n\t }\n\t };\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tBasicSourceMapConsumer.prototype.originalPositionFor =\n\t function SourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._generatedMappings,\n\t \"generatedLine\",\n\t \"generatedColumn\",\n\t util.compareByGeneratedPositionsDeflated,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t if (mapping.generatedLine === needle.generatedLine) {\n\t var source = util.getArg(mapping, 'source', null);\n\t if (source !== null) {\n\t source = this._sources.at(source);\n\t source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n\t }\n\t var name = util.getArg(mapping, 'name', null);\n\t if (name !== null) {\n\t name = this._names.at(name);\n\t }\n\t return {\n\t source: source,\n\t line: util.getArg(mapping, 'originalLine', null),\n\t column: util.getArg(mapping, 'originalColumn', null),\n\t name: name\n\t };\n\t }\n\t }\n\t\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function BasicSourceMapConsumer_hasContentsOfAllSources() {\n\t if (!this.sourcesContent) {\n\t return false;\n\t }\n\t return this.sourcesContent.length >= this._sources.size() &&\n\t !this.sourcesContent.some(function (sc) { return sc == null; });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tBasicSourceMapConsumer.prototype.sourceContentFor =\n\t function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t if (!this.sourcesContent) {\n\t return null;\n\t }\n\t\n\t var index = this._findSourceIndex(aSource);\n\t if (index >= 0) {\n\t return this.sourcesContent[index];\n\t }\n\t\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t var url;\n\t if (this.sourceRoot != null\n\t && (url = util.urlParse(this.sourceRoot))) {\n\t // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n\t // many users. We can help them out when they expect file:// URIs to\n\t // behave like it would if they were running a local HTTP server. See\n\t // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n\t var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n\t if (url.scheme == \"file\"\n\t && this._sources.has(fileUriAbsPath)) {\n\t return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n\t }\n\t\n\t if ((!url.path || url.path == \"/\")\n\t && this._sources.has(\"/\" + relativeSource)) {\n\t return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n\t }\n\t }\n\t\n\t // This function is used recursively from\n\t // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n\t // don't want to throw if we can't find the source - we just want to\n\t // return null, so we provide a flag to exit gracefully.\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tBasicSourceMapConsumer.prototype.generatedPositionFor =\n\t function SourceMapConsumer_generatedPositionFor(aArgs) {\n\t var source = util.getArg(aArgs, 'source');\n\t source = this._findSourceIndex(source);\n\t if (source < 0) {\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t }\n\t\n\t var needle = {\n\t source: source,\n\t originalLine: util.getArg(aArgs, 'line'),\n\t originalColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (mapping.source === needle.source) {\n\t return {\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t };\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t };\n\t\n\texports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\t\n\t/**\n\t * An IndexedSourceMapConsumer instance represents a parsed source map which\n\t * we can query for information. It differs from BasicSourceMapConsumer in\n\t * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n\t * input.\n\t *\n\t * The first parameter is a raw source map (either as a JSON string, or already\n\t * parsed to an object). According to the spec for indexed source maps, they\n\t * have the following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - file: Optional. The generated file this source map is associated with.\n\t * - sections: A list of section definitions.\n\t *\n\t * Each value under the \"sections\" field has two fields:\n\t * - offset: The offset into the original specified at which this section\n\t * begins to apply, defined as an object with a \"line\" and \"column\"\n\t * field.\n\t * - map: A source map definition. This source map could also be indexed,\n\t * but doesn't have to be.\n\t *\n\t * Instead of the \"map\" field, it's also possible to have a \"url\" field\n\t * specifying a URL to retrieve a source map from, but that's currently\n\t * unsupported.\n\t *\n\t * Here's an example source map, taken from the source map spec[0], but\n\t * modified to omit a section which uses the \"url\" field.\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"app.js\",\n\t * sections: [{\n\t * offset: {line:100, column:10},\n\t * map: {\n\t * version : 3,\n\t * file: \"section.js\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AAAA,E;;ABCDE;\"\n\t * }\n\t * }],\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n\t */\n\tfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sections = util.getArg(sourceMap, 'sections');\n\t\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t this._sources = new ArraySet();\n\t this._names = new ArraySet();\n\t\n\t var lastOffset = {\n\t line: -1,\n\t column: 0\n\t };\n\t this._sections = sections.map(function (s) {\n\t if (s.url) {\n\t // The url field will require support for asynchronicity.\n\t // See https://github.com/mozilla/source-map/issues/16\n\t throw new Error('Support for url field in sections not implemented.');\n\t }\n\t var offset = util.getArg(s, 'offset');\n\t var offsetLine = util.getArg(offset, 'line');\n\t var offsetColumn = util.getArg(offset, 'column');\n\t\n\t if (offsetLine < lastOffset.line ||\n\t (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n\t throw new Error('Section offsets must be ordered and non-overlapping.');\n\t }\n\t lastOffset = offset;\n\t\n\t return {\n\t generatedOffset: {\n\t // The offset fields are 0-based, but we use 1-based indices when\n\t // encoding/decoding from VLQ.\n\t generatedLine: offsetLine + 1,\n\t generatedColumn: offsetColumn + 1\n\t },\n\t consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n\t }\n\t });\n\t}\n\t\n\tIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tIndexedSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t var sources = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n\t sources.push(this._sections[i].consumer.sources[j]);\n\t }\n\t }\n\t return sources;\n\t }\n\t});\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tIndexedSourceMapConsumer.prototype.originalPositionFor =\n\t function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t // Find the section containing the generated position we're trying to map\n\t // to an original position.\n\t var sectionIndex = binarySearch.search(needle, this._sections,\n\t function(needle, section) {\n\t var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n\t if (cmp) {\n\t return cmp;\n\t }\n\t\n\t return (needle.generatedColumn -\n\t section.generatedOffset.generatedColumn);\n\t });\n\t var section = this._sections[sectionIndex];\n\t\n\t if (!section) {\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t }\n\t\n\t return section.consumer.originalPositionFor({\n\t line: needle.generatedLine -\n\t (section.generatedOffset.generatedLine - 1),\n\t column: needle.generatedColumn -\n\t (section.generatedOffset.generatedLine === needle.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t bias: aArgs.bias\n\t });\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n\t return this._sections.every(function (s) {\n\t return s.consumer.hasContentsOfAllSources();\n\t });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tIndexedSourceMapConsumer.prototype.sourceContentFor =\n\t function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t var content = section.consumer.sourceContentFor(aSource, true);\n\t if (content) {\n\t return content;\n\t }\n\t }\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based. \n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tIndexedSourceMapConsumer.prototype.generatedPositionFor =\n\t function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t // Only consider this section if the requested source is in the list of\n\t // sources of the consumer.\n\t if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n\t continue;\n\t }\n\t var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n\t if (generatedPosition) {\n\t var ret = {\n\t line: generatedPosition.line +\n\t (section.generatedOffset.generatedLine - 1),\n\t column: generatedPosition.column +\n\t (section.generatedOffset.generatedLine === generatedPosition.line\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0)\n\t };\n\t return ret;\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null\n\t };\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tIndexedSourceMapConsumer.prototype._parseMappings =\n\t function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t this.__generatedMappings = [];\n\t this.__originalMappings = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t var sectionMappings = section.consumer._generatedMappings;\n\t for (var j = 0; j < sectionMappings.length; j++) {\n\t var mapping = sectionMappings[j];\n\t\n\t var source = section.consumer._sources.at(mapping.source);\n\t source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n\t this._sources.add(source);\n\t source = this._sources.indexOf(source);\n\t\n\t var name = null;\n\t if (mapping.name) {\n\t name = section.consumer._names.at(mapping.name);\n\t this._names.add(name);\n\t name = this._names.indexOf(name);\n\t }\n\t\n\t // The mappings coming from the consumer for the section have\n\t // generated positions relative to the start of the section, so we\n\t // need to offset them to be relative to the start of the concatenated\n\t // generated file.\n\t var adjustedMapping = {\n\t source: source,\n\t generatedLine: mapping.generatedLine +\n\t (section.generatedOffset.generatedLine - 1),\n\t generatedColumn: mapping.generatedColumn +\n\t (section.generatedOffset.generatedLine === mapping.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: name\n\t };\n\t\n\t this.__generatedMappings.push(adjustedMapping);\n\t if (typeof adjustedMapping.originalLine === 'number') {\n\t this.__originalMappings.push(adjustedMapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t quickSort(this.__originalMappings, util.compareByOriginalPositions);\n\t };\n\t\n\texports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\texports.GREATEST_LOWER_BOUND = 1;\n\texports.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Recursive implementation of binary search.\n\t *\n\t * @param aLow Indices here and lower do not contain the needle.\n\t * @param aHigh Indices here and higher do not contain the needle.\n\t * @param aNeedle The element being searched for.\n\t * @param aHaystack The non-empty array being searched.\n\t * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t */\n\tfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n\t // This function terminates when one of the following is true:\n\t //\n\t // 1. We find the exact element we are looking for.\n\t //\n\t // 2. We did not find the exact element, but we can return the index of\n\t // the next-closest element.\n\t //\n\t // 3. We did not find the exact element, and there is no next-closest\n\t // element than the one we are searching for, so we return -1.\n\t var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n\t var cmp = aCompare(aNeedle, aHaystack[mid], true);\n\t if (cmp === 0) {\n\t // Found the element we are looking for.\n\t return mid;\n\t }\n\t else if (cmp > 0) {\n\t // Our needle is greater than aHaystack[mid].\n\t if (aHigh - mid > 1) {\n\t // The element is in the upper half.\n\t return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // The exact needle element was not found in this haystack. Determine if\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return aHigh < aHaystack.length ? aHigh : -1;\n\t } else {\n\t return mid;\n\t }\n\t }\n\t else {\n\t // Our needle is less than aHaystack[mid].\n\t if (mid - aLow > 1) {\n\t // The element is in the lower half.\n\t return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return mid;\n\t } else {\n\t return aLow < 0 ? -1 : aLow;\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * This is an implementation of binary search which will always try and return\n\t * the index of the closest element if there is no exact hit. This is because\n\t * mappings between original and generated line/col pairs are single points,\n\t * and there is an implicit region between each of them, so a miss just means\n\t * that you aren't on the very start of a region.\n\t *\n\t * @param aNeedle The element you are looking for.\n\t * @param aHaystack The array that is being searched.\n\t * @param aCompare A function which takes the needle and an element in the\n\t * array and returns -1, 0, or 1 depending on whether the needle is less\n\t * than, equal to, or greater than the element, respectively.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n\t */\n\texports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n\t if (aHaystack.length === 0) {\n\t return -1;\n\t }\n\t\n\t var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n\t aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n\t if (index < 0) {\n\t return -1;\n\t }\n\t\n\t // We have found either the exact element, or the next-closest element than\n\t // the one we are searching for. However, there may be more than one such\n\t // element. Make sure we always return the smallest of these.\n\t while (index - 1 >= 0) {\n\t if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n\t break;\n\t }\n\t --index;\n\t }\n\t\n\t return index;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t// It turns out that some (most?) JavaScript engines don't self-host\n\t// `Array.prototype.sort`. This makes sense because C++ will likely remain\n\t// faster than JS when doing raw CPU-intensive sorting. However, when using a\n\t// custom comparator function, calling back and forth between the VM's C++ and\n\t// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n\t// worse generated code for the comparator function than would be optimal. In\n\t// fact, when sorting with a comparator, these costs outweigh the benefits of\n\t// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n\t// a ~3500ms mean speed-up in `bench/bench.html`.\n\t\n\t/**\n\t * Swap the elements indexed by `x` and `y` in the array `ary`.\n\t *\n\t * @param {Array} ary\n\t * The array.\n\t * @param {Number} x\n\t * The index of the first item.\n\t * @param {Number} y\n\t * The index of the second item.\n\t */\n\tfunction swap(ary, x, y) {\n\t var temp = ary[x];\n\t ary[x] = ary[y];\n\t ary[y] = temp;\n\t}\n\t\n\t/**\n\t * Returns a random integer within the range `low .. high` inclusive.\n\t *\n\t * @param {Number} low\n\t * The lower bound on the range.\n\t * @param {Number} high\n\t * The upper bound on the range.\n\t */\n\tfunction randomIntInRange(low, high) {\n\t return Math.round(low + (Math.random() * (high - low)));\n\t}\n\t\n\t/**\n\t * The Quick Sort algorithm.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t * @param {Number} p\n\t * Start index of the array\n\t * @param {Number} r\n\t * End index of the array\n\t */\n\tfunction doQuickSort(ary, comparator, p, r) {\n\t // If our lower bound is less than our upper bound, we (1) partition the\n\t // array into two pieces and (2) recurse on each half. If it is not, this is\n\t // the empty array and our base case.\n\t\n\t if (p < r) {\n\t // (1) Partitioning.\n\t //\n\t // The partitioning chooses a pivot between `p` and `r` and moves all\n\t // elements that are less than or equal to the pivot to the before it, and\n\t // all the elements that are greater than it after it. The effect is that\n\t // once partition is done, the pivot is in the exact place it will be when\n\t // the array is put in sorted order, and it will not need to be moved\n\t // again. This runs in O(n) time.\n\t\n\t // Always choose a random pivot so that an input array which is reverse\n\t // sorted does not cause O(n^2) running time.\n\t var pivotIndex = randomIntInRange(p, r);\n\t var i = p - 1;\n\t\n\t swap(ary, pivotIndex, r);\n\t var pivot = ary[r];\n\t\n\t // Immediately after `j` is incremented in this loop, the following hold\n\t // true:\n\t //\n\t // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n\t //\n\t // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n\t for (var j = p; j < r; j++) {\n\t if (comparator(ary[j], pivot) <= 0) {\n\t i += 1;\n\t swap(ary, i, j);\n\t }\n\t }\n\t\n\t swap(ary, i + 1, j);\n\t var q = i + 1;\n\t\n\t // (2) Recurse on each half.\n\t\n\t doQuickSort(ary, comparator, p, q - 1);\n\t doQuickSort(ary, comparator, q + 1, r);\n\t }\n\t}\n\t\n\t/**\n\t * Sort the given array in-place with the given comparator function.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t */\n\texports.quickSort = function (ary, comparator) {\n\t doQuickSort(ary, comparator, 0, ary.length - 1);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;\n\tvar util = __webpack_require__(4);\n\t\n\t// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n\t// operating systems these days (capturing the result).\n\tvar REGEX_NEWLINE = /(\\r?\\n)/;\n\t\n\t// Newline character code for charCodeAt() comparisons\n\tvar NEWLINE_CODE = 10;\n\t\n\t// Private symbol for identifying `SourceNode`s when multiple versions of\n\t// the source-map library are loaded. This MUST NOT CHANGE across\n\t// versions!\n\tvar isSourceNode = \"$$$isSourceNode$$$\";\n\t\n\t/**\n\t * SourceNodes provide a way to abstract over interpolating/concatenating\n\t * snippets of generated JavaScript source code while maintaining the line and\n\t * column information associated with the original source code.\n\t *\n\t * @param aLine The original line number.\n\t * @param aColumn The original column number.\n\t * @param aSource The original source's filename.\n\t * @param aChunks Optional. An array of strings which are snippets of\n\t * generated JS, or other SourceNodes.\n\t * @param aName The original identifier.\n\t */\n\tfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n\t this.children = [];\n\t this.sourceContents = {};\n\t this.line = aLine == null ? null : aLine;\n\t this.column = aColumn == null ? null : aColumn;\n\t this.source = aSource == null ? null : aSource;\n\t this.name = aName == null ? null : aName;\n\t this[isSourceNode] = true;\n\t if (aChunks != null) this.add(aChunks);\n\t}\n\t\n\t/**\n\t * Creates a SourceNode from generated code and a SourceMapConsumer.\n\t *\n\t * @param aGeneratedCode The generated code\n\t * @param aSourceMapConsumer The SourceMap for the generated code\n\t * @param aRelativePath Optional. The path that relative sources in the\n\t * SourceMapConsumer should be relative to.\n\t */\n\tSourceNode.fromStringWithSourceMap =\n\t function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n\t // The SourceNode we want to fill with the generated code\n\t // and the SourceMap\n\t var node = new SourceNode();\n\t\n\t // All even indices of this array are one line of the generated code,\n\t // while all odd indices are the newlines between two adjacent lines\n\t // (since `REGEX_NEWLINE` captures its match).\n\t // Processed fragments are accessed by calling `shiftNextLine`.\n\t var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n\t var remainingLinesIndex = 0;\n\t var shiftNextLine = function() {\n\t var lineContents = getNextLine();\n\t // The last line of a file might not have a newline.\n\t var newLine = getNextLine() || \"\";\n\t return lineContents + newLine;\n\t\n\t function getNextLine() {\n\t return remainingLinesIndex < remainingLines.length ?\n\t remainingLines[remainingLinesIndex++] : undefined;\n\t }\n\t };\n\t\n\t // We need to remember the position of \"remainingLines\"\n\t var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\t\n\t // The generate SourceNodes we need a code range.\n\t // To extract it current and last mapping is used.\n\t // Here we store the last mapping.\n\t var lastMapping = null;\n\t\n\t aSourceMapConsumer.eachMapping(function (mapping) {\n\t if (lastMapping !== null) {\n\t // We add the code from \"lastMapping\" to \"mapping\":\n\t // First check if there is a new line in between.\n\t if (lastGeneratedLine < mapping.generatedLine) {\n\t // Associate first line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t lastGeneratedLine++;\n\t lastGeneratedColumn = 0;\n\t // The remaining code is added without mapping\n\t } else {\n\t // There is no new line in between.\n\t // Associate the code between \"lastGeneratedColumn\" and\n\t // \"mapping.generatedColumn\" with \"lastMapping\"\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t var code = nextLine.substr(0, mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t addMappingWithCode(lastMapping, code);\n\t // No more remaining code, continue\n\t lastMapping = mapping;\n\t return;\n\t }\n\t }\n\t // We add the generated code until the first mapping\n\t // to the SourceNode without any mapping.\n\t // Each line is added as separate string.\n\t while (lastGeneratedLine < mapping.generatedLine) {\n\t node.add(shiftNextLine());\n\t lastGeneratedLine++;\n\t }\n\t if (lastGeneratedColumn < mapping.generatedColumn) {\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t node.add(nextLine.substr(0, mapping.generatedColumn));\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t }\n\t lastMapping = mapping;\n\t }, this);\n\t // We have processed all mappings.\n\t if (remainingLinesIndex < remainingLines.length) {\n\t if (lastMapping) {\n\t // Associate the remaining code in the current line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t }\n\t // and add the remaining lines without any mapping\n\t node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n\t }\n\t\n\t // Copy sourcesContent into SourceNode\n\t aSourceMapConsumer.sources.forEach(function (sourceFile) {\n\t var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\t if (content != null) {\n\t if (aRelativePath != null) {\n\t sourceFile = util.join(aRelativePath, sourceFile);\n\t }\n\t node.setSourceContent(sourceFile, content);\n\t }\n\t });\n\t\n\t return node;\n\t\n\t function addMappingWithCode(mapping, code) {\n\t if (mapping === null || mapping.source === undefined) {\n\t node.add(code);\n\t } else {\n\t var source = aRelativePath\n\t ? util.join(aRelativePath, mapping.source)\n\t : mapping.source;\n\t node.add(new SourceNode(mapping.originalLine,\n\t mapping.originalColumn,\n\t source,\n\t code,\n\t mapping.name));\n\t }\n\t }\n\t };\n\t\n\t/**\n\t * Add a chunk of generated JS to this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.add = function SourceNode_add(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t aChunk.forEach(function (chunk) {\n\t this.add(chunk);\n\t }, this);\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t if (aChunk) {\n\t this.children.push(aChunk);\n\t }\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a chunk of generated JS to the beginning of this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t for (var i = aChunk.length-1; i >= 0; i--) {\n\t this.prepend(aChunk[i]);\n\t }\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t this.children.unshift(aChunk);\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Walk over the tree of JS snippets in this node and its children. The\n\t * walking function is called once for each snippet of JS and is passed that\n\t * snippet and the its original associated source's line/column location.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n\t var chunk;\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t chunk = this.children[i];\n\t if (chunk[isSourceNode]) {\n\t chunk.walk(aFn);\n\t }\n\t else {\n\t if (chunk !== '') {\n\t aFn(chunk, { source: this.source,\n\t line: this.line,\n\t column: this.column,\n\t name: this.name });\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n\t * each of `this.children`.\n\t *\n\t * @param aSep The separator.\n\t */\n\tSourceNode.prototype.join = function SourceNode_join(aSep) {\n\t var newChildren;\n\t var i;\n\t var len = this.children.length;\n\t if (len > 0) {\n\t newChildren = [];\n\t for (i = 0; i < len-1; i++) {\n\t newChildren.push(this.children[i]);\n\t newChildren.push(aSep);\n\t }\n\t newChildren.push(this.children[i]);\n\t this.children = newChildren;\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Call String.prototype.replace on the very right-most source snippet. Useful\n\t * for trimming whitespace from the end of a source node, etc.\n\t *\n\t * @param aPattern The pattern to replace.\n\t * @param aReplacement The thing to replace the pattern with.\n\t */\n\tSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n\t var lastChild = this.children[this.children.length - 1];\n\t if (lastChild[isSourceNode]) {\n\t lastChild.replaceRight(aPattern, aReplacement);\n\t }\n\t else if (typeof lastChild === 'string') {\n\t this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n\t }\n\t else {\n\t this.children.push(''.replace(aPattern, aReplacement));\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Set the source content for a source file. This will be added to the SourceMapGenerator\n\t * in the sourcesContent field.\n\t *\n\t * @param aSourceFile The filename of the source file\n\t * @param aSourceContent The content of the source file\n\t */\n\tSourceNode.prototype.setSourceContent =\n\t function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n\t this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n\t };\n\t\n\t/**\n\t * Walk over the tree of SourceNodes. The walking function is called for each\n\t * source file content and is passed the filename and source content.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walkSourceContents =\n\t function SourceNode_walkSourceContents(aFn) {\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t if (this.children[i][isSourceNode]) {\n\t this.children[i].walkSourceContents(aFn);\n\t }\n\t }\n\t\n\t var sources = Object.keys(this.sourceContents);\n\t for (var i = 0, len = sources.length; i < len; i++) {\n\t aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n\t }\n\t };\n\t\n\t/**\n\t * Return the string representation of this source node. Walks over the tree\n\t * and concatenates all the various snippets together to one string.\n\t */\n\tSourceNode.prototype.toString = function SourceNode_toString() {\n\t var str = \"\";\n\t this.walk(function (chunk) {\n\t str += chunk;\n\t });\n\t return str;\n\t};\n\t\n\t/**\n\t * Returns the string representation of this source node along with a source\n\t * map.\n\t */\n\tSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n\t var generated = {\n\t code: \"\",\n\t line: 1,\n\t column: 0\n\t };\n\t var map = new SourceMapGenerator(aArgs);\n\t var sourceMappingActive = false;\n\t var lastOriginalSource = null;\n\t var lastOriginalLine = null;\n\t var lastOriginalColumn = null;\n\t var lastOriginalName = null;\n\t this.walk(function (chunk, original) {\n\t generated.code += chunk;\n\t if (original.source !== null\n\t && original.line !== null\n\t && original.column !== null) {\n\t if(lastOriginalSource !== original.source\n\t || lastOriginalLine !== original.line\n\t || lastOriginalColumn !== original.column\n\t || lastOriginalName !== original.name) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t lastOriginalSource = original.source;\n\t lastOriginalLine = original.line;\n\t lastOriginalColumn = original.column;\n\t lastOriginalName = original.name;\n\t sourceMappingActive = true;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t }\n\t });\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t }\n\t for (var idx = 0, length = chunk.length; idx < length; idx++) {\n\t if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n\t generated.line++;\n\t generated.column = 0;\n\t // Mappings end at eol\n\t if (idx + 1 === length) {\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t } else {\n\t generated.column++;\n\t }\n\t }\n\t });\n\t this.walkSourceContents(function (sourceFile, sourceContent) {\n\t map.setSourceContent(sourceFile, sourceContent);\n\t });\n\t\n\t return { code: generated.code, map: map };\n\t};\n\t\n\texports.SourceNode = SourceNode;\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// source-map.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0fd5815da764db5fb9fe","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./source-map.js\n// module id = 0\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-generator.js\n// module id = 1\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64-vlq.js\n// module id = 2\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64.js\n// module id = 3\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/util.js\n// module id = 4\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/array-set.js\n// module id = 5\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/mapping-list.js\n// module id = 6\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\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 Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\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 */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\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. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\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. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\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 */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\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. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\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. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\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 */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\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. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-consumer.js\n// module id = 7\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.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 */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.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 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/binary-search.js\n// module id = 8\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/quick-sort.js\n// module id = 9\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-node.js\n// module id = 10\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/tools/node_modules/terser/node_modules/source-map/lib/array-set.js b/tools/node_modules/terser/node_modules/source-map/lib/array-set.js new file mode 100644 index 000000000000..fbd5c81cae66 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/array-set.js @@ -0,0 +1,121 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/base64-vlq.js b/tools/node_modules/terser/node_modules/source-map/lib/base64-vlq.js new file mode 100644 index 000000000000..612b404018ec --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/base64.js b/tools/node_modules/terser/node_modules/source-map/lib/base64.js new file mode 100644 index 000000000000..8aa86b302643 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/binary-search.js b/tools/node_modules/terser/node_modules/source-map/lib/binary-search.js new file mode 100644 index 000000000000..010ac941e156 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/mapping-list.js b/tools/node_modules/terser/node_modules/source-map/lib/mapping-list.js new file mode 100644 index 000000000000..06d1274a025a --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/quick-sort.js b/tools/node_modules/terser/node_modules/source-map/lib/quick-sort.js new file mode 100644 index 000000000000..6a7caadbbdbe --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/quick-sort.js @@ -0,0 +1,114 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ +exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); +}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js b/tools/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js new file mode 100644 index 000000000000..7b99d1da7fea --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js @@ -0,0 +1,1145 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/source-map-generator.js b/tools/node_modules/terser/node_modules/source-map/lib/source-map-generator.js new file mode 100644 index 000000000000..508bcfbbc936 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/source-map-generator.js @@ -0,0 +1,425 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/source-node.js b/tools/node_modules/terser/node_modules/source-map/lib/source-node.js new file mode 100644 index 000000000000..8bcdbe385d2c --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/source-node.js @@ -0,0 +1,413 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/util.js b/tools/node_modules/terser/node_modules/source-map/lib/util.js new file mode 100644 index 000000000000..3ca92e56f2a8 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/lib/util.js @@ -0,0 +1,488 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +} +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} +exports.parseSourceMapInput = parseSourceMapInput; + +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} +exports.computeSourceURL = computeSourceURL; diff --git a/tools/node_modules/terser/node_modules/source-map/package.json b/tools/node_modules/terser/node_modules/source-map/package.json new file mode 100644 index 000000000000..d02410f9109e --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/package.json @@ -0,0 +1,212 @@ +{ + "_from": "source-map@~0.6.1", + "_id": "source-map@0.6.1", + "_inBundle": false, + "_integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "_location": "/terser/source-map", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "source-map@~0.6.1", + "name": "source-map", + "escapedName": "source-map", + "rawSpec": "~0.6.1", + "saveSpec": null, + "fetchSpec": "~0.6.1" + }, + "_requiredBy": [ + "/terser" + ], + "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "_shasum": "74722af32e9614e9c287a8d0bbde48b5e2f1a263", + "_spec": "source-map@~0.6.1", + "_where": "/usr/local/google/home/azakai/Dev/emscripten/tools/node_modules/terser", + "author": { + "name": "Nick Fitzgerald", + "email": "nfitzgerald@mozilla.com" + }, + "bugs": { + "url": "https://github.com/mozilla/source-map/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Tobias Koppers", + "email": "tobias.koppers@googlemail.com" + }, + { + "name": "Duncan Beevers", + "email": "duncan@dweebd.com" + }, + { + "name": "Stephen Crane", + "email": "scrane@mozilla.com" + }, + { + "name": "Ryan Seddon", + "email": "seddon.ryan@gmail.com" + }, + { + "name": "Miles Elam", + "email": "miles.elam@deem.com" + }, + { + "name": "Mihai Bazon", + "email": "mihai.bazon@gmail.com" + }, + { + "name": "Michael Ficarra", + "email": "github.public.email@michael.ficarra.me" + }, + { + "name": "Todd Wolfson", + "email": "todd@twolfson.com" + }, + { + "name": "Alexander Solovyov", + "email": "alexander@solovyov.net" + }, + { + "name": "Felix Gnass", + "email": "fgnass@gmail.com" + }, + { + "name": "Conrad Irwin", + "email": "conrad.irwin@gmail.com" + }, + { + "name": "usrbincc", + "email": "usrbincc@yahoo.com" + }, + { + "name": "David Glasser", + "email": "glasser@davidglasser.net" + }, + { + "name": "Chase Douglas", + "email": "chase@newrelic.com" + }, + { + "name": "Evan Wallace", + "email": "evan.exe@gmail.com" + }, + { + "name": "Heather Arthur", + "email": "fayearthur@gmail.com" + }, + { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com" + }, + { + "name": "David Glasser", + "email": "glasser@davidglasser.net" + }, + { + "name": "Simon Lydell", + "email": "simon.lydell@gmail.com" + }, + { + "name": "Jmeas Smith", + "email": "jellyes2@gmail.com" + }, + { + "name": "Michael Z Goddard", + "email": "mzgoddard@gmail.com" + }, + { + "name": "azu", + "email": "azu@users.noreply.github.com" + }, + { + "name": "John Gozde", + "email": "john@gozde.ca" + }, + { + "name": "Adam Kirkton", + "email": "akirkton@truefitinnovation.com" + }, + { + "name": "Chris Montgomery", + "email": "christopher.montgomery@dowjones.com" + }, + { + "name": "J. Ryan Stinnett", + "email": "jryans@gmail.com" + }, + { + "name": "Jack Herrington", + "email": "jherrington@walmartlabs.com" + }, + { + "name": "Chris Truter", + "email": "jeffpalentine@gmail.com" + }, + { + "name": "Daniel Espeset", + "email": "daniel@danielespeset.com" + }, + { + "name": "Jamie Wong", + "email": "jamie.lf.wong@gmail.com" + }, + { + "name": "Eddy Bruël", + "email": "ejpbruel@mozilla.com" + }, + { + "name": "Hawken Rives", + "email": "hawkrives@gmail.com" + }, + { + "name": "Gilad Peleg", + "email": "giladp007@gmail.com" + }, + { + "name": "djchie", + "email": "djchie.dev@gmail.com" + }, + { + "name": "Gary Ye", + "email": "garysye@gmail.com" + }, + { + "name": "Nicolas Lalevée", + "email": "nicolas.lalevee@hibnet.org" + } + ], + "deprecated": false, + "description": "Generates and consumes source maps", + "devDependencies": { + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "source-map.js", + "source-map.d.ts", + "lib/", + "dist/source-map.debug.js", + "dist/source-map.js", + "dist/source-map.min.js", + "dist/source-map.min.js.map" + ], + "homepage": "https://github.com/mozilla/source-map", + "license": "BSD-3-Clause", + "main": "./source-map.js", + "name": "source-map", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/mozilla/source-map.git" + }, + "scripts": { + "build": "webpack --color", + "test": "npm run build && node test/run-tests.js", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "typings": "source-map", + "version": "0.6.1" +} diff --git a/tools/node_modules/terser/node_modules/source-map/source-map.d.ts b/tools/node_modules/terser/node_modules/source-map/source-map.d.ts new file mode 100644 index 000000000000..8f972b0cfbf3 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/source-map.d.ts @@ -0,0 +1,98 @@ +export interface StartOfSourceMap { + file?: string; + sourceRoot?: string; +} + +export interface RawSourceMap extends StartOfSourceMap { + version: string; + sources: string[]; + names: string[]; + sourcesContent?: string[]; + mappings: string; +} + +export interface Position { + line: number; + column: number; +} + +export interface LineRange extends Position { + lastColumn: number; +} + +export interface FindPosition extends Position { + // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND + bias?: number; +} + +export interface SourceFindPosition extends FindPosition { + source: string; +} + +export interface MappedPosition extends Position { + source: string; + name?: string; +} + +export interface MappingItem { + source: string; + generatedLine: number; + generatedColumn: number; + originalLine: number; + originalColumn: number; + name: string; +} + +export class SourceMapConsumer { + static GENERATED_ORDER: number; + static ORIGINAL_ORDER: number; + + static GREATEST_LOWER_BOUND: number; + static LEAST_UPPER_BOUND: number; + + constructor(rawSourceMap: RawSourceMap); + computeColumnSpans(): void; + originalPositionFor(generatedPosition: FindPosition): MappedPosition; + generatedPositionFor(originalPosition: SourceFindPosition): LineRange; + allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; + hasContentsOfAllSources(): boolean; + sourceContentFor(source: string, returnNullOnMissing?: boolean): string; + eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; +} + +export interface Mapping { + generated: Position; + original: Position; + source: string; + name?: string; +} + +export class SourceMapGenerator { + constructor(startOfSourceMap?: StartOfSourceMap); + static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; + addMapping(mapping: Mapping): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; + toString(): string; +} + +export interface CodeWithSourceMap { + code: string; + map: SourceMapGenerator; +} + +export class SourceNode { + constructor(); + constructor(line: number, column: number, source: string); + constructor(line: number, column: number, source: string, chunk?: string, name?: string); + static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; + add(chunk: string): void; + prepend(chunk: string): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + walk(fn: (chunk: string, mapping: MappedPosition) => void): void; + walkSourceContents(fn: (file: string, content: string) => void): void; + join(sep: string): SourceNode; + replaceRight(pattern: string, replacement: string): SourceNode; + toString(): string; + toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; +} diff --git a/tools/node_modules/terser/node_modules/source-map/source-map.js b/tools/node_modules/terser/node_modules/source-map/source-map.js new file mode 100644 index 000000000000..bc88fe820c87 --- /dev/null +++ b/tools/node_modules/terser/node_modules/source-map/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/tools/node_modules/terser/package.json b/tools/node_modules/terser/package.json new file mode 100644 index 000000000000..7678de6d1216 --- /dev/null +++ b/tools/node_modules/terser/package.json @@ -0,0 +1,154 @@ +{ + "_from": "terser", + "_id": "terser@3.14.1", + "_inBundle": false, + "_integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==", + "_location": "/terser", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "terser", + "name": "terser", + "escapedName": "terser", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz", + "_shasum": "cc4764014af570bc79c79742358bd46926018a32", + "_spec": "terser", + "_where": "/usr/local/google/home/azakai/Dev/emscripten/tools", + "author": { + "name": "Mihai Bazon", + "email": "mihai.bazon@gmail.com", + "url": "http://lisperator.net/" + }, + "bin": { + "terser": "bin/uglifyjs" + }, + "bugs": { + "url": "https://github.com/fabiosantoscode/terser/issues" + }, + "bundleDependencies": false, + "dependencies": { + "commander": "~2.17.1", + "source-map": "~0.6.1", + "source-map-support": "~0.5.6" + }, + "deprecated": false, + "description": "JavaScript parser, mangler/compressor and beautifier toolkit for ES6+", + "devDependencies": { + "acorn": "^6.0.4", + "coveralls": "^3.0.2", + "csv": "^5.0.0", + "es6-promise": "^4.2.5", + "escodegen": "^1.9.1", + "eslint": "^4.19.1", + "eslump": "^2.0.0", + "istanbul": "^0.4.5", + "mocha": "^3.0.0", + "mochallel": "^1.8.2", + "pre-commit": "^1.2.2", + "semver": "~5.5.0" + }, + "engines": { + "node": ">=4.0.0" + }, + "eslintConfig": { + "rules": { + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": true + } + ], + "quotes": [ + "error", + "double", + "avoid-escape" + ], + "no-debugger": "error", + "semi": [ + "error", + "always" + ], + "no-extra-semi": "error", + "no-irregular-whitespace": "error", + "space-before-blocks": [ + "error", + "always" + ] + } + }, + "files": [ + "bin", + "lib", + "dist", + "!dist/bundle.instrumented.js", + "tools", + "LICENSE" + ], + "homepage": "https://github.com/fabiosantoscode/terser", + "keywords": [ + "uglify", + "terser", + "uglify-es", + "uglify-js", + "minify", + "minifier", + "javascript", + "ecmascript", + "es5", + "es6", + "es7", + "es8", + "es2015", + "es2016", + "es2017", + "async", + "await" + ], + "license": "BSD-2-Clause", + "main": "terser.js", + "zmain": "dist/bundle.js", + "maintainers": [ + { + "name": "Fábio Santos", + "email": "fabiosantosart@gmail.com" + }, + { + "name": "Alex Lam", + "email": "alexlamsl@gmail.com" + }, + { + "name": "Mihai Bazon", + "email": "mihai.bazon@gmail.com", + "url": "http://lisperator.net/" + } + ], + "name": "terser", + "pre-commit": [ + "lint-fix", + "test" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/fabiosantoscode/terser.git" + }, + "scripts": { + "coverage": "istanbul cover test/run-tests.js", + "coveralls": "coveralls < coverage/lcov.info", + "lint": "eslint lib", + "lint-fix": "eslint --fix lib", + "prepare": "cd dist && TERSER_NO_BUNDLE=1 ../bin/uglifyjs ../tools/domprops.js ../lib/utils.js ../lib/ast.js ../lib/parse.js ../lib/transform.js ../lib/scope.js ../lib/output.js ../lib/compress.js ../lib/sourcemap.js ../lib/mozilla-ast.js ../lib/propmangle.js ../lib/minify.js ../tools/exports.js -mc -d \"MOZ_SourceMap=require('source-map')\" --source-map \"includeSources=true,url='bundle.js.map'\" -e \"exports:(typeof module != 'undefined' ? module.exports : Terser = {})\" -b beautify=false,ascii_only --comments /license/ -o ../dist/bundle.js", + "test": "rm -f dist/* && npm run prepare && istanbul instrument dist/bundle.js > dist/bundle.instrumented.js && node test/run-tests.js" + }, + "types": "tools/terser.d.ts", + "version": "3.14.1" +} diff --git a/tools/node_modules/terser/tools/colorless-console.js b/tools/node_modules/terser/tools/colorless-console.js new file mode 100644 index 000000000000..b65bb62756e0 --- /dev/null +++ b/tools/node_modules/terser/tools/colorless-console.js @@ -0,0 +1,11 @@ +"use strict" + +if (Number((/([0-9]+)\./.exec(process.version) || [])[1]) >= 10) { + var Console = require("console").Console; + global.console = new Console({ + stdout: process.stdout, + stderr: process.stderr, + colorMode: false + }); +} + diff --git a/tools/node_modules/terser/tools/domprops.js b/tools/node_modules/terser/tools/domprops.js new file mode 100644 index 000000000000..3af936a3fff4 --- /dev/null +++ b/tools/node_modules/terser/tools/domprops.js @@ -0,0 +1,5601 @@ +var domprops = [ + "$&", + "$'", + "$*", + "$+", + "$1", + "$2", + "$3", + "$4", + "$5", + "$6", + "$7", + "$8", + "$9", + "$_", + "$`", + "$input", + "@@iterator", + "ABORT_ERR", + "ACTIVE", + "ACTIVE_ATTRIBUTES", + "ACTIVE_TEXTURE", + "ACTIVE_UNIFORMS", + "ADDITION", + "ALIASED_LINE_WIDTH_RANGE", + "ALIASED_POINT_SIZE_RANGE", + "ALLOW_KEYBOARD_INPUT", + "ALLPASS", + "ALPHA", + "ALPHA_BITS", + "ALT_MASK", + "ALWAYS", + "ANY_TYPE", + "ANY_UNORDERED_NODE_TYPE", + "ARRAY_BUFFER", + "ARRAY_BUFFER_BINDING", + "ATTACHED_SHADERS", + "ATTRIBUTE_NODE", + "AT_TARGET", + "AddSearchProvider", + "AnalyserNode", + "AnimationEvent", + "AnonXMLHttpRequest", + "ApplicationCache", + "ApplicationCacheErrorEvent", + "Array", + "ArrayBuffer", + "Attr", + "Audio", + "AudioBuffer", + "AudioBufferSourceNode", + "AudioContext", + "AudioDestinationNode", + "AudioListener", + "AudioNode", + "AudioParam", + "AudioProcessingEvent", + "AudioStreamTrack", + "AutocompleteErrorEvent", + "BACK", + "BAD_BOUNDARYPOINTS_ERR", + "BANDPASS", + "BLEND", + "BLEND_COLOR", + "BLEND_DST_ALPHA", + "BLEND_DST_RGB", + "BLEND_EQUATION", + "BLEND_EQUATION_ALPHA", + "BLEND_EQUATION_RGB", + "BLEND_SRC_ALPHA", + "BLEND_SRC_RGB", + "BLUE_BITS", + "BLUR", + "BOOL", + "BOOLEAN_TYPE", + "BOOL_VEC2", + "BOOL_VEC3", + "BOOL_VEC4", + "BOTH", + "BROWSER_DEFAULT_WEBGL", + "BUBBLING_PHASE", + "BUFFER_SIZE", + "BUFFER_USAGE", + "BYTE", + "BYTES_PER_ELEMENT", + "BarProp", + "BaseHref", + "BatteryManager", + "BeforeLoadEvent", + "BeforeUnloadEvent", + "BiquadFilterNode", + "Blob", + "BlobEvent", + "Boolean", + "CAPTURING_PHASE", + "CCW", + "CDATASection", + "CDATA_SECTION_NODE", + "CHANGE", + "CHARSET_RULE", + "CHECKING", + "CLAMP_TO_EDGE", + "CLICK", + "CLOSED", + "CLOSING", + "COLOR_ATTACHMENT0", + "COLOR_BUFFER_BIT", + "COLOR_CLEAR_VALUE", + "COLOR_WRITEMASK", + "COMMENT_NODE", + "COMPILE_STATUS", + "COMPRESSED_RGBA_S3TC_DXT1_EXT", + "COMPRESSED_RGBA_S3TC_DXT3_EXT", + "COMPRESSED_RGBA_S3TC_DXT5_EXT", + "COMPRESSED_RGB_S3TC_DXT1_EXT", + "COMPRESSED_TEXTURE_FORMATS", + "CONNECTING", + "CONSTANT_ALPHA", + "CONSTANT_COLOR", + "CONSTRAINT_ERR", + "CONTEXT_LOST_WEBGL", + "CONTROL_MASK", + "COUNTER_STYLE_RULE", + "CSS", + "CSS2Properties", + "CSSCharsetRule", + "CSSConditionRule", + "CSSCounterStyleRule", + "CSSFontFaceRule", + "CSSFontFeatureValuesRule", + "CSSGroupingRule", + "CSSImportRule", + "CSSKeyframeRule", + "CSSKeyframesRule", + "CSSMediaRule", + "CSSMozDocumentRule", + "CSSNameSpaceRule", + "CSSPageRule", + "CSSPrimitiveValue", + "CSSRule", + "CSSRuleList", + "CSSStyleDeclaration", + "CSSStyleRule", + "CSSStyleSheet", + "CSSSupportsRule", + "CSSUnknownRule", + "CSSValue", + "CSSValueList", + "CSSVariablesDeclaration", + "CSSVariablesRule", + "CSSViewportRule", + "CSS_ATTR", + "CSS_CM", + "CSS_COUNTER", + "CSS_CUSTOM", + "CSS_DEG", + "CSS_DIMENSION", + "CSS_EMS", + "CSS_EXS", + "CSS_FILTER_BLUR", + "CSS_FILTER_BRIGHTNESS", + "CSS_FILTER_CONTRAST", + "CSS_FILTER_CUSTOM", + "CSS_FILTER_DROP_SHADOW", + "CSS_FILTER_GRAYSCALE", + "CSS_FILTER_HUE_ROTATE", + "CSS_FILTER_INVERT", + "CSS_FILTER_OPACITY", + "CSS_FILTER_REFERENCE", + "CSS_FILTER_SATURATE", + "CSS_FILTER_SEPIA", + "CSS_GRAD", + "CSS_HZ", + "CSS_IDENT", + "CSS_IN", + "CSS_INHERIT", + "CSS_KHZ", + "CSS_MATRIX", + "CSS_MATRIX3D", + "CSS_MM", + "CSS_MS", + "CSS_NUMBER", + "CSS_PC", + "CSS_PERCENTAGE", + "CSS_PERSPECTIVE", + "CSS_PRIMITIVE_VALUE", + "CSS_PT", + "CSS_PX", + "CSS_RAD", + "CSS_RECT", + "CSS_RGBCOLOR", + "CSS_ROTATE", + "CSS_ROTATE3D", + "CSS_ROTATEX", + "CSS_ROTATEY", + "CSS_ROTATEZ", + "CSS_S", + "CSS_SCALE", + "CSS_SCALE3D", + "CSS_SCALEX", + "CSS_SCALEY", + "CSS_SCALEZ", + "CSS_SKEW", + "CSS_SKEWX", + "CSS_SKEWY", + "CSS_STRING", + "CSS_TRANSLATE", + "CSS_TRANSLATE3D", + "CSS_TRANSLATEX", + "CSS_TRANSLATEY", + "CSS_TRANSLATEZ", + "CSS_UNKNOWN", + "CSS_URI", + "CSS_VALUE_LIST", + "CSS_VH", + "CSS_VMAX", + "CSS_VMIN", + "CSS_VW", + "CULL_FACE", + "CULL_FACE_MODE", + "CURRENT_PROGRAM", + "CURRENT_VERTEX_ATTRIB", + "CUSTOM", + "CW", + "CanvasGradient", + "CanvasPattern", + "CanvasRenderingContext2D", + "CaretPosition", + "ChannelMergerNode", + "ChannelSplitterNode", + "CharacterData", + "ClientRect", + "ClientRectList", + "Clipboard", + "ClipboardEvent", + "CloseEvent", + "Collator", + "CommandEvent", + "Comment", + "CompositionEvent", + "Console", + "Controllers", + "ConvolverNode", + "Counter", + "Crypto", + "CryptoKey", + "CustomEvent", + "DATABASE_ERR", + "DATA_CLONE_ERR", + "DATA_ERR", + "DBLCLICK", + "DECR", + "DECR_WRAP", + "DELETE_STATUS", + "DEPTH_ATTACHMENT", + "DEPTH_BITS", + "DEPTH_BUFFER_BIT", + "DEPTH_CLEAR_VALUE", + "DEPTH_COMPONENT", + "DEPTH_COMPONENT16", + "DEPTH_FUNC", + "DEPTH_RANGE", + "DEPTH_STENCIL", + "DEPTH_STENCIL_ATTACHMENT", + "DEPTH_TEST", + "DEPTH_WRITEMASK", + "DIRECTION_DOWN", + "DIRECTION_LEFT", + "DIRECTION_RIGHT", + "DIRECTION_UP", + "DISABLED", + "DISPATCH_REQUEST_ERR", + "DITHER", + "DOCUMENT_FRAGMENT_NODE", + "DOCUMENT_NODE", + "DOCUMENT_POSITION_CONTAINED_BY", + "DOCUMENT_POSITION_CONTAINS", + "DOCUMENT_POSITION_DISCONNECTED", + "DOCUMENT_POSITION_FOLLOWING", + "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", + "DOCUMENT_POSITION_PRECEDING", + "DOCUMENT_TYPE_NODE", + "DOMCursor", + "DOMError", + "DOMException", + "DOMImplementation", + "DOMImplementationLS", + "DOMMatrix", + "DOMMatrixReadOnly", + "DOMParser", + "DOMPoint", + "DOMPointReadOnly", + "DOMQuad", + "DOMRect", + "DOMRectList", + "DOMRectReadOnly", + "DOMRequest", + "DOMSTRING_SIZE_ERR", + "DOMSettableTokenList", + "DOMStringList", + "DOMStringMap", + "DOMTokenList", + "DOMTransactionEvent", + "DOM_DELTA_LINE", + "DOM_DELTA_PAGE", + "DOM_DELTA_PIXEL", + "DOM_INPUT_METHOD_DROP", + "DOM_INPUT_METHOD_HANDWRITING", + "DOM_INPUT_METHOD_IME", + "DOM_INPUT_METHOD_KEYBOARD", + "DOM_INPUT_METHOD_MULTIMODAL", + "DOM_INPUT_METHOD_OPTION", + "DOM_INPUT_METHOD_PASTE", + "DOM_INPUT_METHOD_SCRIPT", + "DOM_INPUT_METHOD_UNKNOWN", + "DOM_INPUT_METHOD_VOICE", + "DOM_KEY_LOCATION_JOYSTICK", + "DOM_KEY_LOCATION_LEFT", + "DOM_KEY_LOCATION_MOBILE", + "DOM_KEY_LOCATION_NUMPAD", + "DOM_KEY_LOCATION_RIGHT", + "DOM_KEY_LOCATION_STANDARD", + "DOM_VK_0", + "DOM_VK_1", + "DOM_VK_2", + "DOM_VK_3", + "DOM_VK_4", + "DOM_VK_5", + "DOM_VK_6", + "DOM_VK_7", + "DOM_VK_8", + "DOM_VK_9", + "DOM_VK_A", + "DOM_VK_ACCEPT", + "DOM_VK_ADD", + "DOM_VK_ALT", + "DOM_VK_ALTGR", + "DOM_VK_AMPERSAND", + "DOM_VK_ASTERISK", + "DOM_VK_AT", + "DOM_VK_ATTN", + "DOM_VK_B", + "DOM_VK_BACKSPACE", + "DOM_VK_BACK_QUOTE", + "DOM_VK_BACK_SLASH", + "DOM_VK_BACK_SPACE", + "DOM_VK_C", + "DOM_VK_CANCEL", + "DOM_VK_CAPS_LOCK", + "DOM_VK_CIRCUMFLEX", + "DOM_VK_CLEAR", + "DOM_VK_CLOSE_BRACKET", + "DOM_VK_CLOSE_CURLY_BRACKET", + "DOM_VK_CLOSE_PAREN", + "DOM_VK_COLON", + "DOM_VK_COMMA", + "DOM_VK_CONTEXT_MENU", + "DOM_VK_CONTROL", + "DOM_VK_CONVERT", + "DOM_VK_CRSEL", + "DOM_VK_CTRL", + "DOM_VK_D", + "DOM_VK_DECIMAL", + "DOM_VK_DELETE", + "DOM_VK_DIVIDE", + "DOM_VK_DOLLAR", + "DOM_VK_DOUBLE_QUOTE", + "DOM_VK_DOWN", + "DOM_VK_E", + "DOM_VK_EISU", + "DOM_VK_END", + "DOM_VK_ENTER", + "DOM_VK_EQUALS", + "DOM_VK_EREOF", + "DOM_VK_ESCAPE", + "DOM_VK_EXCLAMATION", + "DOM_VK_EXECUTE", + "DOM_VK_EXSEL", + "DOM_VK_F", + "DOM_VK_F1", + "DOM_VK_F10", + "DOM_VK_F11", + "DOM_VK_F12", + "DOM_VK_F13", + "DOM_VK_F14", + "DOM_VK_F15", + "DOM_VK_F16", + "DOM_VK_F17", + "DOM_VK_F18", + "DOM_VK_F19", + "DOM_VK_F2", + "DOM_VK_F20", + "DOM_VK_F21", + "DOM_VK_F22", + "DOM_VK_F23", + "DOM_VK_F24", + "DOM_VK_F25", + "DOM_VK_F26", + "DOM_VK_F27", + "DOM_VK_F28", + "DOM_VK_F29", + "DOM_VK_F3", + "DOM_VK_F30", + "DOM_VK_F31", + "DOM_VK_F32", + "DOM_VK_F33", + "DOM_VK_F34", + "DOM_VK_F35", + "DOM_VK_F36", + "DOM_VK_F4", + "DOM_VK_F5", + "DOM_VK_F6", + "DOM_VK_F7", + "DOM_VK_F8", + "DOM_VK_F9", + "DOM_VK_FINAL", + "DOM_VK_FRONT", + "DOM_VK_G", + "DOM_VK_GREATER_THAN", + "DOM_VK_H", + "DOM_VK_HANGUL", + "DOM_VK_HANJA", + "DOM_VK_HASH", + "DOM_VK_HELP", + "DOM_VK_HK_TOGGLE", + "DOM_VK_HOME", + "DOM_VK_HYPHEN_MINUS", + "DOM_VK_I", + "DOM_VK_INSERT", + "DOM_VK_J", + "DOM_VK_JUNJA", + "DOM_VK_K", + "DOM_VK_KANA", + "DOM_VK_KANJI", + "DOM_VK_L", + "DOM_VK_LEFT", + "DOM_VK_LEFT_TAB", + "DOM_VK_LESS_THAN", + "DOM_VK_M", + "DOM_VK_META", + "DOM_VK_MODECHANGE", + "DOM_VK_MULTIPLY", + "DOM_VK_N", + "DOM_VK_NONCONVERT", + "DOM_VK_NUMPAD0", + "DOM_VK_NUMPAD1", + "DOM_VK_NUMPAD2", + "DOM_VK_NUMPAD3", + "DOM_VK_NUMPAD4", + "DOM_VK_NUMPAD5", + "DOM_VK_NUMPAD6", + "DOM_VK_NUMPAD7", + "DOM_VK_NUMPAD8", + "DOM_VK_NUMPAD9", + "DOM_VK_NUM_LOCK", + "DOM_VK_O", + "DOM_VK_OEM_1", + "DOM_VK_OEM_102", + "DOM_VK_OEM_2", + "DOM_VK_OEM_3", + "DOM_VK_OEM_4", + "DOM_VK_OEM_5", + "DOM_VK_OEM_6", + "DOM_VK_OEM_7", + "DOM_VK_OEM_8", + "DOM_VK_OEM_COMMA", + "DOM_VK_OEM_MINUS", + "DOM_VK_OEM_PERIOD", + "DOM_VK_OEM_PLUS", + "DOM_VK_OPEN_BRACKET", + "DOM_VK_OPEN_CURLY_BRACKET", + "DOM_VK_OPEN_PAREN", + "DOM_VK_P", + "DOM_VK_PA1", + "DOM_VK_PAGEDOWN", + "DOM_VK_PAGEUP", + "DOM_VK_PAGE_DOWN", + "DOM_VK_PAGE_UP", + "DOM_VK_PAUSE", + "DOM_VK_PERCENT", + "DOM_VK_PERIOD", + "DOM_VK_PIPE", + "DOM_VK_PLAY", + "DOM_VK_PLUS", + "DOM_VK_PRINT", + "DOM_VK_PRINTSCREEN", + "DOM_VK_PROCESSKEY", + "DOM_VK_PROPERITES", + "DOM_VK_Q", + "DOM_VK_QUESTION_MARK", + "DOM_VK_QUOTE", + "DOM_VK_R", + "DOM_VK_REDO", + "DOM_VK_RETURN", + "DOM_VK_RIGHT", + "DOM_VK_S", + "DOM_VK_SCROLL_LOCK", + "DOM_VK_SELECT", + "DOM_VK_SEMICOLON", + "DOM_VK_SEPARATOR", + "DOM_VK_SHIFT", + "DOM_VK_SLASH", + "DOM_VK_SLEEP", + "DOM_VK_SPACE", + "DOM_VK_SUBTRACT", + "DOM_VK_T", + "DOM_VK_TAB", + "DOM_VK_TILDE", + "DOM_VK_U", + "DOM_VK_UNDERSCORE", + "DOM_VK_UNDO", + "DOM_VK_UNICODE", + "DOM_VK_UP", + "DOM_VK_V", + "DOM_VK_VOLUME_DOWN", + "DOM_VK_VOLUME_MUTE", + "DOM_VK_VOLUME_UP", + "DOM_VK_W", + "DOM_VK_WIN", + "DOM_VK_WINDOW", + "DOM_VK_WIN_ICO_00", + "DOM_VK_WIN_ICO_CLEAR", + "DOM_VK_WIN_ICO_HELP", + "DOM_VK_WIN_OEM_ATTN", + "DOM_VK_WIN_OEM_AUTO", + "DOM_VK_WIN_OEM_BACKTAB", + "DOM_VK_WIN_OEM_CLEAR", + "DOM_VK_WIN_OEM_COPY", + "DOM_VK_WIN_OEM_CUSEL", + "DOM_VK_WIN_OEM_ENLW", + "DOM_VK_WIN_OEM_FINISH", + "DOM_VK_WIN_OEM_FJ_JISHO", + "DOM_VK_WIN_OEM_FJ_LOYA", + "DOM_VK_WIN_OEM_FJ_MASSHOU", + "DOM_VK_WIN_OEM_FJ_ROYA", + "DOM_VK_WIN_OEM_FJ_TOUROKU", + "DOM_VK_WIN_OEM_JUMP", + "DOM_VK_WIN_OEM_PA1", + "DOM_VK_WIN_OEM_PA2", + "DOM_VK_WIN_OEM_PA3", + "DOM_VK_WIN_OEM_RESET", + "DOM_VK_WIN_OEM_WSCTRL", + "DOM_VK_X", + "DOM_VK_XF86XK_ADD_FAVORITE", + "DOM_VK_XF86XK_APPLICATION_LEFT", + "DOM_VK_XF86XK_APPLICATION_RIGHT", + "DOM_VK_XF86XK_AUDIO_CYCLE_TRACK", + "DOM_VK_XF86XK_AUDIO_FORWARD", + "DOM_VK_XF86XK_AUDIO_LOWER_VOLUME", + "DOM_VK_XF86XK_AUDIO_MEDIA", + "DOM_VK_XF86XK_AUDIO_MUTE", + "DOM_VK_XF86XK_AUDIO_NEXT", + "DOM_VK_XF86XK_AUDIO_PAUSE", + "DOM_VK_XF86XK_AUDIO_PLAY", + "DOM_VK_XF86XK_AUDIO_PREV", + "DOM_VK_XF86XK_AUDIO_RAISE_VOLUME", + "DOM_VK_XF86XK_AUDIO_RANDOM_PLAY", + "DOM_VK_XF86XK_AUDIO_RECORD", + "DOM_VK_XF86XK_AUDIO_REPEAT", + "DOM_VK_XF86XK_AUDIO_REWIND", + "DOM_VK_XF86XK_AUDIO_STOP", + "DOM_VK_XF86XK_AWAY", + "DOM_VK_XF86XK_BACK", + "DOM_VK_XF86XK_BACK_FORWARD", + "DOM_VK_XF86XK_BATTERY", + "DOM_VK_XF86XK_BLUE", + "DOM_VK_XF86XK_BLUETOOTH", + "DOM_VK_XF86XK_BOOK", + "DOM_VK_XF86XK_BRIGHTNESS_ADJUST", + "DOM_VK_XF86XK_CALCULATOR", + "DOM_VK_XF86XK_CALENDAR", + "DOM_VK_XF86XK_CD", + "DOM_VK_XF86XK_CLOSE", + "DOM_VK_XF86XK_COMMUNITY", + "DOM_VK_XF86XK_CONTRAST_ADJUST", + "DOM_VK_XF86XK_COPY", + "DOM_VK_XF86XK_CUT", + "DOM_VK_XF86XK_CYCLE_ANGLE", + "DOM_VK_XF86XK_DISPLAY", + "DOM_VK_XF86XK_DOCUMENTS", + "DOM_VK_XF86XK_DOS", + "DOM_VK_XF86XK_EJECT", + "DOM_VK_XF86XK_EXCEL", + "DOM_VK_XF86XK_EXPLORER", + "DOM_VK_XF86XK_FAVORITES", + "DOM_VK_XF86XK_FINANCE", + "DOM_VK_XF86XK_FORWARD", + "DOM_VK_XF86XK_FRAME_BACK", + "DOM_VK_XF86XK_FRAME_FORWARD", + "DOM_VK_XF86XK_GAME", + "DOM_VK_XF86XK_GO", + "DOM_VK_XF86XK_GREEN", + "DOM_VK_XF86XK_HIBERNATE", + "DOM_VK_XF86XK_HISTORY", + "DOM_VK_XF86XK_HOME_PAGE", + "DOM_VK_XF86XK_HOT_LINKS", + "DOM_VK_XF86XK_I_TOUCH", + "DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN", + "DOM_VK_XF86XK_KBD_BRIGHTNESS_UP", + "DOM_VK_XF86XK_KBD_LIGHT_ON_OFF", + "DOM_VK_XF86XK_LAUNCH0", + "DOM_VK_XF86XK_LAUNCH1", + "DOM_VK_XF86XK_LAUNCH2", + "DOM_VK_XF86XK_LAUNCH3", + "DOM_VK_XF86XK_LAUNCH4", + "DOM_VK_XF86XK_LAUNCH5", + "DOM_VK_XF86XK_LAUNCH6", + "DOM_VK_XF86XK_LAUNCH7", + "DOM_VK_XF86XK_LAUNCH8", + "DOM_VK_XF86XK_LAUNCH9", + "DOM_VK_XF86XK_LAUNCH_A", + "DOM_VK_XF86XK_LAUNCH_B", + "DOM_VK_XF86XK_LAUNCH_C", + "DOM_VK_XF86XK_LAUNCH_D", + "DOM_VK_XF86XK_LAUNCH_E", + "DOM_VK_XF86XK_LAUNCH_F", + "DOM_VK_XF86XK_LIGHT_BULB", + "DOM_VK_XF86XK_LOG_OFF", + "DOM_VK_XF86XK_MAIL", + "DOM_VK_XF86XK_MAIL_FORWARD", + "DOM_VK_XF86XK_MARKET", + "DOM_VK_XF86XK_MEETING", + "DOM_VK_XF86XK_MEMO", + "DOM_VK_XF86XK_MENU_KB", + "DOM_VK_XF86XK_MENU_PB", + "DOM_VK_XF86XK_MESSENGER", + "DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN", + "DOM_VK_XF86XK_MON_BRIGHTNESS_UP", + "DOM_VK_XF86XK_MUSIC", + "DOM_VK_XF86XK_MY_COMPUTER", + "DOM_VK_XF86XK_MY_SITES", + "DOM_VK_XF86XK_NEW", + "DOM_VK_XF86XK_NEWS", + "DOM_VK_XF86XK_OFFICE_HOME", + "DOM_VK_XF86XK_OPEN", + "DOM_VK_XF86XK_OPEN_URL", + "DOM_VK_XF86XK_OPTION", + "DOM_VK_XF86XK_PASTE", + "DOM_VK_XF86XK_PHONE", + "DOM_VK_XF86XK_PICTURES", + "DOM_VK_XF86XK_POWER_DOWN", + "DOM_VK_XF86XK_POWER_OFF", + "DOM_VK_XF86XK_RED", + "DOM_VK_XF86XK_REFRESH", + "DOM_VK_XF86XK_RELOAD", + "DOM_VK_XF86XK_REPLY", + "DOM_VK_XF86XK_ROCKER_DOWN", + "DOM_VK_XF86XK_ROCKER_ENTER", + "DOM_VK_XF86XK_ROCKER_UP", + "DOM_VK_XF86XK_ROTATE_WINDOWS", + "DOM_VK_XF86XK_ROTATION_KB", + "DOM_VK_XF86XK_ROTATION_PB", + "DOM_VK_XF86XK_SAVE", + "DOM_VK_XF86XK_SCREEN_SAVER", + "DOM_VK_XF86XK_SCROLL_CLICK", + "DOM_VK_XF86XK_SCROLL_DOWN", + "DOM_VK_XF86XK_SCROLL_UP", + "DOM_VK_XF86XK_SEARCH", + "DOM_VK_XF86XK_SEND", + "DOM_VK_XF86XK_SHOP", + "DOM_VK_XF86XK_SPELL", + "DOM_VK_XF86XK_SPLIT_SCREEN", + "DOM_VK_XF86XK_STANDBY", + "DOM_VK_XF86XK_START", + "DOM_VK_XF86XK_STOP", + "DOM_VK_XF86XK_SUBTITLE", + "DOM_VK_XF86XK_SUPPORT", + "DOM_VK_XF86XK_SUSPEND", + "DOM_VK_XF86XK_TASK_PANE", + "DOM_VK_XF86XK_TERMINAL", + "DOM_VK_XF86XK_TIME", + "DOM_VK_XF86XK_TOOLS", + "DOM_VK_XF86XK_TOP_MENU", + "DOM_VK_XF86XK_TO_DO_LIST", + "DOM_VK_XF86XK_TRAVEL", + "DOM_VK_XF86XK_USER1KB", + "DOM_VK_XF86XK_USER2KB", + "DOM_VK_XF86XK_USER_PB", + "DOM_VK_XF86XK_UWB", + "DOM_VK_XF86XK_VENDOR_HOME", + "DOM_VK_XF86XK_VIDEO", + "DOM_VK_XF86XK_VIEW", + "DOM_VK_XF86XK_WAKE_UP", + "DOM_VK_XF86XK_WEB_CAM", + "DOM_VK_XF86XK_WHEEL_BUTTON", + "DOM_VK_XF86XK_WLAN", + "DOM_VK_XF86XK_WORD", + "DOM_VK_XF86XK_WWW", + "DOM_VK_XF86XK_XFER", + "DOM_VK_XF86XK_YELLOW", + "DOM_VK_XF86XK_ZOOM_IN", + "DOM_VK_XF86XK_ZOOM_OUT", + "DOM_VK_Y", + "DOM_VK_Z", + "DOM_VK_ZOOM", + "DONE", + "DONT_CARE", + "DOWNLOADING", + "DRAGDROP", + "DST_ALPHA", + "DST_COLOR", + "DYNAMIC_DRAW", + "DataChannel", + "DataTransfer", + "DataTransferItem", + "DataTransferItemList", + "DataView", + "Date", + "DateTimeFormat", + "DelayNode", + "DesktopNotification", + "DesktopNotificationCenter", + "DeviceLightEvent", + "DeviceMotionEvent", + "DeviceOrientationEvent", + "DeviceProximityEvent", + "DeviceStorage", + "DeviceStorageChangeEvent", + "Document", + "DocumentFragment", + "DocumentType", + "DragEvent", + "DynamicsCompressorNode", + "E", + "ELEMENT_ARRAY_BUFFER", + "ELEMENT_ARRAY_BUFFER_BINDING", + "ELEMENT_NODE", + "EMPTY", + "ENCODING_ERR", + "ENDED", + "END_TO_END", + "END_TO_START", + "ENTITY_NODE", + "ENTITY_REFERENCE_NODE", + "EPSILON", + "EQUAL", + "EQUALPOWER", + "ERROR", + "EXPONENTIAL_DISTANCE", + "Element", + "ElementQuery", + "Entity", + "EntityReference", + "Error", + "ErrorEvent", + "EvalError", + "Event", + "EventException", + "EventSource", + "EventTarget", + "External", + "FASTEST", + "FIDOSDK", + "FILTER_ACCEPT", + "FILTER_INTERRUPT", + "FILTER_REJECT", + "FILTER_SKIP", + "FINISHED_STATE", + "FIRST_ORDERED_NODE_TYPE", + "FLOAT", + "FLOAT_MAT2", + "FLOAT_MAT3", + "FLOAT_MAT4", + "FLOAT_VEC2", + "FLOAT_VEC3", + "FLOAT_VEC4", + "FOCUS", + "FONT_FACE_RULE", + "FONT_FEATURE_VALUES_RULE", + "FRAGMENT_SHADER", + "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", + "FRAMEBUFFER", + "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", + "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", + "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", + "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", + "FRAMEBUFFER_BINDING", + "FRAMEBUFFER_COMPLETE", + "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", + "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", + "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", + "FRAMEBUFFER_UNSUPPORTED", + "FRONT", + "FRONT_AND_BACK", + "FRONT_FACE", + "FUNC_ADD", + "FUNC_REVERSE_SUBTRACT", + "FUNC_SUBTRACT", + "Feed", + "FeedEntry", + "File", + "FileError", + "FileList", + "FileReader", + "FindInPage", + "Float32Array", + "Float64Array", + "FocusEvent", + "FontFace", + "FormData", + "Function", + "GENERATE_MIPMAP_HINT", + "GEQUAL", + "GREATER", + "GREEN_BITS", + "GainNode", + "Gamepad", + "GamepadButton", + "GamepadEvent", + "GestureEvent", + "HAVE_CURRENT_DATA", + "HAVE_ENOUGH_DATA", + "HAVE_FUTURE_DATA", + "HAVE_METADATA", + "HAVE_NOTHING", + "HEADERS_RECEIVED", + "HIDDEN", + "HIERARCHY_REQUEST_ERR", + "HIGHPASS", + "HIGHSHELF", + "HIGH_FLOAT", + "HIGH_INT", + "HORIZONTAL", + "HORIZONTAL_AXIS", + "HRTF", + "HTMLAllCollection", + "HTMLAnchorElement", + "HTMLAppletElement", + "HTMLAreaElement", + "HTMLAudioElement", + "HTMLBRElement", + "HTMLBaseElement", + "HTMLBaseFontElement", + "HTMLBlockquoteElement", + "HTMLBodyElement", + "HTMLButtonElement", + "HTMLCanvasElement", + "HTMLCollection", + "HTMLCommandElement", + "HTMLContentElement", + "HTMLDListElement", + "HTMLDataElement", + "HTMLDataListElement", + "HTMLDetailsElement", + "HTMLDialogElement", + "HTMLDirectoryElement", + "HTMLDivElement", + "HTMLDocument", + "HTMLElement", + "HTMLEmbedElement", + "HTMLFieldSetElement", + "HTMLFontElement", + "HTMLFormControlsCollection", + "HTMLFormElement", + "HTMLFrameElement", + "HTMLFrameSetElement", + "HTMLHRElement", + "HTMLHeadElement", + "HTMLHeadingElement", + "HTMLHtmlElement", + "HTMLIFrameElement", + "HTMLImageElement", + "HTMLInputElement", + "HTMLIsIndexElement", + "HTMLKeygenElement", + "HTMLLIElement", + "HTMLLabelElement", + "HTMLLegendElement", + "HTMLLinkElement", + "HTMLMapElement", + "HTMLMarqueeElement", + "HTMLMediaElement", + "HTMLMenuElement", + "HTMLMenuItemElement", + "HTMLMetaElement", + "HTMLMeterElement", + "HTMLModElement", + "HTMLOListElement", + "HTMLObjectElement", + "HTMLOptGroupElement", + "HTMLOptionElement", + "HTMLOptionsCollection", + "HTMLOutputElement", + "HTMLParagraphElement", + "HTMLParamElement", + "HTMLPictureElement", + "HTMLPreElement", + "HTMLProgressElement", + "HTMLPropertiesCollection", + "HTMLQuoteElement", + "HTMLScriptElement", + "HTMLSelectElement", + "HTMLShadowElement", + "HTMLSourceElement", + "HTMLSpanElement", + "HTMLStyleElement", + "HTMLTableCaptionElement", + "HTMLTableCellElement", + "HTMLTableColElement", + "HTMLTableElement", + "HTMLTableRowElement", + "HTMLTableSectionElement", + "HTMLTemplateElement", + "HTMLTextAreaElement", + "HTMLTimeElement", + "HTMLTitleElement", + "HTMLTrackElement", + "HTMLUListElement", + "HTMLUnknownElement", + "HTMLVideoElement", + "HashChangeEvent", + "Headers", + "History", + "ICE_CHECKING", + "ICE_CLOSED", + "ICE_COMPLETED", + "ICE_CONNECTED", + "ICE_FAILED", + "ICE_GATHERING", + "ICE_WAITING", + "IDBCursor", + "IDBCursorWithValue", + "IDBDatabase", + "IDBDatabaseException", + "IDBFactory", + "IDBFileHandle", + "IDBFileRequest", + "IDBIndex", + "IDBKeyRange", + "IDBMutableFile", + "IDBObjectStore", + "IDBOpenDBRequest", + "IDBRequest", + "IDBTransaction", + "IDBVersionChangeEvent", + "IDLE", + "IMPLEMENTATION_COLOR_READ_FORMAT", + "IMPLEMENTATION_COLOR_READ_TYPE", + "IMPORT_RULE", + "INCR", + "INCR_WRAP", + "INDEX_SIZE_ERR", + "INT", + "INT_VEC2", + "INT_VEC3", + "INT_VEC4", + "INUSE_ATTRIBUTE_ERR", + "INVALID_ACCESS_ERR", + "INVALID_CHARACTER_ERR", + "INVALID_ENUM", + "INVALID_EXPRESSION_ERR", + "INVALID_FRAMEBUFFER_OPERATION", + "INVALID_MODIFICATION_ERR", + "INVALID_NODE_TYPE_ERR", + "INVALID_OPERATION", + "INVALID_STATE_ERR", + "INVALID_VALUE", + "INVERSE_DISTANCE", + "INVERT", + "IceCandidate", + "Image", + "ImageBitmap", + "ImageData", + "Infinity", + "InputEvent", + "InputMethodContext", + "InstallTrigger", + "Int16Array", + "Int32Array", + "Int8Array", + "Intent", + "InternalError", + "Intl", + "IsSearchProviderInstalled", + "Iterator", + "JSON", + "KEEP", + "KEYDOWN", + "KEYFRAMES_RULE", + "KEYFRAME_RULE", + "KEYPRESS", + "KEYUP", + "KeyEvent", + "KeyboardEvent", + "LENGTHADJUST_SPACING", + "LENGTHADJUST_SPACINGANDGLYPHS", + "LENGTHADJUST_UNKNOWN", + "LEQUAL", + "LESS", + "LINEAR", + "LINEAR_DISTANCE", + "LINEAR_MIPMAP_LINEAR", + "LINEAR_MIPMAP_NEAREST", + "LINES", + "LINE_LOOP", + "LINE_STRIP", + "LINE_WIDTH", + "LINK_STATUS", + "LIVE", + "LN10", + "LN2", + "LOADED", + "LOADING", + "LOG10E", + "LOG2E", + "LOWPASS", + "LOWSHELF", + "LOW_FLOAT", + "LOW_INT", + "LSException", + "LSParserFilter", + "LUMINANCE", + "LUMINANCE_ALPHA", + "LocalMediaStream", + "Location", + "MAX_COMBINED_TEXTURE_IMAGE_UNITS", + "MAX_CUBE_MAP_TEXTURE_SIZE", + "MAX_FRAGMENT_UNIFORM_VECTORS", + "MAX_RENDERBUFFER_SIZE", + "MAX_SAFE_INTEGER", + "MAX_TEXTURE_IMAGE_UNITS", + "MAX_TEXTURE_MAX_ANISOTROPY_EXT", + "MAX_TEXTURE_SIZE", + "MAX_VALUE", + "MAX_VARYING_VECTORS", + "MAX_VERTEX_ATTRIBS", + "MAX_VERTEX_TEXTURE_IMAGE_UNITS", + "MAX_VERTEX_UNIFORM_VECTORS", + "MAX_VIEWPORT_DIMS", + "MEDIA_ERR_ABORTED", + "MEDIA_ERR_DECODE", + "MEDIA_ERR_ENCRYPTED", + "MEDIA_ERR_NETWORK", + "MEDIA_ERR_SRC_NOT_SUPPORTED", + "MEDIA_KEYERR_CLIENT", + "MEDIA_KEYERR_DOMAIN", + "MEDIA_KEYERR_HARDWARECHANGE", + "MEDIA_KEYERR_OUTPUT", + "MEDIA_KEYERR_SERVICE", + "MEDIA_KEYERR_UNKNOWN", + "MEDIA_RULE", + "MEDIUM_FLOAT", + "MEDIUM_INT", + "META_MASK", + "MIN_SAFE_INTEGER", + "MIN_VALUE", + "MIRRORED_REPEAT", + "MODE_ASYNCHRONOUS", + "MODE_SYNCHRONOUS", + "MODIFICATION", + "MOUSEDOWN", + "MOUSEDRAG", + "MOUSEMOVE", + "MOUSEOUT", + "MOUSEOVER", + "MOUSEUP", + "MOZ_KEYFRAMES_RULE", + "MOZ_KEYFRAME_RULE", + "MOZ_SOURCE_CURSOR", + "MOZ_SOURCE_ERASER", + "MOZ_SOURCE_KEYBOARD", + "MOZ_SOURCE_MOUSE", + "MOZ_SOURCE_PEN", + "MOZ_SOURCE_TOUCH", + "MOZ_SOURCE_UNKNOWN", + "MSGESTURE_FLAG_BEGIN", + "MSGESTURE_FLAG_CANCEL", + "MSGESTURE_FLAG_END", + "MSGESTURE_FLAG_INERTIA", + "MSGESTURE_FLAG_NONE", + "MSPOINTER_TYPE_MOUSE", + "MSPOINTER_TYPE_PEN", + "MSPOINTER_TYPE_TOUCH", + "MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE", + "MS_ASYNC_CALLBACK_STATUS_CANCEL", + "MS_ASYNC_CALLBACK_STATUS_CHOOSEANY", + "MS_ASYNC_CALLBACK_STATUS_ERROR", + "MS_ASYNC_CALLBACK_STATUS_JOIN", + "MS_ASYNC_OP_STATUS_CANCELED", + "MS_ASYNC_OP_STATUS_ERROR", + "MS_ASYNC_OP_STATUS_SUCCESS", + "MS_MANIPULATION_STATE_ACTIVE", + "MS_MANIPULATION_STATE_CANCELLED", + "MS_MANIPULATION_STATE_COMMITTED", + "MS_MANIPULATION_STATE_DRAGGING", + "MS_MANIPULATION_STATE_INERTIA", + "MS_MANIPULATION_STATE_PRESELECT", + "MS_MANIPULATION_STATE_SELECTING", + "MS_MANIPULATION_STATE_STOPPED", + "MS_MEDIA_ERR_ENCRYPTED", + "MS_MEDIA_KEYERR_CLIENT", + "MS_MEDIA_KEYERR_DOMAIN", + "MS_MEDIA_KEYERR_HARDWARECHANGE", + "MS_MEDIA_KEYERR_OUTPUT", + "MS_MEDIA_KEYERR_SERVICE", + "MS_MEDIA_KEYERR_UNKNOWN", + "Map", + "Math", + "MediaController", + "MediaDevices", + "MediaElementAudioSourceNode", + "MediaEncryptedEvent", + "MediaError", + "MediaKeyError", + "MediaKeyEvent", + "MediaKeyMessageEvent", + "MediaKeyNeededEvent", + "MediaKeySession", + "MediaKeyStatusMap", + "MediaKeySystemAccess", + "MediaKeys", + "MediaList", + "MediaQueryList", + "MediaQueryListEvent", + "MediaRecorder", + "MediaSource", + "MediaStream", + "MediaStreamAudioDestinationNode", + "MediaStreamAudioSourceNode", + "MediaStreamEvent", + "MediaStreamTrack", + "MediaStreamTrackEvent", + "MessageChannel", + "MessageEvent", + "MessagePort", + "Methods", + "MimeType", + "MimeTypeArray", + "MouseEvent", + "MouseScrollEvent", + "MozAnimation", + "MozAnimationDelay", + "MozAnimationDirection", + "MozAnimationDuration", + "MozAnimationFillMode", + "MozAnimationIterationCount", + "MozAnimationName", + "MozAnimationPlayState", + "MozAnimationTimingFunction", + "MozAppearance", + "MozBackfaceVisibility", + "MozBinding", + "MozBorderBottomColors", + "MozBorderEnd", + "MozBorderEndColor", + "MozBorderEndStyle", + "MozBorderEndWidth", + "MozBorderImage", + "MozBorderLeftColors", + "MozBorderRightColors", + "MozBorderStart", + "MozBorderStartColor", + "MozBorderStartStyle", + "MozBorderStartWidth", + "MozBorderTopColors", + "MozBoxAlign", + "MozBoxDirection", + "MozBoxFlex", + "MozBoxOrdinalGroup", + "MozBoxOrient", + "MozBoxPack", + "MozBoxSizing", + "MozCSSKeyframeRule", + "MozCSSKeyframesRule", + "MozColumnCount", + "MozColumnFill", + "MozColumnGap", + "MozColumnRule", + "MozColumnRuleColor", + "MozColumnRuleStyle", + "MozColumnRuleWidth", + "MozColumnWidth", + "MozColumns", + "MozContactChangeEvent", + "MozFloatEdge", + "MozFontFeatureSettings", + "MozFontLanguageOverride", + "MozForceBrokenImageIcon", + "MozHyphens", + "MozImageRegion", + "MozMarginEnd", + "MozMarginStart", + "MozMmsEvent", + "MozMmsMessage", + "MozMobileMessageThread", + "MozOSXFontSmoothing", + "MozOrient", + "MozOutlineRadius", + "MozOutlineRadiusBottomleft", + "MozOutlineRadiusBottomright", + "MozOutlineRadiusTopleft", + "MozOutlineRadiusTopright", + "MozPaddingEnd", + "MozPaddingStart", + "MozPerspective", + "MozPerspectiveOrigin", + "MozPowerManager", + "MozSettingsEvent", + "MozSmsEvent", + "MozSmsMessage", + "MozStackSizing", + "MozTabSize", + "MozTextAlignLast", + "MozTextDecorationColor", + "MozTextDecorationLine", + "MozTextDecorationStyle", + "MozTextSizeAdjust", + "MozTransform", + "MozTransformOrigin", + "MozTransformStyle", + "MozTransition", + "MozTransitionDelay", + "MozTransitionDuration", + "MozTransitionProperty", + "MozTransitionTimingFunction", + "MozUserFocus", + "MozUserInput", + "MozUserModify", + "MozUserSelect", + "MozWindowDragging", + "MozWindowShadow", + "MutationEvent", + "MutationObserver", + "MutationRecord", + "NAMESPACE_ERR", + "NAMESPACE_RULE", + "NEAREST", + "NEAREST_MIPMAP_LINEAR", + "NEAREST_MIPMAP_NEAREST", + "NEGATIVE_INFINITY", + "NETWORK_EMPTY", + "NETWORK_ERR", + "NETWORK_IDLE", + "NETWORK_LOADED", + "NETWORK_LOADING", + "NETWORK_NO_SOURCE", + "NEVER", + "NEW", + "NEXT", + "NEXT_NO_DUPLICATE", + "NICEST", + "NODE_AFTER", + "NODE_BEFORE", + "NODE_BEFORE_AND_AFTER", + "NODE_INSIDE", + "NONE", + "NON_TRANSIENT_ERR", + "NOTATION_NODE", + "NOTCH", + "NOTEQUAL", + "NOT_ALLOWED_ERR", + "NOT_FOUND_ERR", + "NOT_READABLE_ERR", + "NOT_SUPPORTED_ERR", + "NO_DATA_ALLOWED_ERR", + "NO_ERR", + "NO_ERROR", + "NO_MODIFICATION_ALLOWED_ERR", + "NUMBER_TYPE", + "NUM_COMPRESSED_TEXTURE_FORMATS", + "NaN", + "NamedNodeMap", + "Navigator", + "NearbyLinks", + "NetworkInformation", + "Node", + "NodeFilter", + "NodeIterator", + "NodeList", + "Notation", + "Notification", + "NotifyPaintEvent", + "Number", + "NumberFormat", + "OBSOLETE", + "ONE", + "ONE_MINUS_CONSTANT_ALPHA", + "ONE_MINUS_CONSTANT_COLOR", + "ONE_MINUS_DST_ALPHA", + "ONE_MINUS_DST_COLOR", + "ONE_MINUS_SRC_ALPHA", + "ONE_MINUS_SRC_COLOR", + "OPEN", + "OPENED", + "OPENING", + "ORDERED_NODE_ITERATOR_TYPE", + "ORDERED_NODE_SNAPSHOT_TYPE", + "OUT_OF_MEMORY", + "Object", + "OfflineAudioCompletionEvent", + "OfflineAudioContext", + "OfflineResourceList", + "Option", + "OscillatorNode", + "OverflowEvent", + "PACK_ALIGNMENT", + "PAGE_RULE", + "PARSE_ERR", + "PATHSEG_ARC_ABS", + "PATHSEG_ARC_REL", + "PATHSEG_CLOSEPATH", + "PATHSEG_CURVETO_CUBIC_ABS", + "PATHSEG_CURVETO_CUBIC_REL", + "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", + "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", + "PATHSEG_CURVETO_QUADRATIC_ABS", + "PATHSEG_CURVETO_QUADRATIC_REL", + "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", + "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", + "PATHSEG_LINETO_ABS", + "PATHSEG_LINETO_HORIZONTAL_ABS", + "PATHSEG_LINETO_HORIZONTAL_REL", + "PATHSEG_LINETO_REL", + "PATHSEG_LINETO_VERTICAL_ABS", + "PATHSEG_LINETO_VERTICAL_REL", + "PATHSEG_MOVETO_ABS", + "PATHSEG_MOVETO_REL", + "PATHSEG_UNKNOWN", + "PATH_EXISTS_ERR", + "PEAKING", + "PERMISSION_DENIED", + "PERSISTENT", + "PI", + "PLAYING_STATE", + "POINTS", + "POLYGON_OFFSET_FACTOR", + "POLYGON_OFFSET_FILL", + "POLYGON_OFFSET_UNITS", + "POSITION_UNAVAILABLE", + "POSITIVE_INFINITY", + "PREV", + "PREV_NO_DUPLICATE", + "PROCESSING_INSTRUCTION_NODE", + "PageChangeEvent", + "PageTransitionEvent", + "PaintRequest", + "PaintRequestList", + "PannerNode", + "Path2D", + "Performance", + "PerformanceEntry", + "PerformanceMark", + "PerformanceMeasure", + "PerformanceNavigation", + "PerformanceResourceTiming", + "PerformanceTiming", + "PeriodicWave", + "Plugin", + "PluginArray", + "PopStateEvent", + "PopupBlockedEvent", + "ProcessingInstruction", + "ProgressEvent", + "Promise", + "PropertyNodeList", + "Proxy", + "PushManager", + "PushSubscription", + "Q", + "QUOTA_ERR", + "QUOTA_EXCEEDED_ERR", + "QueryInterface", + "READ_ONLY", + "READ_ONLY_ERR", + "READ_WRITE", + "RED_BITS", + "REMOVAL", + "RENDERBUFFER", + "RENDERBUFFER_ALPHA_SIZE", + "RENDERBUFFER_BINDING", + "RENDERBUFFER_BLUE_SIZE", + "RENDERBUFFER_DEPTH_SIZE", + "RENDERBUFFER_GREEN_SIZE", + "RENDERBUFFER_HEIGHT", + "RENDERBUFFER_INTERNAL_FORMAT", + "RENDERBUFFER_RED_SIZE", + "RENDERBUFFER_STENCIL_SIZE", + "RENDERBUFFER_WIDTH", + "RENDERER", + "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", + "RENDERING_INTENT_AUTO", + "RENDERING_INTENT_PERCEPTUAL", + "RENDERING_INTENT_RELATIVE_COLORIMETRIC", + "RENDERING_INTENT_SATURATION", + "RENDERING_INTENT_UNKNOWN", + "REPEAT", + "REPLACE", + "RGB", + "RGB565", + "RGB5_A1", + "RGBA", + "RGBA4", + "RGBColor", + "ROTATION_CLOCKWISE", + "ROTATION_COUNTERCLOCKWISE", + "RTCDataChannelEvent", + "RTCIceCandidate", + "RTCPeerConnectionIceEvent", + "RTCRtpReceiver", + "RTCRtpSender", + "RTCSessionDescription", + "RTCStatsReport", + "RadioNodeList", + "Range", + "RangeError", + "RangeException", + "RecordErrorEvent", + "Rect", + "ReferenceError", + "RegExp", + "Request", + "Response", + "SAMPLER_2D", + "SAMPLER_CUBE", + "SAMPLES", + "SAMPLE_ALPHA_TO_COVERAGE", + "SAMPLE_BUFFERS", + "SAMPLE_COVERAGE", + "SAMPLE_COVERAGE_INVERT", + "SAMPLE_COVERAGE_VALUE", + "SAWTOOTH", + "SCHEDULED_STATE", + "SCISSOR_BOX", + "SCISSOR_TEST", + "SCROLL_PAGE_DOWN", + "SCROLL_PAGE_UP", + "SDP_ANSWER", + "SDP_OFFER", + "SDP_PRANSWER", + "SECURITY_ERR", + "SELECT", + "SERIALIZE_ERR", + "SEVERITY_ERROR", + "SEVERITY_FATAL_ERROR", + "SEVERITY_WARNING", + "SHADER_COMPILER", + "SHADER_TYPE", + "SHADING_LANGUAGE_VERSION", + "SHIFT_MASK", + "SHORT", + "SHOWING", + "SHOW_ALL", + "SHOW_ATTRIBUTE", + "SHOW_CDATA_SECTION", + "SHOW_COMMENT", + "SHOW_DOCUMENT", + "SHOW_DOCUMENT_FRAGMENT", + "SHOW_DOCUMENT_TYPE", + "SHOW_ELEMENT", + "SHOW_ENTITY", + "SHOW_ENTITY_REFERENCE", + "SHOW_NOTATION", + "SHOW_PROCESSING_INSTRUCTION", + "SHOW_TEXT", + "SINE", + "SOUNDFIELD", + "SQLException", + "SQRT1_2", + "SQRT2", + "SQUARE", + "SRC_ALPHA", + "SRC_ALPHA_SATURATE", + "SRC_COLOR", + "START_TO_END", + "START_TO_START", + "STATIC_DRAW", + "STENCIL_ATTACHMENT", + "STENCIL_BACK_FAIL", + "STENCIL_BACK_FUNC", + "STENCIL_BACK_PASS_DEPTH_FAIL", + "STENCIL_BACK_PASS_DEPTH_PASS", + "STENCIL_BACK_REF", + "STENCIL_BACK_VALUE_MASK", + "STENCIL_BACK_WRITEMASK", + "STENCIL_BITS", + "STENCIL_BUFFER_BIT", + "STENCIL_CLEAR_VALUE", + "STENCIL_FAIL", + "STENCIL_FUNC", + "STENCIL_INDEX", + "STENCIL_INDEX8", + "STENCIL_PASS_DEPTH_FAIL", + "STENCIL_PASS_DEPTH_PASS", + "STENCIL_REF", + "STENCIL_TEST", + "STENCIL_VALUE_MASK", + "STENCIL_WRITEMASK", + "STREAM_DRAW", + "STRING_TYPE", + "STYLE_RULE", + "SUBPIXEL_BITS", + "SUPPORTS_RULE", + "SVGAElement", + "SVGAltGlyphDefElement", + "SVGAltGlyphElement", + "SVGAltGlyphItemElement", + "SVGAngle", + "SVGAnimateColorElement", + "SVGAnimateElement", + "SVGAnimateMotionElement", + "SVGAnimateTransformElement", + "SVGAnimatedAngle", + "SVGAnimatedBoolean", + "SVGAnimatedEnumeration", + "SVGAnimatedInteger", + "SVGAnimatedLength", + "SVGAnimatedLengthList", + "SVGAnimatedNumber", + "SVGAnimatedNumberList", + "SVGAnimatedPreserveAspectRatio", + "SVGAnimatedRect", + "SVGAnimatedString", + "SVGAnimatedTransformList", + "SVGAnimationElement", + "SVGCircleElement", + "SVGClipPathElement", + "SVGColor", + "SVGComponentTransferFunctionElement", + "SVGCursorElement", + "SVGDefsElement", + "SVGDescElement", + "SVGDiscardElement", + "SVGDocument", + "SVGElement", + "SVGElementInstance", + "SVGElementInstanceList", + "SVGEllipseElement", + "SVGException", + "SVGFEBlendElement", + "SVGFEColorMatrixElement", + "SVGFEComponentTransferElement", + "SVGFECompositeElement", + "SVGFEConvolveMatrixElement", + "SVGFEDiffuseLightingElement", + "SVGFEDisplacementMapElement", + "SVGFEDistantLightElement", + "SVGFEDropShadowElement", + "SVGFEFloodElement", + "SVGFEFuncAElement", + "SVGFEFuncBElement", + "SVGFEFuncGElement", + "SVGFEFuncRElement", + "SVGFEGaussianBlurElement", + "SVGFEImageElement", + "SVGFEMergeElement", + "SVGFEMergeNodeElement", + "SVGFEMorphologyElement", + "SVGFEOffsetElement", + "SVGFEPointLightElement", + "SVGFESpecularLightingElement", + "SVGFESpotLightElement", + "SVGFETileElement", + "SVGFETurbulenceElement", + "SVGFilterElement", + "SVGFontElement", + "SVGFontFaceElement", + "SVGFontFaceFormatElement", + "SVGFontFaceNameElement", + "SVGFontFaceSrcElement", + "SVGFontFaceUriElement", + "SVGForeignObjectElement", + "SVGGElement", + "SVGGeometryElement", + "SVGGlyphElement", + "SVGGlyphRefElement", + "SVGGradientElement", + "SVGGraphicsElement", + "SVGHKernElement", + "SVGImageElement", + "SVGLength", + "SVGLengthList", + "SVGLineElement", + "SVGLinearGradientElement", + "SVGMPathElement", + "SVGMarkerElement", + "SVGMaskElement", + "SVGMatrix", + "SVGMetadataElement", + "SVGMissingGlyphElement", + "SVGNumber", + "SVGNumberList", + "SVGPaint", + "SVGPathElement", + "SVGPathSeg", + "SVGPathSegArcAbs", + "SVGPathSegArcRel", + "SVGPathSegClosePath", + "SVGPathSegCurvetoCubicAbs", + "SVGPathSegCurvetoCubicRel", + "SVGPathSegCurvetoCubicSmoothAbs", + "SVGPathSegCurvetoCubicSmoothRel", + "SVGPathSegCurvetoQuadraticAbs", + "SVGPathSegCurvetoQuadraticRel", + "SVGPathSegCurvetoQuadraticSmoothAbs", + "SVGPathSegCurvetoQuadraticSmoothRel", + "SVGPathSegLinetoAbs", + "SVGPathSegLinetoHorizontalAbs", + "SVGPathSegLinetoHorizontalRel", + "SVGPathSegLinetoRel", + "SVGPathSegLinetoVerticalAbs", + "SVGPathSegLinetoVerticalRel", + "SVGPathSegList", + "SVGPathSegMovetoAbs", + "SVGPathSegMovetoRel", + "SVGPatternElement", + "SVGPoint", + "SVGPointList", + "SVGPolygonElement", + "SVGPolylineElement", + "SVGPreserveAspectRatio", + "SVGRadialGradientElement", + "SVGRect", + "SVGRectElement", + "SVGRenderingIntent", + "SVGSVGElement", + "SVGScriptElement", + "SVGSetElement", + "SVGStopElement", + "SVGStringList", + "SVGStyleElement", + "SVGSwitchElement", + "SVGSymbolElement", + "SVGTRefElement", + "SVGTSpanElement", + "SVGTextContentElement", + "SVGTextElement", + "SVGTextPathElement", + "SVGTextPositioningElement", + "SVGTitleElement", + "SVGTransform", + "SVGTransformList", + "SVGUnitTypes", + "SVGUseElement", + "SVGVKernElement", + "SVGViewElement", + "SVGViewSpec", + "SVGZoomAndPan", + "SVGZoomEvent", + "SVG_ANGLETYPE_DEG", + "SVG_ANGLETYPE_GRAD", + "SVG_ANGLETYPE_RAD", + "SVG_ANGLETYPE_UNKNOWN", + "SVG_ANGLETYPE_UNSPECIFIED", + "SVG_CHANNEL_A", + "SVG_CHANNEL_B", + "SVG_CHANNEL_G", + "SVG_CHANNEL_R", + "SVG_CHANNEL_UNKNOWN", + "SVG_COLORTYPE_CURRENTCOLOR", + "SVG_COLORTYPE_RGBCOLOR", + "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", + "SVG_COLORTYPE_UNKNOWN", + "SVG_EDGEMODE_DUPLICATE", + "SVG_EDGEMODE_NONE", + "SVG_EDGEMODE_UNKNOWN", + "SVG_EDGEMODE_WRAP", + "SVG_FEBLEND_MODE_COLOR", + "SVG_FEBLEND_MODE_COLOR_BURN", + "SVG_FEBLEND_MODE_COLOR_DODGE", + "SVG_FEBLEND_MODE_DARKEN", + "SVG_FEBLEND_MODE_DIFFERENCE", + "SVG_FEBLEND_MODE_EXCLUSION", + "SVG_FEBLEND_MODE_HARD_LIGHT", + "SVG_FEBLEND_MODE_HUE", + "SVG_FEBLEND_MODE_LIGHTEN", + "SVG_FEBLEND_MODE_LUMINOSITY", + "SVG_FEBLEND_MODE_MULTIPLY", + "SVG_FEBLEND_MODE_NORMAL", + "SVG_FEBLEND_MODE_OVERLAY", + "SVG_FEBLEND_MODE_SATURATION", + "SVG_FEBLEND_MODE_SCREEN", + "SVG_FEBLEND_MODE_SOFT_LIGHT", + "SVG_FEBLEND_MODE_UNKNOWN", + "SVG_FECOLORMATRIX_TYPE_HUEROTATE", + "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", + "SVG_FECOLORMATRIX_TYPE_MATRIX", + "SVG_FECOLORMATRIX_TYPE_SATURATE", + "SVG_FECOLORMATRIX_TYPE_UNKNOWN", + "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", + "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", + "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", + "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", + "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", + "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", + "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", + "SVG_FECOMPOSITE_OPERATOR_ATOP", + "SVG_FECOMPOSITE_OPERATOR_IN", + "SVG_FECOMPOSITE_OPERATOR_OUT", + "SVG_FECOMPOSITE_OPERATOR_OVER", + "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", + "SVG_FECOMPOSITE_OPERATOR_XOR", + "SVG_INVALID_VALUE_ERR", + "SVG_LENGTHTYPE_CM", + "SVG_LENGTHTYPE_EMS", + "SVG_LENGTHTYPE_EXS", + "SVG_LENGTHTYPE_IN", + "SVG_LENGTHTYPE_MM", + "SVG_LENGTHTYPE_NUMBER", + "SVG_LENGTHTYPE_PC", + "SVG_LENGTHTYPE_PERCENTAGE", + "SVG_LENGTHTYPE_PT", + "SVG_LENGTHTYPE_PX", + "SVG_LENGTHTYPE_UNKNOWN", + "SVG_MARKERUNITS_STROKEWIDTH", + "SVG_MARKERUNITS_UNKNOWN", + "SVG_MARKERUNITS_USERSPACEONUSE", + "SVG_MARKER_ORIENT_ANGLE", + "SVG_MARKER_ORIENT_AUTO", + "SVG_MARKER_ORIENT_UNKNOWN", + "SVG_MASKTYPE_ALPHA", + "SVG_MASKTYPE_LUMINANCE", + "SVG_MATRIX_NOT_INVERTABLE", + "SVG_MEETORSLICE_MEET", + "SVG_MEETORSLICE_SLICE", + "SVG_MEETORSLICE_UNKNOWN", + "SVG_MORPHOLOGY_OPERATOR_DILATE", + "SVG_MORPHOLOGY_OPERATOR_ERODE", + "SVG_MORPHOLOGY_OPERATOR_UNKNOWN", + "SVG_PAINTTYPE_CURRENTCOLOR", + "SVG_PAINTTYPE_NONE", + "SVG_PAINTTYPE_RGBCOLOR", + "SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", + "SVG_PAINTTYPE_UNKNOWN", + "SVG_PAINTTYPE_URI", + "SVG_PAINTTYPE_URI_CURRENTCOLOR", + "SVG_PAINTTYPE_URI_NONE", + "SVG_PAINTTYPE_URI_RGBCOLOR", + "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", + "SVG_PRESERVEASPECTRATIO_NONE", + "SVG_PRESERVEASPECTRATIO_UNKNOWN", + "SVG_PRESERVEASPECTRATIO_XMAXYMAX", + "SVG_PRESERVEASPECTRATIO_XMAXYMID", + "SVG_PRESERVEASPECTRATIO_XMAXYMIN", + "SVG_PRESERVEASPECTRATIO_XMIDYMAX", + "SVG_PRESERVEASPECTRATIO_XMIDYMID", + "SVG_PRESERVEASPECTRATIO_XMIDYMIN", + "SVG_PRESERVEASPECTRATIO_XMINYMAX", + "SVG_PRESERVEASPECTRATIO_XMINYMID", + "SVG_PRESERVEASPECTRATIO_XMINYMIN", + "SVG_SPREADMETHOD_PAD", + "SVG_SPREADMETHOD_REFLECT", + "SVG_SPREADMETHOD_REPEAT", + "SVG_SPREADMETHOD_UNKNOWN", + "SVG_STITCHTYPE_NOSTITCH", + "SVG_STITCHTYPE_STITCH", + "SVG_STITCHTYPE_UNKNOWN", + "SVG_TRANSFORM_MATRIX", + "SVG_TRANSFORM_ROTATE", + "SVG_TRANSFORM_SCALE", + "SVG_TRANSFORM_SKEWX", + "SVG_TRANSFORM_SKEWY", + "SVG_TRANSFORM_TRANSLATE", + "SVG_TRANSFORM_UNKNOWN", + "SVG_TURBULENCE_TYPE_FRACTALNOISE", + "SVG_TURBULENCE_TYPE_TURBULENCE", + "SVG_TURBULENCE_TYPE_UNKNOWN", + "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", + "SVG_UNIT_TYPE_UNKNOWN", + "SVG_UNIT_TYPE_USERSPACEONUSE", + "SVG_WRONG_TYPE_ERR", + "SVG_ZOOMANDPAN_DISABLE", + "SVG_ZOOMANDPAN_MAGNIFY", + "SVG_ZOOMANDPAN_UNKNOWN", + "SYNTAX_ERR", + "SavedPages", + "Screen", + "ScreenOrientation", + "Script", + "ScriptProcessorNode", + "ScrollAreaEvent", + "SecurityPolicyViolationEvent", + "Selection", + "ServiceWorker", + "ServiceWorkerContainer", + "ServiceWorkerRegistration", + "SessionDescription", + "Set", + "ShadowRoot", + "SharedWorker", + "SimpleGestureEvent", + "SpeechSynthesisEvent", + "SpeechSynthesisUtterance", + "StopIteration", + "Storage", + "StorageEvent", + "String", + "StyleSheet", + "StyleSheetList", + "SubtleCrypto", + "Symbol", + "SyntaxError", + "TEMPORARY", + "TEXTPATH_METHODTYPE_ALIGN", + "TEXTPATH_METHODTYPE_STRETCH", + "TEXTPATH_METHODTYPE_UNKNOWN", + "TEXTPATH_SPACINGTYPE_AUTO", + "TEXTPATH_SPACINGTYPE_EXACT", + "TEXTPATH_SPACINGTYPE_UNKNOWN", + "TEXTURE", + "TEXTURE0", + "TEXTURE1", + "TEXTURE10", + "TEXTURE11", + "TEXTURE12", + "TEXTURE13", + "TEXTURE14", + "TEXTURE15", + "TEXTURE16", + "TEXTURE17", + "TEXTURE18", + "TEXTURE19", + "TEXTURE2", + "TEXTURE20", + "TEXTURE21", + "TEXTURE22", + "TEXTURE23", + "TEXTURE24", + "TEXTURE25", + "TEXTURE26", + "TEXTURE27", + "TEXTURE28", + "TEXTURE29", + "TEXTURE3", + "TEXTURE30", + "TEXTURE31", + "TEXTURE4", + "TEXTURE5", + "TEXTURE6", + "TEXTURE7", + "TEXTURE8", + "TEXTURE9", + "TEXTURE_2D", + "TEXTURE_BINDING_2D", + "TEXTURE_BINDING_CUBE_MAP", + "TEXTURE_CUBE_MAP", + "TEXTURE_CUBE_MAP_NEGATIVE_X", + "TEXTURE_CUBE_MAP_NEGATIVE_Y", + "TEXTURE_CUBE_MAP_NEGATIVE_Z", + "TEXTURE_CUBE_MAP_POSITIVE_X", + "TEXTURE_CUBE_MAP_POSITIVE_Y", + "TEXTURE_CUBE_MAP_POSITIVE_Z", + "TEXTURE_MAG_FILTER", + "TEXTURE_MAX_ANISOTROPY_EXT", + "TEXTURE_MIN_FILTER", + "TEXTURE_WRAP_S", + "TEXTURE_WRAP_T", + "TEXT_NODE", + "TIMEOUT", + "TIMEOUT_ERR", + "TOO_LARGE_ERR", + "TRANSACTION_INACTIVE_ERR", + "TRIANGLE", + "TRIANGLES", + "TRIANGLE_FAN", + "TRIANGLE_STRIP", + "TYPE_BACK_FORWARD", + "TYPE_ERR", + "TYPE_MISMATCH_ERR", + "TYPE_NAVIGATE", + "TYPE_RELOAD", + "TYPE_RESERVED", + "Text", + "TextDecoder", + "TextEncoder", + "TextEvent", + "TextMetrics", + "TextTrack", + "TextTrackCue", + "TextTrackCueList", + "TextTrackList", + "TimeEvent", + "TimeRanges", + "Touch", + "TouchEvent", + "TouchList", + "TrackEvent", + "TransitionEvent", + "TreeWalker", + "TypeError", + "UIEvent", + "UNCACHED", + "UNKNOWN_ERR", + "UNKNOWN_RULE", + "UNMASKED_RENDERER_WEBGL", + "UNMASKED_VENDOR_WEBGL", + "UNORDERED_NODE_ITERATOR_TYPE", + "UNORDERED_NODE_SNAPSHOT_TYPE", + "UNPACK_ALIGNMENT", + "UNPACK_COLORSPACE_CONVERSION_WEBGL", + "UNPACK_FLIP_Y_WEBGL", + "UNPACK_PREMULTIPLY_ALPHA_WEBGL", + "UNSCHEDULED_STATE", + "UNSENT", + "UNSIGNED_BYTE", + "UNSIGNED_INT", + "UNSIGNED_SHORT", + "UNSIGNED_SHORT_4_4_4_4", + "UNSIGNED_SHORT_5_5_5_1", + "UNSIGNED_SHORT_5_6_5", + "UNSPECIFIED_EVENT_TYPE_ERR", + "UPDATEREADY", + "URIError", + "URL", + "URLSearchParams", + "URLUnencoded", + "URL_MISMATCH_ERR", + "UTC", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "UserMessageHandler", + "UserMessageHandlersNamespace", + "UserProximityEvent", + "VALIDATE_STATUS", + "VALIDATION_ERR", + "VARIABLES_RULE", + "VENDOR", + "VERSION", + "VERSION_CHANGE", + "VERSION_ERR", + "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", + "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", + "VERTEX_ATTRIB_ARRAY_ENABLED", + "VERTEX_ATTRIB_ARRAY_NORMALIZED", + "VERTEX_ATTRIB_ARRAY_POINTER", + "VERTEX_ATTRIB_ARRAY_SIZE", + "VERTEX_ATTRIB_ARRAY_STRIDE", + "VERTEX_ATTRIB_ARRAY_TYPE", + "VERTEX_SHADER", + "VERTICAL", + "VERTICAL_AXIS", + "VER_ERR", + "VIEWPORT", + "VIEWPORT_RULE", + "VTTCue", + "VTTRegion", + "ValidityState", + "VideoStreamTrack", + "WEBKIT_FILTER_RULE", + "WEBKIT_KEYFRAMES_RULE", + "WEBKIT_KEYFRAME_RULE", + "WEBKIT_REGION_RULE", + "WRONG_DOCUMENT_ERR", + "WaveShaperNode", + "WeakMap", + "WeakSet", + "WebGLActiveInfo", + "WebGLBuffer", + "WebGLContextEvent", + "WebGLFramebuffer", + "WebGLProgram", + "WebGLRenderbuffer", + "WebGLRenderingContext", + "WebGLShader", + "WebGLShaderPrecisionFormat", + "WebGLTexture", + "WebGLUniformLocation", + "WebGLVertexArray", + "WebKitAnimationEvent", + "WebKitBlobBuilder", + "WebKitCSSFilterRule", + "WebKitCSSFilterValue", + "WebKitCSSKeyframeRule", + "WebKitCSSKeyframesRule", + "WebKitCSSMatrix", + "WebKitCSSRegionRule", + "WebKitCSSTransformValue", + "WebKitDataCue", + "WebKitGamepad", + "WebKitMediaKeyError", + "WebKitMediaKeyMessageEvent", + "WebKitMediaKeySession", + "WebKitMediaKeys", + "WebKitMediaSource", + "WebKitMutationObserver", + "WebKitNamespace", + "WebKitPlaybackTargetAvailabilityEvent", + "WebKitPoint", + "WebKitShadowRoot", + "WebKitSourceBuffer", + "WebKitSourceBufferList", + "WebKitTransitionEvent", + "WebSocket", + "WheelEvent", + "Window", + "Worker", + "XMLDocument", + "XMLHttpRequest", + "XMLHttpRequestEventTarget", + "XMLHttpRequestException", + "XMLHttpRequestProgressEvent", + "XMLHttpRequestUpload", + "XMLSerializer", + "XMLStylesheetProcessingInstruction", + "XPathEvaluator", + "XPathException", + "XPathExpression", + "XPathNSResolver", + "XPathResult", + "XSLTProcessor", + "ZERO", + "_XD0M_", + "_YD0M_", + "__defineGetter__", + "__defineSetter__", + "__lookupGetter__", + "__lookupSetter__", + "__opera", + "__proto__", + "_browserjsran", + "a", + "aLink", + "abbr", + "abort", + "abs", + "absolute", + "acceleration", + "accelerationIncludingGravity", + "accelerator", + "accept", + "acceptCharset", + "acceptNode", + "accessKey", + "accessKeyLabel", + "accuracy", + "acos", + "acosh", + "action", + "actionURL", + "active", + "activeCues", + "activeElement", + "activeSourceBuffers", + "activeSourceCount", + "activeTexture", + "add", + "addBehavior", + "addCandidate", + "addColorStop", + "addCue", + "addElement", + "addEventListener", + "addFilter", + "addFromString", + "addFromUri", + "addIceCandidate", + "addImport", + "addListener", + "addNamed", + "addPageRule", + "addPath", + "addPointer", + "addRange", + "addRegion", + "addRule", + "addSearchEngine", + "addSourceBuffer", + "addStream", + "addTextTrack", + "addTrack", + "addWakeLockListener", + "addedNodes", + "additionalName", + "additiveSymbols", + "addons", + "adoptNode", + "adr", + "advance", + "alert", + "algorithm", + "align", + "align-content", + "align-items", + "align-self", + "alignContent", + "alignItems", + "alignSelf", + "alignmentBaseline", + "alinkColor", + "all", + "allowFullscreen", + "allowedDirections", + "alpha", + "alt", + "altGraphKey", + "altHtml", + "altKey", + "altLeft", + "altitude", + "altitudeAccuracy", + "amplitude", + "ancestorOrigins", + "anchor", + "anchorNode", + "anchorOffset", + "anchors", + "angle", + "animVal", + "animate", + "animatedInstanceRoot", + "animatedNormalizedPathSegList", + "animatedPathSegList", + "animatedPoints", + "animation", + "animation-delay", + "animation-direction", + "animation-duration", + "animation-fill-mode", + "animation-iteration-count", + "animation-name", + "animation-play-state", + "animation-timing-function", + "animationDelay", + "animationDirection", + "animationDuration", + "animationFillMode", + "animationIterationCount", + "animationName", + "animationPlayState", + "animationStartTime", + "animationTimingFunction", + "animationsPaused", + "anniversary", + "app", + "appCodeName", + "appMinorVersion", + "appName", + "appNotifications", + "appVersion", + "append", + "appendBuffer", + "appendChild", + "appendData", + "appendItem", + "appendMedium", + "appendNamed", + "appendRule", + "appendStream", + "appendWindowEnd", + "appendWindowStart", + "applets", + "applicationCache", + "apply", + "applyElement", + "arc", + "arcTo", + "archive", + "areas", + "arguments", + "arrayBuffer", + "asin", + "asinh", + "assert", + "assign", + "async", + "atEnd", + "atan", + "atan2", + "atanh", + "atob", + "attachEvent", + "attachShader", + "attachments", + "attack", + "attrChange", + "attrName", + "attributeName", + "attributeNamespace", + "attributes", + "audioTracks", + "autoIncrement", + "autobuffer", + "autocapitalize", + "autocomplete", + "autocorrect", + "autofocus", + "autoplay", + "availHeight", + "availLeft", + "availTop", + "availWidth", + "availability", + "available", + "aversion", + "axes", + "axis", + "azimuth", + "b", + "back", + "backface-visibility", + "backfaceVisibility", + "background", + "background-attachment", + "background-blend-mode", + "background-clip", + "background-color", + "background-image", + "background-origin", + "background-position", + "background-repeat", + "background-size", + "backgroundAttachment", + "backgroundBlendMode", + "backgroundClip", + "backgroundColor", + "backgroundImage", + "backgroundOrigin", + "backgroundPosition", + "backgroundPositionX", + "backgroundPositionY", + "backgroundRepeat", + "backgroundSize", + "badInput", + "balance", + "baseFrequencyX", + "baseFrequencyY", + "baseNode", + "baseOffset", + "baseURI", + "baseVal", + "baselineShift", + "battery", + "bday", + "beginElement", + "beginElementAt", + "beginPath", + "behavior", + "behaviorCookie", + "behaviorPart", + "behaviorUrns", + "beta", + "bezierCurveTo", + "bgColor", + "bgProperties", + "bias", + "big", + "binaryType", + "bind", + "bindAttribLocation", + "bindBuffer", + "bindFramebuffer", + "bindRenderbuffer", + "bindTexture", + "blendColor", + "blendEquation", + "blendEquationSeparate", + "blendFunc", + "blendFuncSeparate", + "blink", + "blob", + "blockDirection", + "blue", + "blur", + "body", + "bodyUsed", + "bold", + "bookmarks", + "booleanValue", + "border", + "border-bottom", + "border-bottom-color", + "border-bottom-left-radius", + "border-bottom-right-radius", + "border-bottom-style", + "border-bottom-width", + "border-collapse", + "border-color", + "border-image", + "border-image-outset", + "border-image-repeat", + "border-image-slice", + "border-image-source", + "border-image-width", + "border-left", + "border-left-color", + "border-left-style", + "border-left-width", + "border-radius", + "border-right", + "border-right-color", + "border-right-style", + "border-right-width", + "border-spacing", + "border-style", + "border-top", + "border-top-color", + "border-top-left-radius", + "border-top-right-radius", + "border-top-style", + "border-top-width", + "border-width", + "borderBottom", + "borderBottomColor", + "borderBottomLeftRadius", + "borderBottomRightRadius", + "borderBottomStyle", + "borderBottomWidth", + "borderCollapse", + "borderColor", + "borderColorDark", + "borderColorLight", + "borderImage", + "borderImageOutset", + "borderImageRepeat", + "borderImageSlice", + "borderImageSource", + "borderImageWidth", + "borderLeft", + "borderLeftColor", + "borderLeftStyle", + "borderLeftWidth", + "borderRadius", + "borderRight", + "borderRightColor", + "borderRightStyle", + "borderRightWidth", + "borderSpacing", + "borderStyle", + "borderTop", + "borderTopColor", + "borderTopLeftRadius", + "borderTopRightRadius", + "borderTopStyle", + "borderTopWidth", + "borderWidth", + "bottom", + "bottomMargin", + "bound", + "boundElements", + "boundingClientRect", + "boundingHeight", + "boundingLeft", + "boundingTop", + "boundingWidth", + "bounds", + "box-decoration-break", + "box-shadow", + "box-sizing", + "boxDecorationBreak", + "boxShadow", + "boxSizing", + "breakAfter", + "breakBefore", + "breakInside", + "browserLanguage", + "btoa", + "bubbles", + "buffer", + "bufferData", + "bufferDepth", + "bufferSize", + "bufferSubData", + "buffered", + "bufferedAmount", + "buildID", + "buildNumber", + "button", + "buttonID", + "buttons", + "byteLength", + "byteOffset", + "c", + "call", + "caller", + "canBeFormatted", + "canBeMounted", + "canBeShared", + "canHaveChildren", + "canHaveHTML", + "canPlayType", + "cancel", + "cancelAnimationFrame", + "cancelBubble", + "cancelScheduledValues", + "cancelable", + "candidate", + "canvas", + "caption", + "caption-side", + "captionSide", + "captureEvents", + "captureStackTrace", + "caretPositionFromPoint", + "caretRangeFromPoint", + "cast", + "catch", + "category", + "cbrt", + "cd", + "ceil", + "cellIndex", + "cellPadding", + "cellSpacing", + "cells", + "ch", + "chOff", + "chain", + "challenge", + "changedTouches", + "channel", + "channelCount", + "channelCountMode", + "channelInterpretation", + "char", + "charAt", + "charCode", + "charCodeAt", + "charIndex", + "characterSet", + "charging", + "chargingTime", + "charset", + "checkEnclosure", + "checkFramebufferStatus", + "checkIntersection", + "checkValidity", + "checked", + "childElementCount", + "childNodes", + "children", + "chrome", + "ciphertext", + "cite", + "classList", + "className", + "classid", + "clear", + "clearAttributes", + "clearColor", + "clearData", + "clearDepth", + "clearImmediate", + "clearInterval", + "clearMarks", + "clearMeasures", + "clearParameters", + "clearRect", + "clearResourceTimings", + "clearShadow", + "clearStencil", + "clearTimeout", + "clearWatch", + "click", + "clickCount", + "clientHeight", + "clientInformation", + "clientLeft", + "clientRect", + "clientRects", + "clientTop", + "clientWidth", + "clientX", + "clientY", + "clip", + "clip-path", + "clip-rule", + "clipBottom", + "clipLeft", + "clipPath", + "clipPathUnits", + "clipRight", + "clipRule", + "clipTop", + "clipboardData", + "clone", + "cloneContents", + "cloneNode", + "cloneRange", + "close", + "closePath", + "closed", + "closest", + "clz", + "clz32", + "cmp", + "code", + "codeBase", + "codePointAt", + "codeType", + "colSpan", + "collapse", + "collapseToEnd", + "collapseToStart", + "collapsed", + "collect", + "colno", + "color", + "color-interpolation", + "color-interpolation-filters", + "colorDepth", + "colorInterpolation", + "colorInterpolationFilters", + "colorMask", + "colorType", + "cols", + "columnCount", + "columnFill", + "columnGap", + "columnNumber", + "columnRule", + "columnRuleColor", + "columnRuleStyle", + "columnRuleWidth", + "columnSpan", + "columnWidth", + "columns", + "command", + "commitPreferences", + "commonAncestorContainer", + "compact", + "compareBoundaryPoints", + "compareDocumentPosition", + "compareEndPoints", + "compareNode", + "comparePoint", + "compatMode", + "compatible", + "compile", + "compileShader", + "complete", + "componentFromPoint", + "compositionEndOffset", + "compositionStartOffset", + "compressedTexImage2D", + "compressedTexSubImage2D", + "concat", + "conditionText", + "coneInnerAngle", + "coneOuterAngle", + "coneOuterGain", + "confirm", + "confirmComposition", + "confirmSiteSpecificTrackingException", + "confirmWebWideTrackingException", + "connect", + "connectEnd", + "connectStart", + "connected", + "connection", + "connectionSpeed", + "console", + "consolidate", + "constrictionActive", + "constructor", + "contactID", + "contains", + "containsNode", + "content", + "contentDocument", + "contentEditable", + "contentOverflow", + "contentScriptType", + "contentStyleType", + "contentType", + "contentWindow", + "context", + "contextMenu", + "contextmenu", + "continue", + "continuous", + "control", + "controller", + "controls", + "convertToSpecifiedUnits", + "cookie", + "cookieEnabled", + "coords", + "copyFromChannel", + "copyTexImage2D", + "copyTexSubImage2D", + "copyToChannel", + "copyWithin", + "correspondingElement", + "correspondingUseElement", + "cos", + "cosh", + "count", + "counter-increment", + "counter-reset", + "counterIncrement", + "counterReset", + "cpuClass", + "cpuSleepAllowed", + "create", + "createAnalyser", + "createAnswer", + "createAttribute", + "createAttributeNS", + "createBiquadFilter", + "createBuffer", + "createBufferSource", + "createCDATASection", + "createCSSStyleSheet", + "createCaption", + "createChannelMerger", + "createChannelSplitter", + "createComment", + "createContextualFragment", + "createControlRange", + "createConvolver", + "createDTMFSender", + "createDataChannel", + "createDelay", + "createDelayNode", + "createDocument", + "createDocumentFragment", + "createDocumentType", + "createDynamicsCompressor", + "createElement", + "createElementNS", + "createEntityReference", + "createEvent", + "createEventObject", + "createExpression", + "createFramebuffer", + "createFunction", + "createGain", + "createGainNode", + "createHTMLDocument", + "createImageBitmap", + "createImageData", + "createIndex", + "createJavaScriptNode", + "createLinearGradient", + "createMediaElementSource", + "createMediaKeys", + "createMediaStreamDestination", + "createMediaStreamSource", + "createMutableFile", + "createNSResolver", + "createNodeIterator", + "createNotification", + "createObjectStore", + "createObjectURL", + "createOffer", + "createOscillator", + "createPanner", + "createPattern", + "createPeriodicWave", + "createPopup", + "createProcessingInstruction", + "createProgram", + "createRadialGradient", + "createRange", + "createRangeCollection", + "createRenderbuffer", + "createSVGAngle", + "createSVGLength", + "createSVGMatrix", + "createSVGNumber", + "createSVGPathSegArcAbs", + "createSVGPathSegArcRel", + "createSVGPathSegClosePath", + "createSVGPathSegCurvetoCubicAbs", + "createSVGPathSegCurvetoCubicRel", + "createSVGPathSegCurvetoCubicSmoothAbs", + "createSVGPathSegCurvetoCubicSmoothRel", + "createSVGPathSegCurvetoQuadraticAbs", + "createSVGPathSegCurvetoQuadraticRel", + "createSVGPathSegCurvetoQuadraticSmoothAbs", + "createSVGPathSegCurvetoQuadraticSmoothRel", + "createSVGPathSegLinetoAbs", + "createSVGPathSegLinetoHorizontalAbs", + "createSVGPathSegLinetoHorizontalRel", + "createSVGPathSegLinetoRel", + "createSVGPathSegLinetoVerticalAbs", + "createSVGPathSegLinetoVerticalRel", + "createSVGPathSegMovetoAbs", + "createSVGPathSegMovetoRel", + "createSVGPoint", + "createSVGRect", + "createSVGTransform", + "createSVGTransformFromMatrix", + "createScriptProcessor", + "createSession", + "createShader", + "createShadowRoot", + "createStereoPanner", + "createStyleSheet", + "createTBody", + "createTFoot", + "createTHead", + "createTextNode", + "createTextRange", + "createTexture", + "createTouch", + "createTouchList", + "createTreeWalker", + "createWaveShaper", + "creationTime", + "crossOrigin", + "crypto", + "csi", + "cssFloat", + "cssRules", + "cssText", + "cssValueType", + "ctrlKey", + "ctrlLeft", + "cues", + "cullFace", + "currentNode", + "currentPage", + "currentScale", + "currentScript", + "currentSrc", + "currentState", + "currentStyle", + "currentTarget", + "currentTime", + "currentTranslate", + "currentView", + "cursor", + "curve", + "customError", + "cx", + "cy", + "d", + "data", + "dataFld", + "dataFormatAs", + "dataPageSize", + "dataSrc", + "dataTransfer", + "database", + "dataset", + "dateTime", + "db", + "debug", + "debuggerEnabled", + "declare", + "decode", + "decodeAudioData", + "decodeURI", + "decodeURIComponent", + "decrypt", + "default", + "defaultCharset", + "defaultChecked", + "defaultMuted", + "defaultPlaybackRate", + "defaultPrevented", + "defaultSelected", + "defaultStatus", + "defaultURL", + "defaultValue", + "defaultView", + "defaultstatus", + "defer", + "defineMagicFunction", + "defineMagicVariable", + "defineProperties", + "defineProperty", + "delayTime", + "delete", + "deleteBuffer", + "deleteCaption", + "deleteCell", + "deleteContents", + "deleteData", + "deleteDatabase", + "deleteFramebuffer", + "deleteFromDocument", + "deleteIndex", + "deleteMedium", + "deleteObjectStore", + "deleteProgram", + "deleteRenderbuffer", + "deleteRow", + "deleteRule", + "deleteShader", + "deleteTFoot", + "deleteTHead", + "deleteTexture", + "deliverChangeRecords", + "delivery", + "deliveryInfo", + "deliveryStatus", + "deliveryTimestamp", + "delta", + "deltaMode", + "deltaX", + "deltaY", + "deltaZ", + "depthFunc", + "depthMask", + "depthRange", + "deriveBits", + "deriveKey", + "description", + "deselectAll", + "designMode", + "destination", + "destinationURL", + "detach", + "detachEvent", + "detachShader", + "detail", + "detune", + "devicePixelRatio", + "deviceXDPI", + "deviceYDPI", + "diffuseConstant", + "digest", + "dimensions", + "dir", + "dirName", + "direction", + "dirxml", + "disable", + "disableVertexAttribArray", + "disabled", + "dischargingTime", + "disconnect", + "dispatchEvent", + "display", + "distanceModel", + "divisor", + "djsapi", + "djsproxy", + "doImport", + "doNotTrack", + "doScroll", + "doctype", + "document", + "documentElement", + "documentMode", + "documentURI", + "dolphin", + "dolphinGameCenter", + "dolphininfo", + "dolphinmeta", + "domComplete", + "domContentLoadedEventEnd", + "domContentLoadedEventStart", + "domInteractive", + "domLoading", + "domain", + "domainLookupEnd", + "domainLookupStart", + "dominant-baseline", + "dominantBaseline", + "done", + "dopplerFactor", + "download", + "dragDrop", + "draggable", + "drawArrays", + "drawArraysInstancedANGLE", + "drawCustomFocusRing", + "drawElements", + "drawElementsInstancedANGLE", + "drawFocusIfNeeded", + "drawImage", + "drawImageFromRect", + "drawSystemFocusRing", + "drawingBufferHeight", + "drawingBufferWidth", + "dropEffect", + "droppedVideoFrames", + "dropzone", + "dump", + "duplicate", + "duration", + "dvname", + "dvnum", + "dx", + "dy", + "dynsrc", + "e", + "edgeMode", + "effectAllowed", + "elapsedTime", + "elementFromPoint", + "elements", + "elevation", + "ellipse", + "email", + "embeds", + "empty", + "empty-cells", + "emptyCells", + "enable", + "enableBackground", + "enableStyleSheetsForSet", + "enableVertexAttribArray", + "enabled", + "enabledPlugin", + "encode", + "encodeURI", + "encodeURIComponent", + "encoding", + "encrypt", + "enctype", + "end", + "endContainer", + "endElement", + "endElementAt", + "endOfStream", + "endOffset", + "endTime", + "ended", + "endsWith", + "entities", + "entries", + "entryType", + "enumerate", + "enumerateEditable", + "error", + "errorCode", + "escape", + "eval", + "evaluate", + "event", + "eventPhase", + "every", + "exception", + "exec", + "execCommand", + "execCommandShowHelp", + "execScript", + "exitFullscreen", + "exitPointerLock", + "exp", + "expand", + "expandEntityReferences", + "expando", + "expansion", + "expiryDate", + "explicitOriginalTarget", + "expm1", + "exponent", + "exponentialRampToValueAtTime", + "exportKey", + "extend", + "extensions", + "extentNode", + "extentOffset", + "external", + "externalResourcesRequired", + "extractContents", + "extractable", + "f", + "face", + "factoryReset", + "fallback", + "familyName", + "farthestViewportElement", + "fastSeek", + "fatal", + "fetch", + "fetchStart", + "fftSize", + "fgColor", + "fileCreatedDate", + "fileHandle", + "fileModifiedDate", + "fileName", + "fileSize", + "fileUpdatedDate", + "filename", + "files", + "fill", + "fill-opacity", + "fill-rule", + "fillOpacity", + "fillRect", + "fillRule", + "fillStyle", + "fillText", + "filter", + "filterResX", + "filterResY", + "filterUnits", + "filters", + "find", + "findIndex", + "findRule", + "findText", + "finish", + "fireEvent", + "firstChild", + "firstElementChild", + "firstPage", + "fixed", + "flex", + "flex-basis", + "flex-direction", + "flex-flow", + "flex-grow", + "flex-shrink", + "flex-wrap", + "flexBasis", + "flexDirection", + "flexFlow", + "flexGrow", + "flexShrink", + "flexWrap", + "flipX", + "flipY", + "float", + "flood-color", + "flood-opacity", + "floodColor", + "floodOpacity", + "floor", + "flush", + "focus", + "focusNode", + "focusOffset", + "font", + "font-family", + "font-feature-settings", + "font-kerning", + "font-language-override", + "font-size", + "font-size-adjust", + "font-stretch", + "font-style", + "font-synthesis", + "font-variant", + "font-variant-alternates", + "font-variant-caps", + "font-variant-east-asian", + "font-variant-ligatures", + "font-variant-numeric", + "font-variant-position", + "font-weight", + "fontFamily", + "fontFeatureSettings", + "fontKerning", + "fontLanguageOverride", + "fontSize", + "fontSizeAdjust", + "fontSmoothingEnabled", + "fontStretch", + "fontStyle", + "fontSynthesis", + "fontVariant", + "fontVariantAlternates", + "fontVariantCaps", + "fontVariantEastAsian", + "fontVariantLigatures", + "fontVariantNumeric", + "fontVariantPosition", + "fontWeight", + "fontcolor", + "fonts", + "fontsize", + "for", + "forEach", + "forceRedraw", + "form", + "formAction", + "formEnctype", + "formMethod", + "formNoValidate", + "formTarget", + "format", + "forms", + "forward", + "fr", + "frame", + "frameBorder", + "frameElement", + "frameSpacing", + "framebufferRenderbuffer", + "framebufferTexture2D", + "frames", + "freeSpace", + "freeze", + "frequency", + "frequencyBinCount", + "from", + "fromCharCode", + "fromCodePoint", + "fromElement", + "frontFace", + "fround", + "fullScreen", + "fullscreenElement", + "fullscreenEnabled", + "fx", + "fy", + "gain", + "gamepad", + "gamma", + "genderIdentity", + "generateKey", + "generateMipmap", + "generateRequest", + "geolocation", + "gestureObject", + "get", + "getActiveAttrib", + "getActiveUniform", + "getAdjacentText", + "getAll", + "getAllResponseHeaders", + "getAsFile", + "getAsString", + "getAttachedShaders", + "getAttribLocation", + "getAttribute", + "getAttributeNS", + "getAttributeNode", + "getAttributeNodeNS", + "getAudioTracks", + "getBBox", + "getBattery", + "getBlob", + "getBookmark", + "getBoundingClientRect", + "getBufferParameter", + "getByteFrequencyData", + "getByteTimeDomainData", + "getCSSCanvasContext", + "getCTM", + "getCandidateWindowClientRect", + "getChannelData", + "getCharNumAtPosition", + "getClientRect", + "getClientRects", + "getCompositionAlternatives", + "getComputedStyle", + "getComputedTextLength", + "getConfiguration", + "getContext", + "getContextAttributes", + "getCounterValue", + "getCueAsHTML", + "getCueById", + "getCurrentPosition", + "getCurrentTime", + "getData", + "getDatabaseNames", + "getDate", + "getDay", + "getDefaultComputedStyle", + "getDestinationInsertionPoints", + "getDistributedNodes", + "getEditable", + "getElementById", + "getElementsByClassName", + "getElementsByName", + "getElementsByTagName", + "getElementsByTagNameNS", + "getEnclosureList", + "getEndPositionOfChar", + "getEntries", + "getEntriesByName", + "getEntriesByType", + "getError", + "getExtension", + "getExtentOfChar", + "getFeature", + "getFile", + "getFloat32", + "getFloat64", + "getFloatFrequencyData", + "getFloatTimeDomainData", + "getFloatValue", + "getFramebufferAttachmentParameter", + "getFrequencyResponse", + "getFullYear", + "getGamepads", + "getHours", + "getImageData", + "getInt16", + "getInt32", + "getInt8", + "getIntersectionList", + "getItem", + "getItems", + "getKey", + "getLineDash", + "getLocalStreams", + "getMarks", + "getMatchedCSSRules", + "getMeasures", + "getMetadata", + "getMilliseconds", + "getMinutes", + "getModifierState", + "getMonth", + "getNamedItem", + "getNamedItemNS", + "getNotifier", + "getNumberOfChars", + "getOverrideHistoryNavigationMode", + "getOverrideStyle", + "getOwnPropertyDescriptor", + "getOwnPropertyNames", + "getOwnPropertySymbols", + "getParameter", + "getPathSegAtLength", + "getPointAtLength", + "getPreference", + "getPreferenceDefault", + "getPresentationAttribute", + "getPreventDefault", + "getProgramInfoLog", + "getProgramParameter", + "getPropertyCSSValue", + "getPropertyPriority", + "getPropertyShorthand", + "getPropertyValue", + "getPrototypeOf", + "getRGBColorValue", + "getRandomValues", + "getRangeAt", + "getReceivers", + "getRectValue", + "getRegistration", + "getRemoteStreams", + "getRenderbufferParameter", + "getResponseHeader", + "getRoot", + "getRotationOfChar", + "getSVGDocument", + "getScreenCTM", + "getSeconds", + "getSelection", + "getSenders", + "getShaderInfoLog", + "getShaderParameter", + "getShaderPrecisionFormat", + "getShaderSource", + "getSimpleDuration", + "getSiteIcons", + "getSources", + "getSpeculativeParserUrls", + "getStartPositionOfChar", + "getStartTime", + "getStats", + "getStorageUpdates", + "getStreamById", + "getStringValue", + "getSubStringLength", + "getSubscription", + "getSupportedExtensions", + "getTexParameter", + "getTime", + "getTimezoneOffset", + "getTotalLength", + "getTrackById", + "getTracks", + "getTransformToElement", + "getUTCDate", + "getUTCDay", + "getUTCFullYear", + "getUTCHours", + "getUTCMilliseconds", + "getUTCMinutes", + "getUTCMonth", + "getUTCSeconds", + "getUint16", + "getUint32", + "getUint8", + "getUniform", + "getUniformLocation", + "getUserMedia", + "getValues", + "getVarDate", + "getVariableValue", + "getVertexAttrib", + "getVertexAttribOffset", + "getVideoPlaybackQuality", + "getVideoTracks", + "getWakeLockState", + "getYear", + "givenName", + "global", + "globalAlpha", + "globalCompositeOperation", + "glyphOrientationHorizontal", + "glyphOrientationVertical", + "glyphRef", + "go", + "gradientTransform", + "gradientUnits", + "grammars", + "green", + "group", + "groupCollapsed", + "groupEnd", + "hardwareConcurrency", + "has", + "hasAttribute", + "hasAttributeNS", + "hasAttributes", + "hasChildNodes", + "hasComposition", + "hasExtension", + "hasFeature", + "hasFocus", + "hasLayout", + "hasOwnProperty", + "hash", + "head", + "headers", + "heading", + "height", + "hidden", + "hide", + "hideFocus", + "high", + "hint", + "history", + "honorificPrefix", + "honorificSuffix", + "horizontalOverflow", + "host", + "hostname", + "href", + "hreflang", + "hspace", + "html5TagCheckInerface", + "htmlFor", + "htmlText", + "httpEquiv", + "hwTimestamp", + "hypot", + "iccId", + "iceConnectionState", + "iceGatheringState", + "icon", + "id", + "identifier", + "identity", + "ignoreBOM", + "ignoreCase", + "image-orientation", + "image-rendering", + "imageOrientation", + "imageRendering", + "images", + "ime-mode", + "imeMode", + "implementation", + "importKey", + "importNode", + "importStylesheet", + "imports", + "impp", + "imul", + "in1", + "in2", + "inBandMetadataTrackDispatchType", + "inRange", + "includes", + "incremental", + "indeterminate", + "index", + "indexNames", + "indexOf", + "indexedDB", + "inertiaDestinationX", + "inertiaDestinationY", + "info", + "init", + "initAnimationEvent", + "initBeforeLoadEvent", + "initClipboardEvent", + "initCloseEvent", + "initCommandEvent", + "initCompositionEvent", + "initCustomEvent", + "initData", + "initDeviceMotionEvent", + "initDeviceOrientationEvent", + "initDragEvent", + "initErrorEvent", + "initEvent", + "initFocusEvent", + "initGestureEvent", + "initHashChangeEvent", + "initKeyEvent", + "initKeyboardEvent", + "initMSManipulationEvent", + "initMessageEvent", + "initMouseEvent", + "initMouseScrollEvent", + "initMouseWheelEvent", + "initMutationEvent", + "initNSMouseEvent", + "initOverflowEvent", + "initPageEvent", + "initPageTransitionEvent", + "initPointerEvent", + "initPopStateEvent", + "initProgressEvent", + "initScrollAreaEvent", + "initSimpleGestureEvent", + "initStorageEvent", + "initTextEvent", + "initTimeEvent", + "initTouchEvent", + "initTransitionEvent", + "initUIEvent", + "initWebKitAnimationEvent", + "initWebKitTransitionEvent", + "initWebKitWheelEvent", + "initWheelEvent", + "initialTime", + "initialize", + "initiatorType", + "inner", + "innerHTML", + "innerHeight", + "innerText", + "innerWidth", + "input", + "inputBuffer", + "inputEncoding", + "inputMethod", + "insertAdjacentElement", + "insertAdjacentHTML", + "insertAdjacentText", + "insertBefore", + "insertCell", + "insertData", + "insertItemBefore", + "insertNode", + "insertRow", + "insertRule", + "instanceRoot", + "intercept", + "interimResults", + "internalSubset", + "intersectsNode", + "interval", + "invalidIteratorState", + "inverse", + "invertSelf", + "is", + "is2D", + "isAlternate", + "isArray", + "isBingCurrentSearchDefault", + "isBuffer", + "isCandidateWindowVisible", + "isChar", + "isCollapsed", + "isComposing", + "isContentEditable", + "isContentHandlerRegistered", + "isContextLost", + "isDefaultNamespace", + "isDisabled", + "isEnabled", + "isEqual", + "isEqualNode", + "isExtensible", + "isFinite", + "isFramebuffer", + "isFrozen", + "isGenerator", + "isId", + "isInjected", + "isInteger", + "isMap", + "isMultiLine", + "isNaN", + "isOpen", + "isPointInFill", + "isPointInPath", + "isPointInRange", + "isPointInStroke", + "isPrefAlternate", + "isPrimary", + "isProgram", + "isPropertyImplicit", + "isProtocolHandlerRegistered", + "isPrototypeOf", + "isRenderbuffer", + "isSafeInteger", + "isSameNode", + "isSealed", + "isShader", + "isSupported", + "isTextEdit", + "isTexture", + "isTrusted", + "isTypeSupported", + "isView", + "isolation", + "italics", + "item", + "itemId", + "itemProp", + "itemRef", + "itemScope", + "itemType", + "itemValue", + "iterateNext", + "iterator", + "javaEnabled", + "jobTitle", + "join", + "json", + "justify-content", + "justifyContent", + "k1", + "k2", + "k3", + "k4", + "kernelMatrix", + "kernelUnitLengthX", + "kernelUnitLengthY", + "kerning", + "key", + "keyCode", + "keyFor", + "keyIdentifier", + "keyLightEnabled", + "keyLocation", + "keyPath", + "keySystem", + "keyText", + "keyUsage", + "keys", + "keytype", + "kind", + "knee", + "label", + "labels", + "lang", + "language", + "languages", + "largeArcFlag", + "lastChild", + "lastElementChild", + "lastEventId", + "lastIndex", + "lastIndexOf", + "lastMatch", + "lastMessageSubject", + "lastMessageType", + "lastModified", + "lastModifiedDate", + "lastPage", + "lastParen", + "lastState", + "lastStyleSheetSet", + "latitude", + "layerX", + "layerY", + "layoutFlow", + "layoutGrid", + "layoutGridChar", + "layoutGridLine", + "layoutGridMode", + "layoutGridType", + "lbound", + "left", + "leftContext", + "leftMargin", + "length", + "lengthAdjust", + "lengthComputable", + "letter-spacing", + "letterSpacing", + "level", + "lighting-color", + "lightingColor", + "limitingConeAngle", + "line", + "line-height", + "lineAlign", + "lineBreak", + "lineCap", + "lineDashOffset", + "lineHeight", + "lineJoin", + "lineNumber", + "lineTo", + "lineWidth", + "linearRampToValueAtTime", + "lineno", + "link", + "linkColor", + "linkProgram", + "links", + "list", + "list-style", + "list-style-image", + "list-style-position", + "list-style-type", + "listStyle", + "listStyleImage", + "listStylePosition", + "listStyleType", + "listener", + "load", + "loadEventEnd", + "loadEventStart", + "loadTimes", + "loaded", + "localDescription", + "localName", + "localStorage", + "locale", + "localeCompare", + "location", + "locationbar", + "lock", + "lockedFile", + "log", + "log10", + "log1p", + "log2", + "logicalXDPI", + "logicalYDPI", + "longDesc", + "longitude", + "lookupNamespaceURI", + "lookupPrefix", + "loop", + "loopEnd", + "loopStart", + "looping", + "low", + "lower", + "lowerBound", + "lowerOpen", + "lowsrc", + "m11", + "m12", + "m13", + "m14", + "m21", + "m22", + "m23", + "m24", + "m31", + "m32", + "m33", + "m34", + "m41", + "m42", + "m43", + "m44", + "manifest", + "map", + "mapping", + "margin", + "margin-bottom", + "margin-left", + "margin-right", + "margin-top", + "marginBottom", + "marginHeight", + "marginLeft", + "marginRight", + "marginTop", + "marginWidth", + "mark", + "marker", + "marker-end", + "marker-mid", + "marker-offset", + "marker-start", + "markerEnd", + "markerHeight", + "markerMid", + "markerOffset", + "markerStart", + "markerUnits", + "markerWidth", + "marks", + "mask", + "mask-type", + "maskContentUnits", + "maskType", + "maskUnits", + "match", + "matchMedia", + "matchMedium", + "matches", + "matrix", + "matrixTransform", + "max", + "max-height", + "max-width", + "maxAlternatives", + "maxChannelCount", + "maxConnectionsPerServer", + "maxDecibels", + "maxDistance", + "maxHeight", + "maxLength", + "maxTouchPoints", + "maxValue", + "maxWidth", + "measure", + "measureText", + "media", + "mediaDevices", + "mediaElement", + "mediaGroup", + "mediaKeys", + "mediaText", + "meetOrSlice", + "memory", + "menubar", + "mergeAttributes", + "message", + "messageClass", + "messageHandlers", + "metaKey", + "method", + "mimeType", + "mimeTypes", + "min", + "min-height", + "min-width", + "minDecibels", + "minHeight", + "minValue", + "minWidth", + "miterLimit", + "mix-blend-mode", + "mixBlendMode", + "mode", + "modify", + "mount", + "move", + "moveBy", + "moveEnd", + "moveFirst", + "moveFocusDown", + "moveFocusLeft", + "moveFocusRight", + "moveFocusUp", + "moveNext", + "moveRow", + "moveStart", + "moveTo", + "moveToBookmark", + "moveToElementText", + "moveToPoint", + "mozAdd", + "mozAnimationStartTime", + "mozAnon", + "mozApps", + "mozAudioCaptured", + "mozAudioChannelType", + "mozAutoplayEnabled", + "mozCancelAnimationFrame", + "mozCancelFullScreen", + "mozCancelRequestAnimationFrame", + "mozCaptureStream", + "mozCaptureStreamUntilEnded", + "mozClearDataAt", + "mozContact", + "mozContacts", + "mozCreateFileHandle", + "mozCurrentTransform", + "mozCurrentTransformInverse", + "mozCursor", + "mozDash", + "mozDashOffset", + "mozDecodedFrames", + "mozExitPointerLock", + "mozFillRule", + "mozFragmentEnd", + "mozFrameDelay", + "mozFullScreen", + "mozFullScreenElement", + "mozFullScreenEnabled", + "mozGetAll", + "mozGetAllKeys", + "mozGetAsFile", + "mozGetDataAt", + "mozGetMetadata", + "mozGetUserMedia", + "mozHasAudio", + "mozHasItem", + "mozHidden", + "mozImageSmoothingEnabled", + "mozIndexedDB", + "mozInnerScreenX", + "mozInnerScreenY", + "mozInputSource", + "mozIsTextField", + "mozItem", + "mozItemCount", + "mozItems", + "mozLength", + "mozLockOrientation", + "mozMatchesSelector", + "mozMovementX", + "mozMovementY", + "mozOpaque", + "mozOrientation", + "mozPaintCount", + "mozPaintedFrames", + "mozParsedFrames", + "mozPay", + "mozPointerLockElement", + "mozPresentedFrames", + "mozPreservesPitch", + "mozPressure", + "mozPrintCallback", + "mozRTCIceCandidate", + "mozRTCPeerConnection", + "mozRTCSessionDescription", + "mozRemove", + "mozRequestAnimationFrame", + "mozRequestFullScreen", + "mozRequestPointerLock", + "mozSetDataAt", + "mozSetImageElement", + "mozSourceNode", + "mozSrcObject", + "mozSystem", + "mozTCPSocket", + "mozTextStyle", + "mozTypesAt", + "mozUnlockOrientation", + "mozUserCancelled", + "mozVisibilityState", + "msAnimation", + "msAnimationDelay", + "msAnimationDirection", + "msAnimationDuration", + "msAnimationFillMode", + "msAnimationIterationCount", + "msAnimationName", + "msAnimationPlayState", + "msAnimationStartTime", + "msAnimationTimingFunction", + "msBackfaceVisibility", + "msBlockProgression", + "msCSSOMElementFloatMetrics", + "msCaching", + "msCachingEnabled", + "msCancelRequestAnimationFrame", + "msCapsLockWarningOff", + "msClearImmediate", + "msClose", + "msContentZoomChaining", + "msContentZoomFactor", + "msContentZoomLimit", + "msContentZoomLimitMax", + "msContentZoomLimitMin", + "msContentZoomSnap", + "msContentZoomSnapPoints", + "msContentZoomSnapType", + "msContentZooming", + "msConvertURL", + "msCrypto", + "msDoNotTrack", + "msElementsFromPoint", + "msElementsFromRect", + "msExitFullscreen", + "msExtendedCode", + "msFillRule", + "msFirstPaint", + "msFlex", + "msFlexAlign", + "msFlexDirection", + "msFlexFlow", + "msFlexItemAlign", + "msFlexLinePack", + "msFlexNegative", + "msFlexOrder", + "msFlexPack", + "msFlexPositive", + "msFlexPreferredSize", + "msFlexWrap", + "msFlowFrom", + "msFlowInto", + "msFontFeatureSettings", + "msFullscreenElement", + "msFullscreenEnabled", + "msGetInputContext", + "msGetRegionContent", + "msGetUntransformedBounds", + "msGraphicsTrustStatus", + "msGridColumn", + "msGridColumnAlign", + "msGridColumnSpan", + "msGridColumns", + "msGridRow", + "msGridRowAlign", + "msGridRowSpan", + "msGridRows", + "msHidden", + "msHighContrastAdjust", + "msHyphenateLimitChars", + "msHyphenateLimitLines", + "msHyphenateLimitZone", + "msHyphens", + "msImageSmoothingEnabled", + "msImeAlign", + "msIndexedDB", + "msInterpolationMode", + "msIsStaticHTML", + "msKeySystem", + "msKeys", + "msLaunchUri", + "msLockOrientation", + "msManipulationViewsEnabled", + "msMatchMedia", + "msMatchesSelector", + "msMaxTouchPoints", + "msOrientation", + "msOverflowStyle", + "msPerspective", + "msPerspectiveOrigin", + "msPlayToDisabled", + "msPlayToPreferredSourceUri", + "msPlayToPrimary", + "msPointerEnabled", + "msRegionOverflow", + "msReleasePointerCapture", + "msRequestAnimationFrame", + "msRequestFullscreen", + "msSaveBlob", + "msSaveOrOpenBlob", + "msScrollChaining", + "msScrollLimit", + "msScrollLimitXMax", + "msScrollLimitXMin", + "msScrollLimitYMax", + "msScrollLimitYMin", + "msScrollRails", + "msScrollSnapPointsX", + "msScrollSnapPointsY", + "msScrollSnapType", + "msScrollSnapX", + "msScrollSnapY", + "msScrollTranslation", + "msSetImmediate", + "msSetMediaKeys", + "msSetPointerCapture", + "msTextCombineHorizontal", + "msTextSizeAdjust", + "msToBlob", + "msTouchAction", + "msTouchSelect", + "msTraceAsyncCallbackCompleted", + "msTraceAsyncCallbackStarting", + "msTraceAsyncOperationCompleted", + "msTraceAsyncOperationStarting", + "msTransform", + "msTransformOrigin", + "msTransformStyle", + "msTransition", + "msTransitionDelay", + "msTransitionDuration", + "msTransitionProperty", + "msTransitionTimingFunction", + "msUnlockOrientation", + "msUpdateAsyncCallbackRelation", + "msUserSelect", + "msVisibilityState", + "msWrapFlow", + "msWrapMargin", + "msWrapThrough", + "msWriteProfilerMark", + "msZoom", + "msZoomTo", + "mt", + "multiEntry", + "multiSelectionObj", + "multiline", + "multiple", + "multiply", + "multiplySelf", + "mutableFile", + "muted", + "n", + "name", + "nameProp", + "namedItem", + "namedRecordset", + "names", + "namespaceURI", + "namespaces", + "naturalHeight", + "naturalWidth", + "navigate", + "navigation", + "navigationMode", + "navigationStart", + "navigator", + "near", + "nearestViewportElement", + "negative", + "netscape", + "networkState", + "newScale", + "newTranslate", + "newURL", + "newValue", + "newValueSpecifiedUnits", + "newVersion", + "newhome", + "next", + "nextElementSibling", + "nextNode", + "nextPage", + "nextSibling", + "nickname", + "noHref", + "noResize", + "noShade", + "noValidate", + "noWrap", + "nodeName", + "nodeType", + "nodeValue", + "normalize", + "normalizedPathSegList", + "notationName", + "notations", + "note", + "noteGrainOn", + "noteOff", + "noteOn", + "now", + "numOctaves", + "number", + "numberOfChannels", + "numberOfInputs", + "numberOfItems", + "numberOfOutputs", + "numberValue", + "oMatchesSelector", + "object", + "object-fit", + "object-position", + "objectFit", + "objectPosition", + "objectStore", + "objectStoreNames", + "observe", + "of", + "offscreenBuffering", + "offset", + "offsetHeight", + "offsetLeft", + "offsetNode", + "offsetParent", + "offsetTop", + "offsetWidth", + "offsetX", + "offsetY", + "ok", + "oldURL", + "oldValue", + "oldVersion", + "olderShadowRoot", + "onLine", + "onabort", + "onactivate", + "onactive", + "onaddstream", + "onaddtrack", + "onafterprint", + "onafterscriptexecute", + "onafterupdate", + "onaudioend", + "onaudioprocess", + "onaudiostart", + "onautocomplete", + "onautocompleteerror", + "onbeforeactivate", + "onbeforecopy", + "onbeforecut", + "onbeforedeactivate", + "onbeforeeditfocus", + "onbeforepaste", + "onbeforeprint", + "onbeforescriptexecute", + "onbeforeunload", + "onbeforeupdate", + "onblocked", + "onblur", + "onbounce", + "onboundary", + "oncached", + "oncancel", + "oncandidatewindowhide", + "oncandidatewindowshow", + "oncandidatewindowupdate", + "oncanplay", + "oncanplaythrough", + "oncellchange", + "onchange", + "onchargingchange", + "onchargingtimechange", + "onchecking", + "onclick", + "onclose", + "oncompassneedscalibration", + "oncomplete", + "oncontextmenu", + "oncontrolselect", + "oncopy", + "oncuechange", + "oncut", + "ondataavailable", + "ondatachannel", + "ondatasetchanged", + "ondatasetcomplete", + "ondblclick", + "ondeactivate", + "ondevicelight", + "ondevicemotion", + "ondeviceorientation", + "ondeviceproximity", + "ondischargingtimechange", + "ondisplay", + "ondownloading", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onencrypted", + "onend", + "onended", + "onenter", + "onerror", + "onerrorupdate", + "onexit", + "onfilterchange", + "onfinish", + "onfocus", + "onfocusin", + "onfocusout", + "onfullscreenchange", + "onfullscreenerror", + "ongesturechange", + "ongestureend", + "ongesturestart", + "ongotpointercapture", + "onhashchange", + "onhelp", + "onicecandidate", + "oniceconnectionstatechange", + "oninactive", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onlanguagechange", + "onlayoutcomplete", + "onlevelchange", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadend", + "onloadstart", + "onlosecapture", + "onlostpointercapture", + "only", + "onmark", + "onmessage", + "onmousedown", + "onmouseenter", + "onmouseleave", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onmove", + "onmoveend", + "onmovestart", + "onmozfullscreenchange", + "onmozfullscreenerror", + "onmozorientationchange", + "onmozpointerlockchange", + "onmozpointerlockerror", + "onmscontentzoom", + "onmsfullscreenchange", + "onmsfullscreenerror", + "onmsgesturechange", + "onmsgesturedoubletap", + "onmsgestureend", + "onmsgesturehold", + "onmsgesturestart", + "onmsgesturetap", + "onmsgotpointercapture", + "onmsinertiastart", + "onmslostpointercapture", + "onmsmanipulationstatechanged", + "onmsneedkey", + "onmsorientationchange", + "onmspointercancel", + "onmspointerdown", + "onmspointerenter", + "onmspointerhover", + "onmspointerleave", + "onmspointermove", + "onmspointerout", + "onmspointerover", + "onmspointerup", + "onmssitemodejumplistitemremoved", + "onmsthumbnailclick", + "onnegotiationneeded", + "onnomatch", + "onnoupdate", + "onobsolete", + "onoffline", + "ononline", + "onopen", + "onorientationchange", + "onpagechange", + "onpagehide", + "onpageshow", + "onpaste", + "onpause", + "onplay", + "onplaying", + "onpluginstreamstart", + "onpointercancel", + "onpointerdown", + "onpointerenter", + "onpointerleave", + "onpointerlockchange", + "onpointerlockerror", + "onpointermove", + "onpointerout", + "onpointerover", + "onpointerup", + "onpopstate", + "onprogress", + "onpropertychange", + "onratechange", + "onreadystatechange", + "onremovestream", + "onremovetrack", + "onreset", + "onresize", + "onresizeend", + "onresizestart", + "onresourcetimingbufferfull", + "onresult", + "onresume", + "onrowenter", + "onrowexit", + "onrowsdelete", + "onrowsinserted", + "onscroll", + "onsearch", + "onseeked", + "onseeking", + "onselect", + "onselectionchange", + "onselectstart", + "onshow", + "onsignalingstatechange", + "onsoundend", + "onsoundstart", + "onspeechend", + "onspeechstart", + "onstalled", + "onstart", + "onstatechange", + "onstop", + "onstorage", + "onstoragecommit", + "onsubmit", + "onsuccess", + "onsuspend", + "ontextinput", + "ontimeout", + "ontimeupdate", + "ontoggle", + "ontouchcancel", + "ontouchend", + "ontouchmove", + "ontouchstart", + "ontransitionend", + "onunload", + "onupdateready", + "onupgradeneeded", + "onuserproximity", + "onversionchange", + "onvoiceschanged", + "onvolumechange", + "onwaiting", + "onwarning", + "onwebkitanimationend", + "onwebkitanimationiteration", + "onwebkitanimationstart", + "onwebkitcurrentplaybacktargetiswirelesschanged", + "onwebkitfullscreenchange", + "onwebkitfullscreenerror", + "onwebkitkeyadded", + "onwebkitkeyerror", + "onwebkitkeymessage", + "onwebkitneedkey", + "onwebkitorientationchange", + "onwebkitplaybacktargetavailabilitychanged", + "onwebkitpointerlockchange", + "onwebkitpointerlockerror", + "onwebkitresourcetimingbufferfull", + "onwebkittransitionend", + "onwheel", + "onzoom", + "opacity", + "open", + "openCursor", + "openDatabase", + "openKeyCursor", + "opener", + "opera", + "operationType", + "operator", + "opr", + "optimum", + "options", + "order", + "orderX", + "orderY", + "ordered", + "org", + "orient", + "orientAngle", + "orientType", + "orientation", + "origin", + "originalTarget", + "orphans", + "oscpu", + "outerHTML", + "outerHeight", + "outerText", + "outerWidth", + "outline", + "outline-color", + "outline-offset", + "outline-style", + "outline-width", + "outlineColor", + "outlineOffset", + "outlineStyle", + "outlineWidth", + "outputBuffer", + "overflow", + "overflow-x", + "overflow-y", + "overflowX", + "overflowY", + "overrideMimeType", + "oversample", + "ownerDocument", + "ownerElement", + "ownerNode", + "ownerRule", + "ownerSVGElement", + "owningElement", + "p1", + "p2", + "p3", + "p4", + "pad", + "padding", + "padding-bottom", + "padding-left", + "padding-right", + "padding-top", + "paddingBottom", + "paddingLeft", + "paddingRight", + "paddingTop", + "page", + "page-break-after", + "page-break-before", + "page-break-inside", + "pageBreakAfter", + "pageBreakBefore", + "pageBreakInside", + "pageCount", + "pageX", + "pageXOffset", + "pageY", + "pageYOffset", + "pages", + "paint-order", + "paintOrder", + "paintRequests", + "paintType", + "palette", + "panningModel", + "parent", + "parentElement", + "parentNode", + "parentRule", + "parentStyleSheet", + "parentTextEdit", + "parentWindow", + "parse", + "parseFloat", + "parseFromString", + "parseInt", + "participants", + "password", + "pasteHTML", + "path", + "pathLength", + "pathSegList", + "pathSegType", + "pathSegTypeAsLetter", + "pathname", + "pattern", + "patternContentUnits", + "patternMismatch", + "patternTransform", + "patternUnits", + "pause", + "pauseAnimations", + "pauseOnExit", + "paused", + "pending", + "performance", + "permission", + "persisted", + "personalbar", + "perspective", + "perspective-origin", + "perspectiveOrigin", + "phoneticFamilyName", + "phoneticGivenName", + "photo", + "ping", + "pitch", + "pixelBottom", + "pixelDepth", + "pixelHeight", + "pixelLeft", + "pixelRight", + "pixelStorei", + "pixelTop", + "pixelUnitToMillimeterX", + "pixelUnitToMillimeterY", + "pixelWidth", + "placeholder", + "platform", + "play", + "playbackRate", + "playbackState", + "playbackTime", + "played", + "plugins", + "pluginspage", + "pname", + "pointer-events", + "pointerBeforeReferenceNode", + "pointerEnabled", + "pointerEvents", + "pointerId", + "pointerLockElement", + "pointerType", + "points", + "pointsAtX", + "pointsAtY", + "pointsAtZ", + "polygonOffset", + "pop", + "popupWindowFeatures", + "popupWindowName", + "popupWindowURI", + "port", + "port1", + "port2", + "ports", + "posBottom", + "posHeight", + "posLeft", + "posRight", + "posTop", + "posWidth", + "position", + "positionAlign", + "postError", + "postMessage", + "poster", + "pow", + "powerOff", + "preMultiplySelf", + "precision", + "preferredStyleSheetSet", + "preferredStylesheetSet", + "prefix", + "preload", + "preserveAlpha", + "preserveAspectRatio", + "preserveAspectRatioString", + "pressed", + "pressure", + "prevValue", + "preventDefault", + "preventExtensions", + "previousElementSibling", + "previousNode", + "previousPage", + "previousScale", + "previousSibling", + "previousTranslate", + "primaryKey", + "primitiveType", + "primitiveUnits", + "principals", + "print", + "privateKey", + "probablySupportsContext", + "process", + "processIceMessage", + "product", + "productSub", + "profile", + "profileEnd", + "profiles", + "prompt", + "properties", + "propertyIsEnumerable", + "propertyName", + "protocol", + "protocolLong", + "prototype", + "pseudoClass", + "pseudoElement", + "publicId", + "publicKey", + "published", + "push", + "pushNotification", + "pushState", + "put", + "putImageData", + "quadraticCurveTo", + "qualifier", + "queryCommandEnabled", + "queryCommandIndeterm", + "queryCommandState", + "queryCommandSupported", + "queryCommandText", + "queryCommandValue", + "querySelector", + "querySelectorAll", + "quote", + "quotes", + "r", + "r1", + "r2", + "race", + "radiogroup", + "radiusX", + "radiusY", + "random", + "range", + "rangeCount", + "rangeMax", + "rangeMin", + "rangeOffset", + "rangeOverflow", + "rangeParent", + "rangeUnderflow", + "rate", + "ratio", + "raw", + "read", + "readAsArrayBuffer", + "readAsBinaryString", + "readAsBlob", + "readAsDataURL", + "readAsText", + "readOnly", + "readPixels", + "readReportRequested", + "readyState", + "reason", + "reboot", + "receiver", + "receivers", + "recordNumber", + "recordset", + "rect", + "red", + "redirectCount", + "redirectEnd", + "redirectStart", + "reduce", + "reduceRight", + "reduction", + "refDistance", + "refX", + "refY", + "referenceNode", + "referrer", + "refresh", + "region", + "regionAnchorX", + "regionAnchorY", + "regionId", + "regions", + "register", + "registerContentHandler", + "registerElement", + "registerProtocolHandler", + "reject", + "rel", + "relList", + "relatedNode", + "relatedTarget", + "release", + "releaseCapture", + "releaseEvents", + "releasePointerCapture", + "releaseShaderCompiler", + "reliable", + "reload", + "remainingSpace", + "remoteDescription", + "remove", + "removeAllRanges", + "removeAttribute", + "removeAttributeNS", + "removeAttributeNode", + "removeBehavior", + "removeChild", + "removeCue", + "removeEventListener", + "removeFilter", + "removeImport", + "removeItem", + "removeListener", + "removeNamedItem", + "removeNamedItemNS", + "removeNode", + "removeParameter", + "removeProperty", + "removeRange", + "removeRegion", + "removeRule", + "removeSiteSpecificTrackingException", + "removeSourceBuffer", + "removeStream", + "removeTrack", + "removeVariable", + "removeWakeLockListener", + "removeWebWideTrackingException", + "removedNodes", + "renderbufferStorage", + "renderedBuffer", + "renderingMode", + "repeat", + "replace", + "replaceAdjacentText", + "replaceChild", + "replaceData", + "replaceId", + "replaceItem", + "replaceNode", + "replaceState", + "replaceTrack", + "replaceWholeText", + "reportValidity", + "requestAnimationFrame", + "requestAutocomplete", + "requestData", + "requestFullscreen", + "requestMediaKeySystemAccess", + "requestPermission", + "requestPointerLock", + "requestStart", + "requestingWindow", + "required", + "requiredExtensions", + "requiredFeatures", + "reset", + "resetTransform", + "resize", + "resizeBy", + "resizeTo", + "resolve", + "response", + "responseBody", + "responseEnd", + "responseStart", + "responseText", + "responseType", + "responseURL", + "responseXML", + "restore", + "result", + "resultType", + "resume", + "returnValue", + "rev", + "reverse", + "reversed", + "revocable", + "revokeObjectURL", + "rgbColor", + "right", + "rightContext", + "rightMargin", + "rolloffFactor", + "root", + "rootElement", + "rotate", + "rotateAxisAngle", + "rotateAxisAngleSelf", + "rotateFromVector", + "rotateFromVectorSelf", + "rotateSelf", + "rotation", + "rotationRate", + "round", + "rowIndex", + "rowSpan", + "rows", + "rubyAlign", + "rubyOverhang", + "rubyPosition", + "rules", + "runtime", + "runtimeStyle", + "rx", + "ry", + "safari", + "sampleCoverage", + "sampleRate", + "sandbox", + "save", + "scale", + "scale3d", + "scale3dSelf", + "scaleNonUniform", + "scaleNonUniformSelf", + "scaleSelf", + "scheme", + "scissor", + "scope", + "scopeName", + "scoped", + "screen", + "screenBrightness", + "screenEnabled", + "screenLeft", + "screenPixelToMillimeterX", + "screenPixelToMillimeterY", + "screenTop", + "screenX", + "screenY", + "scripts", + "scroll", + "scroll-behavior", + "scrollAmount", + "scrollBehavior", + "scrollBy", + "scrollByLines", + "scrollByPages", + "scrollDelay", + "scrollHeight", + "scrollIntoView", + "scrollIntoViewIfNeeded", + "scrollLeft", + "scrollLeftMax", + "scrollMaxX", + "scrollMaxY", + "scrollTo", + "scrollTop", + "scrollTopMax", + "scrollWidth", + "scrollX", + "scrollY", + "scrollbar3dLightColor", + "scrollbarArrowColor", + "scrollbarBaseColor", + "scrollbarDarkShadowColor", + "scrollbarFaceColor", + "scrollbarHighlightColor", + "scrollbarShadowColor", + "scrollbarTrackColor", + "scrollbars", + "scrolling", + "sdp", + "sdpMLineIndex", + "sdpMid", + "seal", + "search", + "searchBox", + "searchBoxJavaBridge_", + "searchParams", + "sectionRowIndex", + "secureConnectionStart", + "security", + "seed", + "seekable", + "seeking", + "select", + "selectAllChildren", + "selectNode", + "selectNodeContents", + "selectNodes", + "selectSingleNode", + "selectSubString", + "selected", + "selectedIndex", + "selectedOptions", + "selectedStyleSheetSet", + "selectedStylesheetSet", + "selection", + "selectionDirection", + "selectionEnd", + "selectionStart", + "selector", + "selectorText", + "self", + "send", + "sendAsBinary", + "sendBeacon", + "sender", + "sentTimestamp", + "separator", + "serializeToString", + "serviceWorker", + "sessionId", + "sessionStorage", + "set", + "setActive", + "setAlpha", + "setAttribute", + "setAttributeNS", + "setAttributeNode", + "setAttributeNodeNS", + "setBaseAndExtent", + "setBingCurrentSearchDefault", + "setCapture", + "setColor", + "setCompositeOperation", + "setCurrentTime", + "setCustomValidity", + "setData", + "setDate", + "setDragImage", + "setEnd", + "setEndAfter", + "setEndBefore", + "setEndPoint", + "setFillColor", + "setFilterRes", + "setFloat32", + "setFloat64", + "setFloatValue", + "setFullYear", + "setHours", + "setImmediate", + "setInt16", + "setInt32", + "setInt8", + "setInterval", + "setItem", + "setLineCap", + "setLineDash", + "setLineJoin", + "setLineWidth", + "setLocalDescription", + "setMatrix", + "setMatrixValue", + "setMediaKeys", + "setMilliseconds", + "setMinutes", + "setMiterLimit", + "setMonth", + "setNamedItem", + "setNamedItemNS", + "setNonUserCodeExceptions", + "setOrientToAngle", + "setOrientToAuto", + "setOrientation", + "setOverrideHistoryNavigationMode", + "setPaint", + "setParameter", + "setPeriodicWave", + "setPointerCapture", + "setPosition", + "setPreference", + "setProperty", + "setPrototypeOf", + "setRGBColor", + "setRGBColorICCColor", + "setRadius", + "setRangeText", + "setRemoteDescription", + "setRequestHeader", + "setResizable", + "setResourceTimingBufferSize", + "setRotate", + "setScale", + "setSeconds", + "setSelectionRange", + "setServerCertificate", + "setShadow", + "setSkewX", + "setSkewY", + "setStart", + "setStartAfter", + "setStartBefore", + "setStdDeviation", + "setStringValue", + "setStrokeColor", + "setSuggestResult", + "setTargetAtTime", + "setTargetValueAtTime", + "setTime", + "setTimeout", + "setTransform", + "setTranslate", + "setUTCDate", + "setUTCFullYear", + "setUTCHours", + "setUTCMilliseconds", + "setUTCMinutes", + "setUTCMonth", + "setUTCSeconds", + "setUint16", + "setUint32", + "setUint8", + "setUri", + "setValueAtTime", + "setValueCurveAtTime", + "setVariable", + "setVelocity", + "setVersion", + "setYear", + "settingName", + "settingValue", + "sex", + "shaderSource", + "shadowBlur", + "shadowColor", + "shadowOffsetX", + "shadowOffsetY", + "shadowRoot", + "shape", + "shape-rendering", + "shapeRendering", + "sheet", + "shift", + "shiftKey", + "shiftLeft", + "show", + "showHelp", + "showModal", + "showModalDialog", + "showModelessDialog", + "showNotification", + "sidebar", + "sign", + "signalingState", + "sin", + "singleNodeValue", + "sinh", + "size", + "sizeToContent", + "sizes", + "skewX", + "skewXSelf", + "skewY", + "skewYSelf", + "slice", + "slope", + "small", + "smil", + "smoothingTimeConstant", + "snapToLines", + "snapshotItem", + "snapshotLength", + "some", + "sort", + "source", + "sourceBuffer", + "sourceBuffers", + "sourceIndex", + "spacing", + "span", + "speakAs", + "speaking", + "specified", + "specularConstant", + "specularExponent", + "speechSynthesis", + "speed", + "speedOfSound", + "spellcheck", + "splice", + "split", + "splitText", + "spreadMethod", + "sqrt", + "src", + "srcElement", + "srcFilter", + "srcUrn", + "srcdoc", + "srclang", + "srcset", + "stack", + "stackTraceLimit", + "stacktrace", + "standalone", + "standby", + "start", + "startContainer", + "startIce", + "startOffset", + "startRendering", + "startTime", + "startsWith", + "state", + "status", + "statusMessage", + "statusText", + "statusbar", + "stdDeviationX", + "stdDeviationY", + "stencilFunc", + "stencilFuncSeparate", + "stencilMask", + "stencilMaskSeparate", + "stencilOp", + "stencilOpSeparate", + "step", + "stepDown", + "stepMismatch", + "stepUp", + "sticky", + "stitchTiles", + "stop", + "stop-color", + "stop-opacity", + "stopColor", + "stopImmediatePropagation", + "stopOpacity", + "stopPropagation", + "storageArea", + "storageName", + "storageStatus", + "storeSiteSpecificTrackingException", + "storeWebWideTrackingException", + "stpVersion", + "stream", + "strike", + "stringValue", + "stringify", + "stroke", + "stroke-dasharray", + "stroke-dashoffset", + "stroke-linecap", + "stroke-linejoin", + "stroke-miterlimit", + "stroke-opacity", + "stroke-width", + "strokeDasharray", + "strokeDashoffset", + "strokeLinecap", + "strokeLinejoin", + "strokeMiterlimit", + "strokeOpacity", + "strokeRect", + "strokeStyle", + "strokeText", + "strokeWidth", + "style", + "styleFloat", + "styleMedia", + "styleSheet", + "styleSheetSets", + "styleSheets", + "sub", + "subarray", + "subject", + "submit", + "subscribe", + "substr", + "substring", + "substringData", + "subtle", + "suffix", + "suffixes", + "summary", + "sup", + "supports", + "surfaceScale", + "surroundContents", + "suspend", + "suspendRedraw", + "swapCache", + "swapNode", + "sweepFlag", + "symbols", + "system", + "systemCode", + "systemId", + "systemLanguage", + "systemXDPI", + "systemYDPI", + "tBodies", + "tFoot", + "tHead", + "tabIndex", + "table", + "table-layout", + "tableLayout", + "tableValues", + "tag", + "tagName", + "tagUrn", + "tags", + "taintEnabled", + "takeRecords", + "tan", + "tanh", + "target", + "targetElement", + "targetTouches", + "targetX", + "targetY", + "tel", + "terminate", + "test", + "texImage2D", + "texParameterf", + "texParameteri", + "texSubImage2D", + "text", + "text-align", + "text-anchor", + "text-decoration", + "text-decoration-color", + "text-decoration-line", + "text-decoration-style", + "text-indent", + "text-overflow", + "text-rendering", + "text-shadow", + "text-transform", + "textAlign", + "textAlignLast", + "textAnchor", + "textAutospace", + "textBaseline", + "textContent", + "textDecoration", + "textDecorationBlink", + "textDecorationColor", + "textDecorationLine", + "textDecorationLineThrough", + "textDecorationNone", + "textDecorationOverline", + "textDecorationStyle", + "textDecorationUnderline", + "textIndent", + "textJustify", + "textJustifyTrim", + "textKashida", + "textKashidaSpace", + "textLength", + "textOverflow", + "textRendering", + "textShadow", + "textTracks", + "textTransform", + "textUnderlinePosition", + "then", + "threadId", + "threshold", + "tiltX", + "tiltY", + "time", + "timeEnd", + "timeStamp", + "timeout", + "timestamp", + "timestampOffset", + "timing", + "title", + "toArray", + "toBlob", + "toDataURL", + "toDateString", + "toElement", + "toExponential", + "toFixed", + "toFloat32Array", + "toFloat64Array", + "toGMTString", + "toISOString", + "toJSON", + "toLocaleDateString", + "toLocaleFormat", + "toLocaleLowerCase", + "toLocaleString", + "toLocaleTimeString", + "toLocaleUpperCase", + "toLowerCase", + "toMethod", + "toPrecision", + "toSdp", + "toSource", + "toStaticHTML", + "toString", + "toStringTag", + "toTimeString", + "toUTCString", + "toUpperCase", + "toggle", + "toggleLongPressEnabled", + "tooLong", + "toolbar", + "top", + "topMargin", + "total", + "totalFrameDelay", + "totalVideoFrames", + "touchAction", + "touches", + "trace", + "track", + "transaction", + "transactions", + "transform", + "transform-origin", + "transform-style", + "transformOrigin", + "transformPoint", + "transformString", + "transformStyle", + "transformToDocument", + "transformToFragment", + "transition", + "transition-delay", + "transition-duration", + "transition-property", + "transition-timing-function", + "transitionDelay", + "transitionDuration", + "transitionProperty", + "transitionTimingFunction", + "translate", + "translateSelf", + "translationX", + "translationY", + "trim", + "trimLeft", + "trimRight", + "trueSpeed", + "trunc", + "truncate", + "type", + "typeDetail", + "typeMismatch", + "typeMustMatch", + "types", + "ubound", + "undefined", + "unescape", + "uneval", + "unicode-bidi", + "unicodeBidi", + "uniform1f", + "uniform1fv", + "uniform1i", + "uniform1iv", + "uniform2f", + "uniform2fv", + "uniform2i", + "uniform2iv", + "uniform3f", + "uniform3fv", + "uniform3i", + "uniform3iv", + "uniform4f", + "uniform4fv", + "uniform4i", + "uniform4iv", + "uniformMatrix2fv", + "uniformMatrix3fv", + "uniformMatrix4fv", + "unique", + "uniqueID", + "uniqueNumber", + "unitType", + "units", + "unloadEventEnd", + "unloadEventStart", + "unlock", + "unmount", + "unobserve", + "unpause", + "unpauseAnimations", + "unreadCount", + "unregister", + "unregisterContentHandler", + "unregisterProtocolHandler", + "unscopables", + "unselectable", + "unshift", + "unsubscribe", + "unsuspendRedraw", + "unsuspendRedrawAll", + "unwatch", + "unwrapKey", + "update", + "updateCommands", + "updateIce", + "updateInterval", + "updateSettings", + "updated", + "updating", + "upload", + "upper", + "upperBound", + "upperOpen", + "uri", + "url", + "urn", + "urns", + "usages", + "useCurrentView", + "useMap", + "useProgram", + "usedSpace", + "userAgent", + "userLanguage", + "username", + "v8BreakIterator", + "vAlign", + "vLink", + "valid", + "validateProgram", + "validationMessage", + "validity", + "value", + "valueAsDate", + "valueAsNumber", + "valueAsString", + "valueInSpecifiedUnits", + "valueMissing", + "valueOf", + "valueText", + "valueType", + "values", + "vector-effect", + "vectorEffect", + "velocityAngular", + "velocityExpansion", + "velocityX", + "velocityY", + "vendor", + "vendorSub", + "verify", + "version", + "vertexAttrib1f", + "vertexAttrib1fv", + "vertexAttrib2f", + "vertexAttrib2fv", + "vertexAttrib3f", + "vertexAttrib3fv", + "vertexAttrib4f", + "vertexAttrib4fv", + "vertexAttribDivisorANGLE", + "vertexAttribPointer", + "vertical", + "vertical-align", + "verticalAlign", + "verticalOverflow", + "vibrate", + "videoHeight", + "videoTracks", + "videoWidth", + "view", + "viewBox", + "viewBoxString", + "viewTarget", + "viewTargetString", + "viewport", + "viewportAnchorX", + "viewportAnchorY", + "viewportElement", + "visibility", + "visibilityState", + "visible", + "vlinkColor", + "voice", + "volume", + "vrml", + "vspace", + "w", + "wand", + "warn", + "wasClean", + "watch", + "watchPosition", + "webdriver", + "webkitAddKey", + "webkitAnimation", + "webkitAnimationDelay", + "webkitAnimationDirection", + "webkitAnimationDuration", + "webkitAnimationFillMode", + "webkitAnimationIterationCount", + "webkitAnimationName", + "webkitAnimationPlayState", + "webkitAnimationTimingFunction", + "webkitAppearance", + "webkitAudioContext", + "webkitAudioDecodedByteCount", + "webkitAudioPannerNode", + "webkitBackfaceVisibility", + "webkitBackground", + "webkitBackgroundAttachment", + "webkitBackgroundClip", + "webkitBackgroundColor", + "webkitBackgroundImage", + "webkitBackgroundOrigin", + "webkitBackgroundPosition", + "webkitBackgroundPositionX", + "webkitBackgroundPositionY", + "webkitBackgroundRepeat", + "webkitBackgroundSize", + "webkitBackingStorePixelRatio", + "webkitBorderImage", + "webkitBorderImageOutset", + "webkitBorderImageRepeat", + "webkitBorderImageSlice", + "webkitBorderImageSource", + "webkitBorderImageWidth", + "webkitBoxAlign", + "webkitBoxDirection", + "webkitBoxFlex", + "webkitBoxOrdinalGroup", + "webkitBoxOrient", + "webkitBoxPack", + "webkitBoxSizing", + "webkitCancelAnimationFrame", + "webkitCancelFullScreen", + "webkitCancelKeyRequest", + "webkitCancelRequestAnimationFrame", + "webkitClearResourceTimings", + "webkitClosedCaptionsVisible", + "webkitConvertPointFromNodeToPage", + "webkitConvertPointFromPageToNode", + "webkitCreateShadowRoot", + "webkitCurrentFullScreenElement", + "webkitCurrentPlaybackTargetIsWireless", + "webkitDirectionInvertedFromDevice", + "webkitDisplayingFullscreen", + "webkitEnterFullScreen", + "webkitEnterFullscreen", + "webkitExitFullScreen", + "webkitExitFullscreen", + "webkitExitPointerLock", + "webkitFullScreenKeyboardInputAllowed", + "webkitFullscreenElement", + "webkitFullscreenEnabled", + "webkitGenerateKeyRequest", + "webkitGetAsEntry", + "webkitGetDatabaseNames", + "webkitGetEntries", + "webkitGetEntriesByName", + "webkitGetEntriesByType", + "webkitGetFlowByName", + "webkitGetGamepads", + "webkitGetImageDataHD", + "webkitGetNamedFlows", + "webkitGetRegionFlowRanges", + "webkitGetUserMedia", + "webkitHasClosedCaptions", + "webkitHidden", + "webkitIDBCursor", + "webkitIDBDatabase", + "webkitIDBDatabaseError", + "webkitIDBDatabaseException", + "webkitIDBFactory", + "webkitIDBIndex", + "webkitIDBKeyRange", + "webkitIDBObjectStore", + "webkitIDBRequest", + "webkitIDBTransaction", + "webkitImageSmoothingEnabled", + "webkitIndexedDB", + "webkitInitMessageEvent", + "webkitIsFullScreen", + "webkitKeys", + "webkitLineDashOffset", + "webkitLockOrientation", + "webkitMatchesSelector", + "webkitMediaStream", + "webkitNotifications", + "webkitOfflineAudioContext", + "webkitOrientation", + "webkitPeerConnection00", + "webkitPersistentStorage", + "webkitPointerLockElement", + "webkitPostMessage", + "webkitPreservesPitch", + "webkitPutImageDataHD", + "webkitRTCPeerConnection", + "webkitRegionOverset", + "webkitRequestAnimationFrame", + "webkitRequestFileSystem", + "webkitRequestFullScreen", + "webkitRequestFullscreen", + "webkitRequestPointerLock", + "webkitResolveLocalFileSystemURL", + "webkitSetMediaKeys", + "webkitSetResourceTimingBufferSize", + "webkitShadowRoot", + "webkitShowPlaybackTargetPicker", + "webkitSlice", + "webkitSpeechGrammar", + "webkitSpeechGrammarList", + "webkitSpeechRecognition", + "webkitSpeechRecognitionError", + "webkitSpeechRecognitionEvent", + "webkitStorageInfo", + "webkitSupportsFullscreen", + "webkitTemporaryStorage", + "webkitTextSizeAdjust", + "webkitTransform", + "webkitTransformOrigin", + "webkitTransition", + "webkitTransitionDelay", + "webkitTransitionDuration", + "webkitTransitionProperty", + "webkitTransitionTimingFunction", + "webkitURL", + "webkitUnlockOrientation", + "webkitUserSelect", + "webkitVideoDecodedByteCount", + "webkitVisibilityState", + "webkitWirelessVideoPlaybackDisabled", + "webkitdropzone", + "webstore", + "weight", + "whatToShow", + "wheelDelta", + "wheelDeltaX", + "wheelDeltaY", + "which", + "white-space", + "whiteSpace", + "wholeText", + "widows", + "width", + "will-change", + "willChange", + "willValidate", + "window", + "withCredentials", + "word-break", + "word-spacing", + "word-wrap", + "wordBreak", + "wordSpacing", + "wordWrap", + "wrap", + "wrapKey", + "write", + "writeln", + "writingMode", + "x", + "x1", + "x2", + "xChannelSelector", + "xmlEncoding", + "xmlStandalone", + "xmlVersion", + "xmlbase", + "xmllang", + "xmlspace", + "y", + "y1", + "y2", + "yChannelSelector", + "yandex", + "z", + "z-index", + "zIndex", + "zoom", + "zoomAndPan", + "zoomRectScreen" +] diff --git a/tools/node_modules/terser/tools/exit.js b/tools/node_modules/terser/tools/exit.js new file mode 100644 index 000000000000..17048d8ef34a --- /dev/null +++ b/tools/node_modules/terser/tools/exit.js @@ -0,0 +1,15 @@ +// workaround for tty output truncation upon process.exit() +var exit = process.exit; +process.exit = function() { + var args = [].slice.call(arguments); + process.once("uncaughtException", function() { + (function callback() { + if (process.stdout.bufferSize || process.stderr.bufferSize) { + setImmediate(callback); + } else { + exit.apply(process, args); + } + })(); + }); + throw exit; +}; diff --git a/tools/node_modules/terser/tools/exports.js b/tools/node_modules/terser/tools/exports.js new file mode 100644 index 000000000000..50f1a1a1df51 --- /dev/null +++ b/tools/node_modules/terser/tools/exports.js @@ -0,0 +1,14 @@ +exports["Dictionary"] = Dictionary; +exports["minify"] = minify; +exports["parse"] = parse; +exports["push_uniq"] = push_uniq; +exports["OutputStream"] = OutputStream; +exports["TreeTransformer"] = TreeTransformer; +exports["TreeWalker"] = TreeWalker; +exports["string_template"] = string_template; +exports["Compressor"] = Compressor; +exports["defaults"] = defaults; +exports["base54"] = base54; +exports["mangle_properties"] = mangle_properties; +exports["reserve_quoted_keys"] = reserve_quoted_keys; +exports["to_ascii"] = to_ascii; diff --git a/tools/node_modules/terser/tools/node.js b/tools/node_modules/terser/tools/node.js new file mode 100644 index 000000000000..8e7a14228d6d --- /dev/null +++ b/tools/node_modules/terser/tools/node.js @@ -0,0 +1,55 @@ +var fs = require("fs"); + +var UglifyJS = exports; +var FILES = UglifyJS.FILES = [ + "./domprops.js", + "../lib/utils.js", + "../lib/ast.js", + "../lib/parse.js", + "../lib/transform.js", + "../lib/scope.js", + "../lib/output.js", + "../lib/compress.js", + "../lib/sourcemap.js", + "../lib/mozilla-ast.js", + "../lib/propmangle.js", + "../lib/minify.js", + "./exports.js", +].map(function(file){ + return require.resolve(file); +}); + +try { + var istanbul = require("istanbul"); + var instrumenter = new istanbul.Instrumenter(); +} catch (ex) {} + +new Function("MOZ_SourceMap", "exports", "require", function() { + var code = FILES.map(function(file) { + var contents = fs.readFileSync(file, "utf8"); + if (instrumenter && global.__IS_TESTING__) return instrumenter.instrumentSync(contents, file); + return contents; + }); + return code.join("\n\n"); +}())( + require("source-map"), + UglifyJS, + require +); + +function infer_options(options) { + var result = UglifyJS.minify("", options); + return result.error && result.error.defs; +} + +UglifyJS.default_options = function() { + var defs = {}; + Object.keys(infer_options({ 0: 0 })).forEach(function(component) { + var options = {}; + options[component] = { 0: 0 }; + if (options = infer_options(options)) { + defs[component] = options; + } + }); + return defs; +}; diff --git a/tools/node_modules/terser/tools/props.html b/tools/node_modules/terser/tools/props.html new file mode 100644 index 000000000000..28b575fb8e7d --- /dev/null +++ b/tools/node_modules/terser/tools/props.html @@ -0,0 +1,61 @@ + + + + + + + diff --git a/tools/node_modules/terser/tools/terser.d.ts b/tools/node_modules/terser/tools/terser.d.ts new file mode 100644 index 000000000000..d57ace702ee0 --- /dev/null +++ b/tools/node_modules/terser/tools/terser.d.ts @@ -0,0 +1,790 @@ +import { RawSourceMap } from 'source-map'; + +export type ECMA = 5 | 6 | 7 | 8 | 9; + +export interface ParseOptions { + bare_returns?: boolean; + ecma?: ECMA; + html5_comments?: boolean; + shebang?: boolean; +} + +export interface CompressOptions { + arguments?: boolean; + arrows?: boolean; + booleans?: boolean; + collapse_vars?: boolean; + comparisons?: boolean; + conditionals?: boolean; + dead_code?: boolean; + defaults?: boolean; + directives?: boolean; + drop_console?: boolean; + drop_debugger?: boolean; + evaluate?: boolean; + expression?: boolean; + global_defs?: object; + hoist_funs?: boolean; + hoist_props?: boolean; + hoist_vars?: boolean; + if_return?: boolean; + inline?: boolean | InlineFunctions; + join_vars?: boolean; + keep_classnames?: boolean | RegExp; + keep_fargs?: boolean; + keep_fnames?: boolean | RegExp; + keep_infinity?: boolean; + loops?: boolean; + negate_iife?: boolean; + passes?: number; + properties?: boolean; + pure_funcs?: string[]; + pure_getters?: boolean | 'strict'; + reduce_funcs?: boolean; + reduce_vars?: boolean; + sequences?: boolean | number; + side_effects?: boolean; + switches?: boolean; + toplevel?: boolean; + top_retain?: null | string | string[] | RegExp; + typeofs?: boolean; + unsafe?: boolean; + unsafe_arrows?: boolean; + unsafe_comps?: boolean; + unsafe_Function?: boolean; + unsafe_math?: boolean; + unsafe_methods?: boolean; + unsafe_proto?: boolean; + unsafe_regexp?: boolean; + unsafe_undefined?: boolean; + unused?: boolean; + warnings?: boolean; +} + +export enum InlineFunctions { + Disabled = 0, + SimpleFunctions = 1, + WithArguments = 2, + WithArgumentsAndVariables = 3 +} + +export interface MangleOptions { + eval?: boolean; + keep_classnames?: boolean | RegExp; + keep_fnames?: boolean | RegExp; + module?: boolean; + properties?: boolean | ManglePropertiesOptions; + reserved?: string[]; + safari10?: boolean; + toplevel?: boolean; +} + +export interface ManglePropertiesOptions { + builtins?: boolean; + debug?: boolean; + keep_quoted?: boolean; + regex?: RegExp; + reserved?: string[]; +} + +export interface OutputOptions { + ascii_only?: boolean; + beautify?: boolean; + braces?: boolean; + comments?: boolean | 'all' | 'some' | RegExp; + ecma?: ECMA; + indent_level?: number; + indent_start?: boolean; + inline_script?: boolean; + ie8?: boolean; + keep_quoted_props?: boolean; + max_line_len?: boolean; + preamble?: string; + quote_keys?: boolean; + quote_style?: OutputQuoteStyle; + safari10?: boolean; + semicolons?: boolean; + shebang?: boolean; + shorthand?: boolean; + source_map?: SourceMapOptions; + webkit?: boolean; + width?: number; + wrap_iife?: boolean; +} + +export enum OutputQuoteStyle { + PreferDouble = 0, + AlwaysSingle = 1, + AlwaysDouble = 2, + AlwaysOriginal = 3 +} + +export interface MinifyOptions { + compress?: boolean | CompressOptions; + ecma?: ECMA; + ie8?: boolean; + keep_classnames?: boolean | RegExp; + keep_fnames?: boolean | RegExp; + mangle?: boolean | MangleOptions; + module?: boolean; + nameCache?: object; + output?: OutputOptions; + parse?: ParseOptions; + safari10?: boolean; + sourceMap?: boolean | SourceMapOptions; + toplevel?: boolean; + warnings?: boolean | 'verbose'; +} + +export interface MinifyOutput { + ast?: AST_Node; + code?: string; + error?: Error; + map?: string; + warnings?: string[]; +} + +export interface SourceMapOptions { + content?: RawSourceMap; + includeSources?: boolean; + filename?: string; + root?: string; + url?: string | 'inline'; +} + +declare function parse(text: string, options?: ParseOptions): AST_Node; + +export class TreeWalker { + constructor(callback: (node: AST_Node, descend?: (node: AST_Node) => void) => boolean | undefined); + directives: object; + find_parent(type: AST_Node): AST_Node | undefined; + has_directive(type: string): boolean; + loopcontrol_target(node: AST_Node): AST_Node | undefined; + parent(n: number): AST_Node | undefined; + pop(): void; + push(node: AST_Node): void; + self(): AST_Node | undefined; + stack: AST_Node[]; + visit: (node: AST_Node, descend: boolean) => any; +} + +export class TreeTransformer extends TreeWalker { + constructor( + before: (node: AST_Node, descend?: (node: AST_Node, tw: TreeWalker) => void, in_list?: boolean) => AST_Node | undefined, + after?: (node: AST_Node, in_list?: boolean) => AST_Node | undefined + ); + before: (node: AST_Node) => AST_Node; + after?: (node: AST_Node) => AST_Node; +} + +export function push_uniq(array: T[], el: T): void; + +type DictEachCallback = (val: any, key: string) => any; + +export class Dictionary { + static fromObject(obj: object): Dictionary; + add(key: string, val: any): this; + clone(): Dictionary; + del(key: string): this; + each(fn: DictEachCallback): void; + get(key: string): any; + has(key: string): boolean; + map(fn: DictEachCallback): any[]; + set(key: string, val: any): this; + size(): number; +} + +export function minify(files: string | string[] | { [file: string]: string } | AST_Node, options?: MinifyOptions): MinifyOutput; + +export class AST_Node { + constructor(props?: object); + static BASE?: AST_Node; + static PROPS: string[]; + static SELF_PROPS: string[]; + static SUBCLASSES: AST_Node[]; + static documentation: string; + static propdoc?: Record; + static expressions?: AST_Node[]; + static warn?: (text: string, props: any) => void; + static from_mozilla_ast?: (node: AST_Node) => any; + walk: (visitor: TreeWalker) => void; + print_to_string: (options?: OutputOptions) => string; + transform: (tt: TreeTransformer, in_list?: boolean) => AST_Node; + TYPE: string; + CTOR: typeof AST_Node; +} + +declare class SymbolDef { + constructor(scope?: AST_Scope, orig?: object, init?: object); + name: string; + orig: AST_SymbolRef[]; + init: AST_SymbolRef; + eliminated: number; + scope: AST_Scope; + references: AST_SymbolRef[]; + replaced: number; + global: boolean; + export: boolean; + mangled_name: null | string; + undeclared: boolean; + id: number; +} + +type ArgType = AST_SymbolFunarg | AST_DefaultAssign | AST_Destructuring | AST_Expansion; + +declare class AST_Statement extends AST_Node { + constructor(props?: object); +} + +declare class AST_Debugger extends AST_Statement { + constructor(props?: object); +} + +declare class AST_Directive extends AST_Statement { + constructor(props?: object); + value: string; + quote: string; +} + +declare class AST_SimpleStatement extends AST_Statement { + constructor(props?: object); + body: AST_Node[]; +} + +declare class AST_Block extends AST_Statement { + constructor(props?: object); + body: AST_Node[]; + block_scope: AST_Scope | null; +} + +declare class AST_BlockStatement extends AST_Block { + constructor(props?: object); +} + +declare class AST_Scope extends AST_Block { + constructor(props?: object); + variables: any; + functions: any; + uses_with: boolean; + uses_eval: boolean; + parent_scope: AST_Scope | null; + enclosed: any; + cname: any; +} + +declare class AST_Toplevel extends AST_Scope { + constructor(props?: object); + globals: any; +} + +declare class AST_Lambda extends AST_Scope { + constructor(props?: object); + name: AST_SymbolDeclaration | null; + argnames: ArgType[]; + uses_arguments: boolean; + is_generator: boolean; + async: boolean; +} + +declare class AST_Accessor extends AST_Lambda { + constructor(props?: object); +} + +declare class AST_Function extends AST_Lambda { + constructor(props?: object); + inlined: boolean; +} + +declare class AST_Arrow extends AST_Lambda { + constructor(props?: object); + inlined: boolean; +} + +declare class AST_Defun extends AST_Lambda { + constructor(props?: object); + inlined: boolean; +} + +declare class AST_Class extends AST_Scope { + constructor(props?: object); + name: AST_SymbolClass | AST_SymbolDefClass | null; + extends: AST_Node | null; + properties: AST_ObjectProperty[]; + inlined: boolean; +} + +declare class AST_DefClass extends AST_Class { + constructor(props?: object); +} + +declare class AST_ClassExpression extends AST_Class { + constructor(props?: object); +} + +declare class AST_Switch extends AST_Block { + constructor(props?: object); + expression: AST_Node; +} + +declare class AST_SwitchBranch extends AST_Block { + constructor(props?: object); +} + +declare class AST_Default extends AST_SwitchBranch { + constructor(props?: object); +} + +declare class AST_Case extends AST_SwitchBranch { + constructor(props?: object); + expression: AST_Node; +} + +declare class AST_Try extends AST_Block { + constructor(props?: object); + bcatch: AST_Catch; + bfinally: null | AST_Finally; +} + +declare class AST_Catch extends AST_Block { + constructor(props?: object); + argname: ArgType; +} + +declare class AST_Finally extends AST_Block { + constructor(props?: object); +} + +declare class AST_EmptyStatement extends AST_Statement { + constructor(props?: object); +} + +declare class AST_StatementWithBody extends AST_Statement { + constructor(props?: object); + body: AST_Node[]; +} + +declare class AST_LabeledStatement extends AST_StatementWithBody { + constructor(props?: object); + label: AST_Label; +} + +declare class AST_IterationStatement extends AST_StatementWithBody { + constructor(props?: object); + block_scope: AST_Scope | null; +} + +declare class AST_DWLoop extends AST_IterationStatement { + constructor(props?: object); + condition: AST_Node; +} + +declare class AST_Do extends AST_DWLoop { + constructor(props?: object); +} + +declare class AST_While extends AST_DWLoop { + constructor(props?: object); +} + +declare class AST_For extends AST_IterationStatement { + constructor(props?: object); + init: AST_Node | null; + condition: AST_Node | null; + step: AST_Node | null; +} + +declare class AST_ForIn extends AST_IterationStatement { + constructor(props?: object); + init: AST_Node | null; + object: AST_Node; +} + +declare class AST_ForOf extends AST_ForIn { + constructor(props?: object); + await: boolean; +} + +declare class AST_With extends AST_StatementWithBody { + constructor(props?: object); + expression: AST_Node; +} + +declare class AST_If extends AST_StatementWithBody { + constructor(props?: object); + condition: AST_Node; + alternative: AST_Node | null; +} + +declare class AST_Jump extends AST_Statement { + constructor(props?: object); +} + +declare class AST_Exit extends AST_Jump { + constructor(props?: object); + value: AST_Node | null; +} + +declare class AST_Return extends AST_Exit { + constructor(props?: object); +} + +declare class AST_Throw extends AST_Exit { + constructor(props?: object); +} + +declare class AST_LoopControl extends AST_Jump { + constructor(props?: object); + label: null | AST_LabelRef; +} + +declare class AST_Break extends AST_LoopControl { + constructor(props?: object); +} + +declare class AST_Continue extends AST_LoopControl { + constructor(props?: object); +} + +declare class AST_Definitions extends AST_Statement { + constructor(props?: object); + definitions: AST_VarDef[]; +} + +declare class AST_Var extends AST_Definitions { + constructor(props?: object); +} + +declare class AST_Let extends AST_Definitions { + constructor(props?: object); +} + +declare class AST_Const extends AST_Definitions { + constructor(props?: object); +} + +declare class AST_Export extends AST_Statement { + constructor(props?: object); + exported_definition: AST_Definitions | AST_Lambda | AST_DefClass | null; + exported_value: AST_Node | null; + is_default: boolean; + exported_names: AST_NameMapping[]; + module_name: AST_String; +} + +declare class AST_Expansion extends AST_Node { + constructor(props?: object); + expression: AST_Node; +} + +declare class AST_Destructuring extends AST_Node { + constructor(props?: object); + names: AST_Node[]; + is_array: boolean; +} + +declare class AST_PrefixedTemplateString extends AST_Node { + constructor(props?: object); + template_string: AST_TemplateString; + prefix: AST_Node; +} + +declare class AST_TemplateString extends AST_Node { + constructor(props?: object); + segments: AST_Node[]; +} + +declare class AST_TemplateSegment extends AST_Node { + constructor(props?: object); + value: string; + raw: string; +} + +declare class AST_NameMapping extends AST_Node { + constructor(props?: object); + foreign_name: AST_Symbol; + name: AST_SymbolExport | AST_SymbolImport; +} + +declare class AST_Import extends AST_Node { + constructor(props?: object); + imported_name: null | AST_SymbolImport; + imported_names: AST_NameMapping[]; + module_name: AST_String; +} + +declare class AST_VarDef extends AST_Node { + constructor(props?: object); + name: AST_Destructuring | AST_SymbolConst | AST_SymbolLet | AST_SymbolVar; + value: AST_Node | null; +} + +declare class AST_Call extends AST_Node { + constructor(props?: object); + expression: AST_Node; + args: AST_Node[]; +} + +declare class AST_New extends AST_Call { + constructor(props?: object); +} + +declare class AST_Sequence extends AST_Node { + constructor(props?: object); + expressions: AST_Node[]; +} + +declare class AST_PropAccess extends AST_Node { + constructor(props?: object); + expression: AST_Node; + property: AST_Node | string; +} + +declare class AST_Dot extends AST_PropAccess { + constructor(props?: object); +} + +declare class AST_Sub extends AST_PropAccess { + constructor(props?: object); +} + +declare class AST_Unary extends AST_Node { + constructor(props?: object); + operator: string; + expression: AST_Node; +} + +declare class AST_UnaryPrefix extends AST_Unary { + constructor(props?: object); +} + +declare class AST_UnaryPostfix extends AST_Unary { + constructor(props?: object); +} + +declare class AST_Binary extends AST_Node { + constructor(props?: object); + operator: string; + left: AST_Node; + right: AST_Node; +} + +declare class AST_Assign extends AST_Binary { + constructor(props?: object); +} + +declare class AST_DefaultAssign extends AST_Binary { + constructor(props?: object); +} + +declare class AST_Conditional extends AST_Node { + constructor(props?: object); + condition: AST_Node; + consequent: AST_Node; + alternative: AST_Node; +} + +declare class AST_Array extends AST_Node { + constructor(props?: object); + elements: AST_Node[]; +} + +declare class AST_Object extends AST_Node { + constructor(props?: object); + properties: AST_ObjectProperty[]; +} + +declare class AST_ObjectProperty extends AST_Node { + constructor(props?: object); + key: string | number | AST_Node; + value: AST_Node; +} + +declare class AST_ObjectKeyVal extends AST_ObjectProperty { + constructor(props?: object); + quote: string; +} + +declare class AST_ObjectSetter extends AST_ObjectProperty { + constructor(props?: object); + quote: string; + static: boolean; +} + +declare class AST_ObjectGetter extends AST_ObjectProperty { + constructor(props?: object); + quote: string; + static: boolean; +} + +declare class AST_ConciseMethod extends AST_ObjectProperty { + constructor(props?: object); + quote: string; + static: boolean; + is_generator: boolean; + async: boolean; +} + +declare class AST_Symbol extends AST_Node { + constructor(props?: object); + scope: AST_Scope; + name: string; + thedef: SymbolDef; +} + +declare class AST_SymbolDeclaration extends AST_Symbol { + constructor(props?: object); + init: AST_Node | null; +} + +declare class AST_SymbolVar extends AST_SymbolDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolFunarg extends AST_SymbolVar { + constructor(props?: object); +} + +declare class AST_SymbolBlockDeclaration extends AST_SymbolDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolConst extends AST_SymbolBlockDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolLet extends AST_SymbolBlockDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolDefClass extends AST_SymbolBlockDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolCatch extends AST_SymbolBlockDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolImport extends AST_SymbolBlockDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolDefun extends AST_SymbolDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolLambda extends AST_SymbolDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolClass extends AST_SymbolDeclaration { + constructor(props?: object); +} + +declare class AST_SymbolMethod extends AST_Symbol { + constructor(props?: object); +} + +declare class AST_SymbolImportForeign extends AST_Symbol { + constructor(props?: object); +} + +declare class AST_Label extends AST_Symbol { + constructor(props?: object); + references: AST_LoopControl | null; +} + +declare class AST_SymbolRef extends AST_Symbol { + constructor(props?: object); +} + +declare class AST_SymbolExport extends AST_SymbolRef { + constructor(props?: object); +} + +declare class AST_SymbolExportForeign extends AST_Symbol { + constructor(props?: object); +} + +declare class AST_LabelRef extends AST_Symbol { + constructor(props?: object); +} + +declare class AST_This extends AST_Symbol { + constructor(props?: object); +} + +declare class AST_Super extends AST_This { + constructor(props?: object); +} + +declare class AST_NewTarget extends AST_Node { + constructor(props?: object); +} + +declare class AST_Constant extends AST_Node { + constructor(props?: object); +} + +declare class AST_String extends AST_Constant { + constructor(props?: object); + value: string; + quote: string; +} + +declare class AST_Number extends AST_Constant { + constructor(props?: object); + value: number; + literal: string; +} + +declare class AST_RegExp extends AST_Constant { + constructor(props?: object); + value: RegExp; +} + +declare class AST_Atom extends AST_Constant { + constructor(props?: object); +} + +declare class AST_Null extends AST_Atom { + constructor(props?: object); +} + +declare class AST_NaN extends AST_Atom { + constructor(props?: object); +} + +declare class AST_Undefined extends AST_Atom { + constructor(props?: object); +} + +declare class AST_Hole extends AST_Atom { + constructor(props?: object); +} + +declare class AST_Infinity extends AST_Atom { + constructor(props?: object); +} + +declare class AST_Boolean extends AST_Atom { + constructor(props?: object); +} + +declare class AST_False extends AST_Boolean { + constructor(props?: object); +} + +declare class AST_True extends AST_Boolean { + constructor(props?: object); +} + +declare class AST_Await extends AST_Node { + constructor(props?: object); + expression: AST_Node; +} + +declare class AST_Yield extends AST_Node { + constructor(props?: object); + expression: AST_Node; + is_star: boolean; +} From d3f8ba2c8823e6102e625efd3f28fe79f35a43d8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 10:23:52 -0800 Subject: [PATCH 59/82] preserve quotes in terser --- tools/acorn-optimizer.js | 26 -------------------- tools/node_modules/terser/lib/mozilla-ast.js | 8 +++++- tools/node_modules/terser/package.json | 3 +++ 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/tools/acorn-optimizer.js b/tools/acorn-optimizer.js index ccb24bac2144..fdebd7959c55 100644 --- a/tools/acorn-optimizer.js +++ b/tools/acorn-optimizer.js @@ -769,32 +769,6 @@ passes.forEach(function(pass) { if (!noPrint) { var terserAst = Terser.AST_Node.from_mozilla_ast(ast); - // Uglify uses the "quoted" property to tell it to emit - // { "quotedname": .. } - // as opposed to - // { quotedname: } - // We need quoting for closure compiler to work - (function(node, c) { - (function inner(node) { - if (!(node && typeof node === 'object')) { - return; - } - if (Array.isArray(node)) { - node.forEach(inner); - } else { - for (var child in node) { - inner(node[child]); // has recursion, not a DAG! - } - } - c(node); - })(node); - })(terserAst, function(node) { - if (node.properties && Array.isArray(node.properties)) { - node.properties.forEach(function(prop) { - prop.quote = true - }); - } - }); var output = terserAst.print_to_string({ beautify: !minifyWhitespace, indent_level: minifyWhitespace ? 0 : 1, diff --git a/tools/node_modules/terser/lib/mozilla-ast.js b/tools/node_modules/terser/lib/mozilla-ast.js index c5129be5daaa..8d8842ad3b69 100644 --- a/tools/node_modules/terser/lib/mozilla-ast.js +++ b/tools/node_modules/terser/lib/mozilla-ast.js @@ -274,7 +274,13 @@ return from_moz(prop); } prop.type = "Property"; - return from_moz(prop); + // XXX EMSCRIPTEN preserve quoted properties + var ret = from_moz(prop); + if (prop.key.type === "Literal" && + (prop.key.raw[0] === '"' || prop.key.raw[0] === "'")) { + ret.quote = true; + } + return ret; }) }); }, diff --git a/tools/node_modules/terser/package.json b/tools/node_modules/terser/package.json index 7678de6d1216..6a7540e3f648 100644 --- a/tools/node_modules/terser/package.json +++ b/tools/node_modules/terser/package.json @@ -115,7 +115,10 @@ "await" ], "license": "BSD-2-Clause", + "main": "terser.js", + "how-to": "cat lib/utils.js lib/ast.js lib/parse.js lib/scope.js lib/output.js lib/mozilla-ast.js > terser.js", + "zmain": "dist/bundle.js", "maintainers": [ { From f0c4237dd8de8bec949ea348198e7b892c2802c1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 10:29:32 -0800 Subject: [PATCH 60/82] comment --- tools/node_modules/terser/lib/mozilla-ast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/node_modules/terser/lib/mozilla-ast.js b/tools/node_modules/terser/lib/mozilla-ast.js index 8d8842ad3b69..234866dd0819 100644 --- a/tools/node_modules/terser/lib/mozilla-ast.js +++ b/tools/node_modules/terser/lib/mozilla-ast.js @@ -274,7 +274,7 @@ return from_moz(prop); } prop.type = "Property"; - // XXX EMSCRIPTEN preserve quoted properties + // XXX EMSCRIPTEN https://github.com/mishoo/UglifyJS2/pull/3323 var ret = from_moz(prop); if (prop.key.type === "Literal" && (prop.key.raw[0] === '"' || prop.key.raw[0] === "'")) { From d8eb38272fd374694602f4ed99f4b8988de5e64c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 10:30:15 -0800 Subject: [PATCH 61/82] update test [ci skip] --- tests/optimizer/JSDCE-output.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/optimizer/JSDCE-output.js b/tests/optimizer/JSDCE-output.js index 8562cbc645e0..042c1583d207 100644 --- a/tests/optimizer/JSDCE-output.js +++ b/tests/optimizer/JSDCE-output.js @@ -3,7 +3,7 @@ var z = fleefl(); var zz = fleefl(); var keeperObj = { - "x": fleefl() + x: fleefl() }; var keeperArray = [ 1, 2, "3", four() ]; From 171d5af4d8b93052ea28e9dbd87c39c303c99fec Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 13:10:22 -0800 Subject: [PATCH 62/82] cleanup --- tools/node_modules/terser/terser.js | 8351 +++++++++++++++++++++++++++ 1 file changed, 8351 insertions(+) create mode 100644 tools/node_modules/terser/terser.js diff --git a/tools/node_modules/terser/terser.js b/tools/node_modules/terser/terser.js new file mode 100644 index 000000000000..5f029d5526b8 --- /dev/null +++ b/tools/node_modules/terser/terser.js @@ -0,0 +1,8351 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function characters(str) { + return str.split(""); +} + +function member(name, array) { + return array.indexOf(name) >= 0; +} + +function find_if(func, array) { + for (var i = 0, n = array.length; i < n; ++i) { + if (func(array[i])) + return array[i]; + } +} + +function repeat_string(str, i) { + if (i <= 0) return ""; + if (i == 1) return str; + var d = repeat_string(str, i >> 1); + d += d; + if (i & 1) d += str; + return d; +} + +function configure_error_stack(fn) { + Object.defineProperty(fn.prototype, "stack", { + get: function() { + var err = new Error(this.message); + err.name = this.name; + try { + throw err; + } catch(e) { + return e.stack; + } + } + }); +} + +function DefaultsError(msg, defs) { + this.message = msg; + this.defs = defs; +} +DefaultsError.prototype = Object.create(Error.prototype); +DefaultsError.prototype.constructor = DefaultsError; +DefaultsError.prototype.name = "DefaultsError"; +configure_error_stack(DefaultsError); + +DefaultsError.croak = function(msg, defs) { + throw new DefaultsError(msg, defs); +}; + +function defaults(args, defs, croak) { + if (args === true) + args = {}; + var ret = args || {}; + if (croak) for (var i in ret) if (HOP(ret, i) && !HOP(defs, i)) + DefaultsError.croak("`" + i + "` is not a supported option", defs); + for (var i in defs) if (HOP(defs, i)) { + ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; + } + return ret; +} + +function merge(obj, ext) { + var count = 0; + for (var i in ext) if (HOP(ext, i)) { + obj[i] = ext[i]; + count++; + } + return count; +} + +function noop() {} +function return_false() { return false; } +function return_true() { return true; } +function return_this() { return this; } +function return_null() { return null; } + +var MAP = (function() { + function MAP(a, f, backwards) { + var ret = [], top = [], i; + function doit() { + var val = f(a[i], i); + var is_last = val instanceof Last; + if (is_last) val = val.v; + if (val instanceof AtTop) { + val = val.v; + if (val instanceof Splice) { + top.push.apply(top, backwards ? val.v.slice().reverse() : val.v); + } else { + top.push(val); + } + } else if (val !== skip) { + if (val instanceof Splice) { + ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v); + } else { + ret.push(val); + } + } + return is_last; + } + if (a instanceof Array) { + if (backwards) { + for (i = a.length; --i >= 0;) if (doit()) break; + ret.reverse(); + top.reverse(); + } else { + for (i = 0; i < a.length; ++i) if (doit()) break; + } + } else { + for (i in a) if (HOP(a, i)) if (doit()) break; + } + return top.concat(ret); + } + MAP.at_top = function(val) { return new AtTop(val); }; + MAP.splice = function(val) { return new Splice(val); }; + MAP.last = function(val) { return new Last(val); }; + var skip = MAP.skip = {}; + function AtTop(val) { this.v = val; } + function Splice(val) { this.v = val; } + function Last(val) { this.v = val; } + return MAP; +})(); + +function push_uniq(array, el) { + if (array.indexOf(el) < 0) + array.push(el); +} + +function string_template(text, props) { + return text.replace(/\{(.+?)\}/g, function(str, p) { + return props && props[p]; + }); +} + +function remove(array, el) { + for (var i = array.length; --i >= 0;) { + if (array[i] === el) array.splice(i, 1); + } +} + +function mergeSort(array, cmp) { + if (array.length < 2) return array.slice(); + function merge(a, b) { + var r = [], ai = 0, bi = 0, i = 0; + while (ai < a.length && bi < b.length) { + cmp(a[ai], b[bi]) <= 0 + ? r[i++] = a[ai++] + : r[i++] = b[bi++]; + } + if (ai < a.length) r.push.apply(r, a.slice(ai)); + if (bi < b.length) r.push.apply(r, b.slice(bi)); + return r; + } + function _ms(a) { + if (a.length <= 1) + return a; + var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); + left = _ms(left); + right = _ms(right); + return merge(left, right); + } + return _ms(array); +} + +// this function is taken from Acorn [1], written by Marijn Haverbeke +// [1] https://github.com/marijnh/acorn +function makePredicate(words) { + if (!(words instanceof Array)) words = words.split(" "); + var f = "", cats = []; + out: for (var i = 0; i < words.length; ++i) { + for (var j = 0; j < cats.length; ++j) + if (cats[j][0].length == words[i].length) { + cats[j].push(words[i]); + continue out; + } + cats.push([words[i]]); + } + function quote(word) { + return JSON.stringify(word).replace(/[\u2028\u2029]/g, function(s) { + switch (s) { + case "\u2028": return "\\u2028"; + case "\u2029": return "\\u2029"; + } + return s; + }); + } + function compareTo(arr) { + if (arr.length == 1) return f += "return str === " + quote(arr[0]) + ";"; + f += "switch(str){"; + for (var i = 0; i < arr.length; ++i) f += "case " + quote(arr[i]) + ":"; + f += "return true}return false;"; + } + // When there are more than three length categories, an outer + // switch first dispatches on the lengths, to save on comparisons. + if (cats.length > 3) { + cats.sort(function(a, b) {return b.length - a.length;}); + f += "switch(str.length){"; + for (var i = 0; i < cats.length; ++i) { + var cat = cats[i]; + f += "case " + cat[0].length + ":"; + compareTo(cat); + } + f += "}"; + // Otherwise, simply generate a flat `switch` statement. + } else { + compareTo(words); + } + return new Function("str", f); +} + +function all(array, predicate) { + for (var i = array.length; --i >= 0;) + if (!predicate(array[i])) + return false; + return true; +} + +function Dictionary() { + this._values = Object.create(null); + this._size = 0; +} +Dictionary.prototype = { + set: function(key, val) { + if (!this.has(key)) ++this._size; + this._values["$" + key] = val; + return this; + }, + add: function(key, val) { + if (this.has(key)) { + this.get(key).push(val); + } else { + this.set(key, [ val ]); + } + return this; + }, + get: function(key) { return this._values["$" + key]; }, + del: function(key) { + if (this.has(key)) { + --this._size; + delete this._values["$" + key]; + } + return this; + }, + has: function(key) { return ("$" + key) in this._values; }, + each: function(f) { + for (var i in this._values) + f(this._values[i], i.substr(1)); + }, + size: function() { + return this._size; + }, + map: function(f) { + var ret = []; + for (var i in this._values) + ret.push(f(this._values[i], i.substr(1))); + return ret; + }, + clone: function() { + var ret = new Dictionary(); + for (var i in this._values) + ret._values[i] = this._values[i]; + ret._size = this._size; + return ret; + }, + toObject: function() { return this._values; } +}; +Dictionary.fromObject = function(obj) { + var dict = new Dictionary(); + dict._size = merge(dict._values, obj); + return dict; +}; +exports.Dictionary = Dictionary; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +// return true if the node at the top of the stack (that means the +// innermost node in the current output) is lexically the first in +// a statement. +function first_in_statement(stack) { + var node = stack.parent(-1); + for (var i = 0, p; p = stack.parent(i); i++) { + if (p instanceof AST_Statement && p.body === node) + return true; + if ((p instanceof AST_Sequence && p.expressions[0] === node) || + (p.TYPE == "Call" && p.expression === node ) || + (p instanceof AST_Dot && p.expression === node ) || + (p instanceof AST_Sub && p.expression === node ) || + (p instanceof AST_Conditional && p.condition === node ) || + (p instanceof AST_Binary && p.left === node ) || + (p instanceof AST_UnaryPostfix && p.expression === node ) + ) { + node = p; + } else { + return false; + } + } +} + +function keep_name(keep_setting, name) { + return keep_setting === true + || (keep_setting instanceof RegExp && keep_setting.test(name)); +} +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function DEFNODE(type, props, methods, base) { + if (arguments.length < 4) base = AST_Node; + if (!props) props = []; + else props = props.split(/\s+/); + var self_props = props; + if (base && base.PROPS) + props = props.concat(base.PROPS); + var code = "return function AST_" + type + "(props){ if (props) { "; + for (var i = props.length; --i >= 0;) { + code += "this." + props[i] + " = props." + props[i] + ";"; + } + var proto = base && new base; + if (proto && proto.initialize || (methods && methods.initialize)) + code += "this.initialize();"; + code += "}}"; + var ctor = new Function(code)(); + if (proto) { + ctor.prototype = proto; + ctor.BASE = base; + } + if (base) base.SUBCLASSES.push(ctor); + ctor.prototype.CTOR = ctor; + ctor.PROPS = props || null; + ctor.SELF_PROPS = self_props; + ctor.SUBCLASSES = []; + if (type) { + ctor.prototype.TYPE = ctor.TYPE = type; + } + if (methods) for (i in methods) if (HOP(methods, i)) { + if (/^\$/.test(i)) { + ctor[i.substr(1)] = methods[i]; + } else { + ctor.prototype[i] = methods[i]; + } + } + ctor.DEFMETHOD = function(name, method) { + this.prototype[name] = method; + }; + if (typeof exports !== "undefined") { + exports["AST_" + type] = ctor; + } + return ctor; +} + +var AST_Token = DEFNODE("Token", "type value line col pos endline endcol endpos nlb comments_before comments_after file raw", { +}, null); + +var AST_Node = DEFNODE("Node", "start end", { + _clone: function(deep) { + if (deep) { + var self = this.clone(); + return self.transform(new TreeTransformer(function(node) { + if (node !== self) { + return node.clone(true); + } + })); + } + return new this.CTOR(this); + }, + clone: function(deep) { + return this._clone(deep); + }, + $documentation: "Base class of all AST nodes", + $propdoc: { + start: "[AST_Token] The first token of this node", + end: "[AST_Token] The last token of this node" + }, + _walk: function(visitor) { + return visitor._visit(this); + }, + walk: function(visitor) { + return this._walk(visitor); // not sure the indirection will be any help + } +}, null); + +AST_Node.warn_function = null; +AST_Node.warn = function(txt, props) { + if (AST_Node.warn_function) + AST_Node.warn_function(string_template(txt, props)); +}; + +/* -----[ statements ]----- */ + +var AST_Statement = DEFNODE("Statement", null, { + $documentation: "Base class of all statements", +}); + +var AST_Debugger = DEFNODE("Debugger", null, { + $documentation: "Represents a debugger statement", +}, AST_Statement); + +var AST_Directive = DEFNODE("Directive", "value quote", { + $documentation: "Represents a directive, like \"use strict\";", + $propdoc: { + value: "[string] The value of this directive as a plain string (it's not an AST_String!)", + quote: "[string] the original quote character" + }, +}, AST_Statement); + +var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", { + $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", + $propdoc: { + body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.body._walk(visitor); + }); + } +}, AST_Statement); + +function walk_body(node, visitor) { + var body = node.body; + if (body instanceof AST_Node) { + body._walk(visitor); + } else for (var i = 0, len = body.length; i < len; i++) { + body[i]._walk(visitor); + } +} + +function clone_block_scope(deep) { + var clone = this._clone(deep); + if (this.block_scope) { + // TODO this is sometimes undefined during compression. + // But it should always have a value! + clone.block_scope = this.block_scope.clone(); + } + return clone; +} + +var AST_Block = DEFNODE("Block", "body block_scope", { + $documentation: "A body of statements (usually braced)", + $propdoc: { + body: "[AST_Statement*] an array of statements", + block_scope: "[AST_Scope] the block scope" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + walk_body(this, visitor); + }); + }, + clone: clone_block_scope +}, AST_Statement); + +var AST_BlockStatement = DEFNODE("BlockStatement", null, { + $documentation: "A block statement", +}, AST_Block); + +var AST_EmptyStatement = DEFNODE("EmptyStatement", null, { + $documentation: "The empty statement (empty block or simply a semicolon)" +}, AST_Statement); + +var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", { + $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", + $propdoc: { + body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" + } +}, AST_Statement); + +var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", { + $documentation: "Statement with a label", + $propdoc: { + label: "[AST_Label] a label definition" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.label._walk(visitor); + this.body._walk(visitor); + }); + }, + clone: function(deep) { + var node = this._clone(deep); + if (deep) { + var label = node.label; + var def = this.label; + node.walk(new TreeWalker(function(node) { + if (node instanceof AST_LoopControl + && node.label && node.label.thedef === def) { + node.label.thedef = label; + label.references.push(node); + } + })); + } + return node; + } +}, AST_StatementWithBody); + +var AST_IterationStatement = DEFNODE("IterationStatement", "block_scope", { + $documentation: "Internal class. All loops inherit from it.", + $propdoc: { + block_scope: "[AST_Scope] the block scope for this iteration statement." + }, + clone: clone_block_scope +}, AST_StatementWithBody); + +var AST_DWLoop = DEFNODE("DWLoop", "condition", { + $documentation: "Base class for do/while statements", + $propdoc: { + condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" + } +}, AST_IterationStatement); + +var AST_Do = DEFNODE("Do", null, { + $documentation: "A `do` statement", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.body._walk(visitor); + this.condition._walk(visitor); + }); + } +}, AST_DWLoop); + +var AST_While = DEFNODE("While", null, { + $documentation: "A `while` statement", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.condition._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_DWLoop); + +var AST_For = DEFNODE("For", "init condition step", { + $documentation: "A `for` statement", + $propdoc: { + init: "[AST_Node?] the `for` initialization code, or null if empty", + condition: "[AST_Node?] the `for` termination clause, or null if empty", + step: "[AST_Node?] the `for` update clause, or null if empty" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.init) this.init._walk(visitor); + if (this.condition) this.condition._walk(visitor); + if (this.step) this.step._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_IterationStatement); + +var AST_ForIn = DEFNODE("ForIn", "init object", { + $documentation: "A `for ... in` statement", + $propdoc: { + init: "[AST_Node] the `for/in` initialization code", + object: "[AST_Node] the object that we're looping through" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.init._walk(visitor); + this.object._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_IterationStatement); + +var AST_ForOf = DEFNODE("ForOf", "await", { + $documentation: "A `for ... of` statement", +}, AST_ForIn); + +var AST_With = DEFNODE("With", "expression", { + $documentation: "A `with` statement", + $propdoc: { + expression: "[AST_Node] the `with` expression" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + this.body._walk(visitor); + }); + } +}, AST_StatementWithBody); + +/* -----[ scope and functions ]----- */ + +var AST_Scope = DEFNODE("Scope", "variables functions uses_with uses_eval parent_scope enclosed cname", { + $documentation: "Base class for all statements introducing a lexical scope", + $propdoc: { + variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope", + functions: "[Object/S] like `variables`, but only lists function declarations", + uses_with: "[boolean/S] tells whether this scope uses the `with` statement", + uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", + parent_scope: "[AST_Scope?/S] link to the parent scope", + enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", + cname: "[integer/S] current index for mangling variables (used internally by the mangler)", + }, + get_defun_scope: function() { + var self = this; + while (self.is_block_scope()) { + self = self.parent_scope; + } + return self; + }, + clone: function(deep) { + var node = this._clone(deep); + if (this.variables) node.variables = this.variables.clone(); + if (this.functions) node.functions = this.functions.clone(); + if (this.enclosed) node.enclosed = this.enclosed.slice(); + return node; + }, + pinned: function() { + return this.uses_eval || this.uses_with; + } +}, AST_Block); + +var AST_Toplevel = DEFNODE("Toplevel", "globals", { + $documentation: "The toplevel scope", + $propdoc: { + globals: "[Object/S] a map of name -> SymbolDef for all undeclared names", + }, + wrap_commonjs: function(name) { + var body = this.body; + var wrapped_tl = "(function(exports){'$ORIG';})(typeof " + name + "=='undefined'?(" + name + "={}):" + name + ");"; + wrapped_tl = parse(wrapped_tl); + wrapped_tl = wrapped_tl.transform(new TreeTransformer(function(node) { + if (node instanceof AST_Directive && node.value == "$ORIG") { + return MAP.splice(body); + } + })); + return wrapped_tl; + }, + wrap_enclose: function(args_values) { + if (typeof args_values != "string") args_values = ""; + var index = args_values.indexOf(":"); + if (index < 0) index = args_values.length; + var body = this.body; + return parse([ + "(function(", + args_values.slice(0, index), + '){"$ORIG"})(', + args_values.slice(index + 1), + ")" + ].join("")).transform(new TreeTransformer(function(node) { + if (node instanceof AST_Directive && node.value == "$ORIG") { + return MAP.splice(body); + } + })); + } +}, AST_Scope); + +var AST_Expansion = DEFNODE("Expansion", "expression", { + $documentation: "An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list", + $propdoc: { + expression: "[AST_Node] the thing to be expanded" + }, + _walk: function(visitor) { + var self = this; + return visitor._visit(this, function() { + self.expression.walk(visitor); + }); + } +}); + +var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments is_generator async", { + $documentation: "Base class for functions", + $propdoc: { + name: "[AST_SymbolDeclaration?] the name of this function", + argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments", + uses_arguments: "[boolean/S] tells whether this function accesses the arguments array", + is_generator: "[boolean] is this a generator method", + async: "[boolean] is this method async", + }, + args_as_names: function () { + var out = []; + for (var i = 0; i < this.argnames.length; i++) { + if (this.argnames[i] instanceof AST_Destructuring) { + out = out.concat(this.argnames[i].all_symbols()); + } else { + out.push(this.argnames[i]); + } + } + return out; + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.name) this.name._walk(visitor); + var argnames = this.argnames; + for (var i = 0, len = argnames.length; i < len; i++) { + argnames[i]._walk(visitor); + } + walk_body(this, visitor); + }); + } +}, AST_Scope); + +var AST_Accessor = DEFNODE("Accessor", null, { + $documentation: "A setter/getter function. The `name` property is always null." +}, AST_Lambda); + +var AST_Function = DEFNODE("Function", "inlined", { + $documentation: "A function expression" +}, AST_Lambda); + +var AST_Arrow = DEFNODE("Arrow", "inlined", { + $documentation: "An ES6 Arrow function ((a) => b)" +}, AST_Lambda); + +var AST_Defun = DEFNODE("Defun", "inlined", { + $documentation: "A function definition" +}, AST_Lambda); + +/* -----[ DESTRUCTURING ]----- */ +var AST_Destructuring = DEFNODE("Destructuring", "names is_array", { + $documentation: "A destructuring of several names. Used in destructuring assignment and with destructuring function argument names", + $propdoc: { + "names": "[AST_Node*] Array of properties or elements", + "is_array": "[Boolean] Whether the destructuring represents an object or array" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.names.forEach(function(name) { + name._walk(visitor); + }); + }); + }, + all_symbols: function() { + var out = []; + this.walk(new TreeWalker(function (node) { + if (node instanceof AST_Symbol) { + out.push(node); + } + if (node instanceof AST_Expansion) { + out.push(node.expression); + } + })); + return out; + } +}); + +var AST_PrefixedTemplateString = DEFNODE("PrefixedTemplateString", "template_string prefix", { + $documentation: "A templatestring with a prefix, such as String.raw`foobarbaz`", + $propdoc: { + template_string: "[AST_TemplateString] The template string", + prefix: "[AST_SymbolRef|AST_PropAccess] The prefix, which can be a symbol such as `foo` or a dotted expression such as `String.raw`." + }, + _walk: function(visitor) { + this.prefix._walk(visitor); + this.template_string._walk(visitor); + } +}); + +var AST_TemplateString = DEFNODE("TemplateString", "segments", { + $documentation: "A template string literal", + $propdoc: { + segments: "[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment." + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.segments.forEach(function(seg) { + seg._walk(visitor); + }); + }); + } +}); + +var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", { + $documentation: "A segment of a template string literal", + $propdoc: { + value: "Content of the segment", + raw: "Raw content of the segment" + } +}); + +/* -----[ JUMPS ]----- */ + +var AST_Jump = DEFNODE("Jump", null, { + $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)" +}, AST_Statement); + +var AST_Exit = DEFNODE("Exit", "value", { + $documentation: "Base class for “exits” (`return` and `throw`)", + $propdoc: { + value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" + }, + _walk: function(visitor) { + return visitor._visit(this, this.value && function() { + this.value._walk(visitor); + }); + } +}, AST_Jump); + +var AST_Return = DEFNODE("Return", null, { + $documentation: "A `return` statement" +}, AST_Exit); + +var AST_Throw = DEFNODE("Throw", null, { + $documentation: "A `throw` statement" +}, AST_Exit); + +var AST_LoopControl = DEFNODE("LoopControl", "label", { + $documentation: "Base class for loop control statements (`break` and `continue`)", + $propdoc: { + label: "[AST_LabelRef?] the label, or null if none", + }, + _walk: function(visitor) { + return visitor._visit(this, this.label && function() { + this.label._walk(visitor); + }); + } +}, AST_Jump); + +var AST_Break = DEFNODE("Break", null, { + $documentation: "A `break` statement" +}, AST_LoopControl); + +var AST_Continue = DEFNODE("Continue", null, { + $documentation: "A `continue` statement" +}, AST_LoopControl); + +/* -----[ IF ]----- */ + +var AST_If = DEFNODE("If", "condition alternative", { + $documentation: "A `if` statement", + $propdoc: { + condition: "[AST_Node] the `if` condition", + alternative: "[AST_Statement?] the `else` part, or null if not present" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.condition._walk(visitor); + this.body._walk(visitor); + if (this.alternative) this.alternative._walk(visitor); + }); + } +}, AST_StatementWithBody); + +/* -----[ SWITCH ]----- */ + +var AST_Switch = DEFNODE("Switch", "expression", { + $documentation: "A `switch` statement", + $propdoc: { + expression: "[AST_Node] the `switch` “discriminant”" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + walk_body(this, visitor); + }); + } +}, AST_Block); + +var AST_SwitchBranch = DEFNODE("SwitchBranch", null, { + $documentation: "Base class for `switch` branches", +}, AST_Block); + +var AST_Default = DEFNODE("Default", null, { + $documentation: "A `default` switch branch", +}, AST_SwitchBranch); + +var AST_Case = DEFNODE("Case", "expression", { + $documentation: "A `case` switch branch", + $propdoc: { + expression: "[AST_Node] the `case` expression" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + walk_body(this, visitor); + }); + } +}, AST_SwitchBranch); + +/* -----[ EXCEPTIONS ]----- */ + +var AST_Try = DEFNODE("Try", "bcatch bfinally", { + $documentation: "A `try` statement", + $propdoc: { + bcatch: "[AST_Catch?] the catch block, or null if not present", + bfinally: "[AST_Finally?] the finally block, or null if not present" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + walk_body(this, visitor); + if (this.bcatch) this.bcatch._walk(visitor); + if (this.bfinally) this.bfinally._walk(visitor); + }); + } +}, AST_Block); + +var AST_Catch = DEFNODE("Catch", "argname", { + $documentation: "A `catch` node; only makes sense as part of a `try` statement", + $propdoc: { + argname: "[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.argname) this.argname._walk(visitor); + walk_body(this, visitor); + }); + } +}, AST_Block); + +var AST_Finally = DEFNODE("Finally", null, { + $documentation: "A `finally` node; only makes sense as part of a `try` statement" +}, AST_Block); + +/* -----[ VAR/CONST ]----- */ + +var AST_Definitions = DEFNODE("Definitions", "definitions", { + $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", + $propdoc: { + definitions: "[AST_VarDef*] array of variable definitions" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var definitions = this.definitions; + for (var i = 0, len = definitions.length; i < len; i++) { + definitions[i]._walk(visitor); + } + }); + } +}, AST_Statement); + +var AST_Var = DEFNODE("Var", null, { + $documentation: "A `var` statement" +}, AST_Definitions); + +var AST_Let = DEFNODE("Let", null, { + $documentation: "A `let` statement" +}, AST_Definitions); + +var AST_Const = DEFNODE("Const", null, { + $documentation: "A `const` statement" +}, AST_Definitions); + +var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", { + $documentation: "The part of the export/import statement that declare names from a module.", + $propdoc: { + foreign_name: "[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)", + name: "[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module." + }, + _walk: function (visitor) { + return visitor._visit(this, function() { + this.foreign_name._walk(visitor); + this.name._walk(visitor); + }); + } +}); + +var AST_Import = DEFNODE("Import", "imported_name imported_names module_name", { + $documentation: "An `import` statement", + $propdoc: { + imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.", + imported_names: "[AST_NameMapping*] The names of non-default imported variables", + module_name: "[AST_String] String literal describing where this module came from", + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.imported_name) { + this.imported_name._walk(visitor); + } + if (this.imported_names) { + this.imported_names.forEach(function(name_import) { + name_import._walk(visitor); + }); + } + this.module_name._walk(visitor); + }); + } +}); + +var AST_Export = DEFNODE("Export", "exported_definition exported_value is_default exported_names module_name", { + $documentation: "An `export` statement", + $propdoc: { + exported_definition: "[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition", + exported_value: "[AST_Node?] An exported value", + exported_names: "[AST_NameMapping*?] List of exported names", + module_name: "[AST_String?] Name of the file to load exports from", + is_default: "[Boolean] Whether this is the default exported value of this module" + }, + _walk: function (visitor) { + visitor._visit(this, function () { + if (this.exported_definition) { + this.exported_definition._walk(visitor); + } + if (this.exported_value) { + this.exported_value._walk(visitor); + } + if (this.exported_names) { + this.exported_names.forEach(function(name_export) { + name_export._walk(visitor); + }); + } + if (this.module_name) { + this.module_name._walk(visitor); + } + }); + } +}, AST_Statement); + +var AST_VarDef = DEFNODE("VarDef", "name value", { + $documentation: "A variable declaration; only appears in a AST_Definitions node", + $propdoc: { + name: "[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable", + value: "[AST_Node?] initializer, or null of there's no initializer" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.name._walk(visitor); + if (this.value) this.value._walk(visitor); + }); + } +}); + +/* -----[ OTHER ]----- */ + +var AST_Call = DEFNODE("Call", "expression args", { + $documentation: "A function call expression", + $propdoc: { + expression: "[AST_Node] expression to invoke as function", + args: "[AST_Node*] array of arguments" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var args = this.args; + for (var i = 0, len = args.length; i < len; i++) { + args[i]._walk(visitor); + } + this.expression._walk(visitor); + }); + } +}); + +var AST_New = DEFNODE("New", null, { + $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" +}, AST_Call); + +var AST_Sequence = DEFNODE("Sequence", "expressions", { + $documentation: "A sequence expression (comma-separated expressions)", + $propdoc: { + expressions: "[AST_Node*] array of expressions (at least two)" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expressions.forEach(function(node) { + node._walk(visitor); + }); + }); + } +}); + +var AST_PropAccess = DEFNODE("PropAccess", "expression property", { + $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`", + $propdoc: { + expression: "[AST_Node] the “container” expression", + property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node" + } +}); + +var AST_Dot = DEFNODE("Dot", null, { + $documentation: "A dotted property access expression", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + }); + } +}, AST_PropAccess); + +var AST_Sub = DEFNODE("Sub", null, { + $documentation: "Index-style property access, i.e. `a[\"foo\"]`", + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + this.property._walk(visitor); + }); + } +}, AST_PropAccess); + +var AST_Unary = DEFNODE("Unary", "operator expression", { + $documentation: "Base class for unary expressions", + $propdoc: { + operator: "[string] the operator", + expression: "[AST_Node] expression that this unary operator applies to" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + }); + } +}); + +var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, { + $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" +}, AST_Unary); + +var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, { + $documentation: "Unary postfix expression, i.e. `i++`" +}, AST_Unary); + +var AST_Binary = DEFNODE("Binary", "operator left right", { + $documentation: "Binary expression, i.e. `a + b`", + $propdoc: { + left: "[AST_Node] left-hand side expression", + operator: "[string] the operator", + right: "[AST_Node] right-hand side expression" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.left._walk(visitor); + this.right._walk(visitor); + }); + } +}); + +var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", { + $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", + $propdoc: { + condition: "[AST_Node]", + consequent: "[AST_Node]", + alternative: "[AST_Node]" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.condition._walk(visitor); + this.consequent._walk(visitor); + this.alternative._walk(visitor); + }); + } +}); + +var AST_Assign = DEFNODE("Assign", null, { + $documentation: "An assignment expression — `a = b + 5`", +}, AST_Binary); + +var AST_DefaultAssign = DEFNODE("DefaultAssign", null, { + $documentation: "A default assignment expression like in `(a = 3) => a`" +}, AST_Binary); + +/* -----[ LITERALS ]----- */ + +var AST_Array = DEFNODE("Array", "elements", { + $documentation: "An array literal", + $propdoc: { + elements: "[AST_Node*] array of elements" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var elements = this.elements; + for (var i = 0, len = elements.length; i < len; i++) { + elements[i]._walk(visitor); + } + }); + } +}); + +var AST_Object = DEFNODE("Object", "properties", { + $documentation: "An object literal", + $propdoc: { + properties: "[AST_ObjectProperty*] array of properties" + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + var properties = this.properties; + for (var i = 0, len = properties.length; i < len; i++) { + properties[i]._walk(visitor); + } + }); + } +}); + +var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", { + $documentation: "Base class for literal object properties", + $propdoc: { + key: "[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.", + value: "[AST_Node] property value. For getters and setters this is an AST_Accessor." + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.key instanceof AST_Node) + this.key._walk(visitor); + this.value._walk(visitor); + }); + } +}); + +var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", "quote", { + $documentation: "A key: value object property", + $propdoc: { + quote: "[string] the original quote character" + } +}, AST_ObjectProperty); + +var AST_ObjectSetter = DEFNODE("ObjectSetter", "quote static", { + $propdoc: { + quote: "[string|undefined] the original quote character, if any", + static: "[boolean] whether this is a static setter (classes only)" + }, + $documentation: "An object setter property", +}, AST_ObjectProperty); + +var AST_ObjectGetter = DEFNODE("ObjectGetter", "quote static", { + $propdoc: { + quote: "[string|undefined] the original quote character, if any", + static: "[boolean] whether this is a static getter (classes only)" + }, + $documentation: "An object getter property", +}, AST_ObjectProperty); + +var AST_ConciseMethod = DEFNODE("ConciseMethod", "quote static is_generator async", { + $propdoc: { + quote: "[string|undefined] the original quote character, if any", + static: "[boolean] is this method static (classes only)", + is_generator: "[boolean] is this a generator method", + async: "[boolean] is this method async", + }, + $documentation: "An ES6 concise method inside an object or class" +}, AST_ObjectProperty); + +var AST_Class = DEFNODE("Class", "name extends properties inlined", { + $propdoc: { + name: "[AST_SymbolClass|AST_SymbolDefClass?] optional class name.", + extends: "[AST_Node]? optional parent class", + properties: "[AST_ObjectProperty*] array of properties" + }, + $documentation: "An ES6 class", + _walk: function(visitor) { + return visitor._visit(this, function() { + if (this.name) { + this.name._walk(visitor); + } + if (this.extends) { + this.extends._walk(visitor); + } + this.properties.forEach(function(prop) { + prop._walk(visitor); + }); + }); + }, +}, AST_Scope); + +var AST_DefClass = DEFNODE("DefClass", null, { + $documentation: "A class definition", +}, AST_Class); + +var AST_ClassExpression = DEFNODE("ClassExpression", null, { + $documentation: "A class expression." +}, AST_Class); + +var AST_Symbol = DEFNODE("Symbol", "scope name thedef", { + $propdoc: { + name: "[string] name of this symbol", + scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", + thedef: "[SymbolDef/S] the definition of this symbol" + }, + $documentation: "Base class for all symbols" +}); + +var AST_NewTarget = DEFNODE("NewTarget", null, { + $documentation: "A reference to new.target" +}); + +var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", { + $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)", +}, AST_Symbol); + +var AST_SymbolVar = DEFNODE("SymbolVar", null, { + $documentation: "Symbol defining a variable", +}, AST_SymbolDeclaration); + +var AST_SymbolBlockDeclaration = DEFNODE("SymbolBlockDeclaration", null, { + $documentation: "Base class for block-scoped declaration symbols" +}, AST_SymbolDeclaration); + +var AST_SymbolConst = DEFNODE("SymbolConst", null, { + $documentation: "A constant declaration" +}, AST_SymbolBlockDeclaration); + +var AST_SymbolLet = DEFNODE("SymbolLet", null, { + $documentation: "A block-scoped `let` declaration" +}, AST_SymbolBlockDeclaration); + +var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, { + $documentation: "Symbol naming a function argument", +}, AST_SymbolVar); + +var AST_SymbolDefun = DEFNODE("SymbolDefun", null, { + $documentation: "Symbol defining a function", +}, AST_SymbolDeclaration); + +var AST_SymbolMethod = DEFNODE("SymbolMethod", null, { + $documentation: "Symbol in an object defining a method", +}, AST_Symbol); + +var AST_SymbolLambda = DEFNODE("SymbolLambda", null, { + $documentation: "Symbol naming a function expression", +}, AST_SymbolDeclaration); + +var AST_SymbolDefClass = DEFNODE("SymbolDefClass", null, { + $documentation: "Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class." +}, AST_SymbolBlockDeclaration); + +var AST_SymbolClass = DEFNODE("SymbolClass", null, { + $documentation: "Symbol naming a class's name. Lexically scoped to the class." +}, AST_SymbolDeclaration); + +var AST_SymbolCatch = DEFNODE("SymbolCatch", null, { + $documentation: "Symbol naming the exception in catch", +}, AST_SymbolBlockDeclaration); + +var AST_SymbolImport = DEFNODE("SymbolImport", null, { + $documentation: "Symbol referring to an imported name", +}, AST_SymbolBlockDeclaration); + +var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign", null, { + $documentation: "A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes", +}, AST_Symbol); + +var AST_Label = DEFNODE("Label", "references", { + $documentation: "Symbol naming a label (declaration)", + $propdoc: { + references: "[AST_LoopControl*] a list of nodes referring to this label" + }, + initialize: function() { + this.references = []; + this.thedef = this; + } +}, AST_Symbol); + +var AST_SymbolRef = DEFNODE("SymbolRef", null, { + $documentation: "Reference to some symbol (not definition/declaration)", +}, AST_Symbol); + +var AST_SymbolExport = DEFNODE("SymbolExport", null, { + $documentation: "Symbol referring to a name to export", +}, AST_SymbolRef); + +var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign", null, { + $documentation: "A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes", +}, AST_Symbol); + +var AST_LabelRef = DEFNODE("LabelRef", null, { + $documentation: "Reference to a label symbol", +}, AST_Symbol); + +var AST_This = DEFNODE("This", null, { + $documentation: "The `this` symbol", +}, AST_Symbol); + +var AST_Super = DEFNODE("Super", null, { + $documentation: "The `super` symbol", +}, AST_This); + +var AST_Constant = DEFNODE("Constant", null, { + $documentation: "Base class for all constants", + getValue: function() { + return this.value; + } +}); + +var AST_String = DEFNODE("String", "value quote", { + $documentation: "A string literal", + $propdoc: { + value: "[string] the contents of this string", + quote: "[string] the original quote character" + } +}, AST_Constant); + +var AST_Number = DEFNODE("Number", "value literal", { + $documentation: "A number literal", + $propdoc: { + value: "[number] the numeric value", + literal: "[string] numeric value as string (optional)" + } +}, AST_Constant); + +var AST_RegExp = DEFNODE("RegExp", "value", { + $documentation: "A regexp literal", + $propdoc: { + value: "[RegExp] the actual regexp", + } +}, AST_Constant); + +var AST_Atom = DEFNODE("Atom", null, { + $documentation: "Base class for atoms", +}, AST_Constant); + +var AST_Null = DEFNODE("Null", null, { + $documentation: "The `null` atom", + value: null +}, AST_Atom); + +var AST_NaN = DEFNODE("NaN", null, { + $documentation: "The impossible value", + value: 0/0 +}, AST_Atom); + +var AST_Undefined = DEFNODE("Undefined", null, { + $documentation: "The `undefined` value", + value: (function() {}()) +}, AST_Atom); + +var AST_Hole = DEFNODE("Hole", null, { + $documentation: "A hole in an array", + value: (function() {}()) +}, AST_Atom); + +var AST_Infinity = DEFNODE("Infinity", null, { + $documentation: "The `Infinity` value", + value: 1/0 +}, AST_Atom); + +var AST_Boolean = DEFNODE("Boolean", null, { + $documentation: "Base class for booleans", +}, AST_Atom); + +var AST_False = DEFNODE("False", null, { + $documentation: "The `false` atom", + value: false +}, AST_Boolean); + +var AST_True = DEFNODE("True", null, { + $documentation: "The `true` atom", + value: true +}, AST_Boolean); + +var AST_Await = DEFNODE("Await", "expression", { + $documentation: "An `await` statement", + $propdoc: { + expression: "[AST_Node] the mandatory expression being awaited", + }, + _walk: function(visitor) { + return visitor._visit(this, function() { + this.expression._walk(visitor); + }); + } +}); + +var AST_Yield = DEFNODE("Yield", "expression is_star", { + $documentation: "A `yield` statement", + $propdoc: { + expression: "[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false", + is_star: "[Boolean] Whether this is a yield or yield* statement" + }, + _walk: function(visitor) { + return visitor._visit(this, this.expression && function() { + this.expression._walk(visitor); + }); + } +}); + +/* -----[ TreeWalker ]----- */ + +function TreeWalker(callback) { + this.visit = callback; + this.stack = []; + this.directives = Object.create(null); +} +TreeWalker.prototype = { + _visit: function(node, descend) { + this.push(node); + var ret = this.visit(node, descend ? function() { + descend.call(node); + } : noop); + if (!ret && descend) { + descend.call(node); + } + this.pop(); + return ret; + }, + parent: function(n) { + return this.stack[this.stack.length - 2 - (n || 0)]; + }, + push: function(node) { + if (node instanceof AST_Lambda) { + this.directives = Object.create(this.directives); + } else if (node instanceof AST_Directive && !this.directives[node.value]) { + this.directives[node.value] = node; + } else if (node instanceof AST_Class) { + this.directives = Object.create(this.directives); + if (!this.directives["use strict"]) { + this.directives["use strict"] = node; + } + } + this.stack.push(node); + }, + pop: function() { + var node = this.stack.pop(); + if (node instanceof AST_Lambda || node instanceof AST_Class) { + this.directives = Object.getPrototypeOf(this.directives); + } + }, + self: function() { + return this.stack[this.stack.length - 1]; + }, + find_parent: function(type) { + var stack = this.stack; + for (var i = stack.length; --i >= 0;) { + var x = stack[i]; + if (x instanceof type) return x; + } + }, + has_directive: function(type) { + var dir = this.directives[type]; + if (dir) return dir; + var node = this.stack[this.stack.length - 1]; + if (node instanceof AST_Scope && node.body) { + for (var i = 0; i < node.body.length; ++i) { + var st = node.body[i]; + if (!(st instanceof AST_Directive)) break; + if (st.value == type) return st; + } + } + }, + loopcontrol_target: function(node) { + var stack = this.stack; + if (node.label) for (var i = stack.length; --i >= 0;) { + var x = stack[i]; + if (x instanceof AST_LabeledStatement && x.label.name == node.label.name) + return x.body; + } else for (var i = stack.length; --i >= 0;) { + var x = stack[i]; + if (x instanceof AST_IterationStatement + || node instanceof AST_Break && x instanceof AST_Switch) + return x; + } + } +}; +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/). + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +var KEYWORDS = "break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with"; +var KEYWORDS_ATOM = "false null true"; +var RESERVED_WORDS = "enum implements import interface package private protected public static super this " + KEYWORDS_ATOM + " " + KEYWORDS; +var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case yield await"; + +KEYWORDS = makePredicate(KEYWORDS); +RESERVED_WORDS = makePredicate(RESERVED_WORDS); +KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION); +KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM); + +var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^")); + +var RE_NUM_LITERAL = /[0-9a-f]/i; +var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; +var RE_OCT_NUMBER = /^0[0-7]+$/; +var RE_ES6_OCT_NUMBER = /^0o[0-7]+$/i; +var RE_BIN_NUMBER = /^0b[01]+$/i; +var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; + +var OPERATORS = makePredicate([ + "in", + "instanceof", + "typeof", + "new", + "void", + "delete", + "++", + "--", + "+", + "-", + "!", + "~", + "&", + "|", + "^", + "*", + "**", + "/", + "%", + ">>", + "<<", + ">>>", + "<", + ">", + "<=", + ">=", + "==", + "===", + "!=", + "!==", + "?", + "=", + "+=", + "-=", + "/=", + "*=", + "**=", + "%=", + ">>=", + "<<=", + ">>>=", + "|=", + "^=", + "&=", + "&&", + "||" +]); + +var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\uFEFF")); + +var NEWLINE_CHARS = makePredicate(characters("\n\r\u2028\u2029")); + +var PUNC_AFTER_EXPRESSION = makePredicate(characters(";]),:")); + +var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,;:")); + +var PUNC_CHARS = makePredicate(characters("[]{}(),;:")); + +/* -----[ Tokenizer ]----- */ + +// surrogate safe regexps adapted from https://github.com/mathiasbynens/unicode-8.0.0/tree/89b412d8a71ecca9ed593d9e9fa073ab64acfebe/Binary_Property +var UNICODE = { + ID_Start: /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E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F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92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\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFB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DCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/, +}; + +function get_full_char(str, pos) { + var char = str.charAt(pos); + if (is_surrogate_pair_head(char)) { + var next = str.charAt(pos + 1); + if (is_surrogate_pair_tail(next)) { + return char + next; + } + } + if (is_surrogate_pair_tail(char)) { + var prev = str.charAt(pos - 1); + if (is_surrogate_pair_head(prev)) { + return prev + char; + } + } + return char; +} + +function get_full_char_code(str, pos) { + // https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates + if (is_surrogate_pair_head(str.charAt(pos))) { + return 0x10000 + (str.charCodeAt(pos) - 0xd800 << 10) + str.charCodeAt(pos + 1) - 0xdc00; + } + return str.charCodeAt(pos); +} + +function get_full_char_length(str) { + var surrogates = 0; + + for (var i = 0; i < str.length; i++) { + if (is_surrogate_pair_head(str.charCodeAt(i))) { + if (is_surrogate_pair_tail(str.charCodeAt(i + 1))) { + surrogates++; + i++; + } + } + } + + return str.length - surrogates; +} + +function from_char_code(code) { + // Based on https://github.com/mathiasbynens/String.fromCodePoint/blob/master/fromcodepoint.js + if (code > 0xFFFF) { + code -= 0x10000; + return (String.fromCharCode((code >> 10) + 0xD800) + + String.fromCharCode((code % 0x400) + 0xDC00)); + } + return String.fromCharCode(code); +} + +function is_surrogate_pair_head(code) { + if (typeof code === "string") + code = code.charCodeAt(0); + + return code >= 0xd800 && code <= 0xdbff; +} + +function is_surrogate_pair_tail(code) { + if (typeof code === "string") + code = code.charCodeAt(0); + return code >= 0xdc00 && code <= 0xdfff; +} + +function is_digit(code) { + return code >= 48 && code <= 57; +} + +function is_identifier(name) { + if (typeof name !== "string" || RESERVED_WORDS(name)) + return false; + + return true; +} + +function is_identifier_start(ch) { + var code = ch.charCodeAt(0); + return UNICODE.ID_Start.test(ch) || code == 36 || code == 95; +} + +function is_identifier_char(ch) { + var code = ch.charCodeAt(0); + return UNICODE.ID_Continue.test(ch) + || code == 36 + || code == 95 + || code == 8204 // \u200c: zero-width non-joiner + || code == 8205 // \u200d: zero-width joiner (in my ECMA-262 PDF, this is also 200c) + ; +} + +function is_identifier_string(str) { + return /^[a-z_$][a-z0-9_$]*$/i.test(str); +} + +function parse_js_number(num) { + if (RE_HEX_NUMBER.test(num)) { + return parseInt(num.substr(2), 16); + } else if (RE_OCT_NUMBER.test(num)) { + return parseInt(num.substr(1), 8); + } else if (RE_ES6_OCT_NUMBER.test(num)) { + return parseInt(num.substr(2), 8); + } else if (RE_BIN_NUMBER.test(num)) { + return parseInt(num.substr(2), 2); + } else if (RE_DEC_NUMBER.test(num)) { + return parseFloat(num); + } else { + var val = parseFloat(num); + if (val == num) return val; + } +} + +function JS_Parse_Error(message, filename, line, col, pos) { + this.message = message; + this.filename = filename; + this.line = line; + this.col = col; + this.pos = pos; +} +JS_Parse_Error.prototype = Object.create(Error.prototype); +JS_Parse_Error.prototype.constructor = JS_Parse_Error; +JS_Parse_Error.prototype.name = "SyntaxError"; +configure_error_stack(JS_Parse_Error); + +function js_error(message, filename, line, col, pos) { + throw new JS_Parse_Error(message, filename, line, col, pos); +} + +function is_token(token, type, val) { + return token.type == type && (val == null || token.value == val); +} + +var EX_EOF = {}; + +function tokenizer($TEXT, filename, html5_comments, shebang) { + + var S = { + text : $TEXT, + filename : filename, + pos : 0, + tokpos : 0, + line : 1, + tokline : 0, + col : 0, + tokcol : 0, + newline_before : false, + regex_allowed : false, + brace_counter : 0, + template_braces : [], + comments_before : [], + directives : {}, + directive_stack : [] + }; + + function peek() { return get_full_char(S.text, S.pos); } + + function next(signal_eof, in_string) { + var ch = get_full_char(S.text, S.pos++); + if (signal_eof && !ch) + throw EX_EOF; + if (NEWLINE_CHARS(ch)) { + S.newline_before = S.newline_before || !in_string; + ++S.line; + S.col = 0; + if (!in_string && ch == "\r" && peek() == "\n") { + // treat a \r\n sequence as a single \n + ++S.pos; + ch = "\n"; + } + } else { + if (ch.length > 1) { + ++S.pos; + ++S.col; + } + ++S.col; + } + return ch; + } + + function forward(i) { + while (i-- > 0) next(); + } + + function looking_at(str) { + return S.text.substr(S.pos, str.length) == str; + } + + function find_eol() { + var text = S.text; + for (var i = S.pos, n = S.text.length; i < n; ++i) { + var ch = text[i]; + if (NEWLINE_CHARS(ch)) + return i; + } + return -1; + } + + function find(what, signal_eof) { + var pos = S.text.indexOf(what, S.pos); + if (signal_eof && pos == -1) throw EX_EOF; + return pos; + } + + function start_token() { + S.tokline = S.line; + S.tokcol = S.col; + S.tokpos = S.pos; + } + + var prev_was_dot = false; + var previous_token = null; + function token(type, value, is_comment) { + S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX(value)) || + (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value)) || + (type == "punc" && PUNC_BEFORE_EXPRESSION(value))) || + (type == "arrow"); + if (type == "punc" && value == ".") { + prev_was_dot = true; + } else if (!is_comment) { + prev_was_dot = false; + } + var ret = { + type : type, + value : value, + line : S.tokline, + col : S.tokcol, + pos : S.tokpos, + endline : S.line, + endcol : S.col, + endpos : S.pos, + nlb : S.newline_before, + file : filename + }; + if (/^(?:num|string|regexp)$/i.test(type)) { + ret.raw = $TEXT.substring(ret.pos, ret.endpos); + } + if (!is_comment) { + ret.comments_before = S.comments_before; + ret.comments_after = S.comments_before = []; + } + S.newline_before = false; + ret = new AST_Token(ret); + if (!is_comment) previous_token = ret; + return ret; + } + + function skip_whitespace() { + while (WHITESPACE_CHARS(peek())) + next(); + } + + function read_while(pred) { + var ret = "", ch, i = 0; + while ((ch = peek()) && pred(ch, i++)) + ret += next(); + return ret; + } + + function parse_error(err) { + js_error(err, filename, S.tokline, S.tokcol, S.tokpos); + } + + function read_num(prefix) { + var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; + var num = read_while(function(ch, i) { + var code = ch.charCodeAt(0); + switch (code) { + case 98: case 66: // bB + return (has_x = true); // Can occur in hex sequence, don't return false yet + case 111: case 79: // oO + case 120: case 88: // xX + return has_x ? false : (has_x = true); + case 101: case 69: // eE + return has_x ? true : has_e ? false : (has_e = after_e = true); + case 45: // - + return after_e || (i == 0 && !prefix); + case 43: // + + return after_e; + case (after_e = false, 46): // . + return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false; + } + return RE_NUM_LITERAL.test(ch); + }); + if (prefix) num = prefix + num; + if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) { + parse_error("Legacy octal literals are not allowed in strict mode"); + } + var valid = parse_js_number(num); + if (!isNaN(valid)) { + return token("num", valid); + } else { + parse_error("Invalid syntax: " + num); + } + } + + function read_escaped_char(in_string, strict_hex, template_string) { + var ch = next(true, in_string); + switch (ch.charCodeAt(0)) { + case 110 : return "\n"; + case 114 : return "\r"; + case 116 : return "\t"; + case 98 : return "\b"; + case 118 : return "\u000b"; // \v + case 102 : return "\f"; + case 120 : return String.fromCharCode(hex_bytes(2, strict_hex)); // \x + case 117 : // \u + if (peek() == "{") { + next(true); + if (peek() === "}") + parse_error("Expecting hex-character between {}"); + while (peek() == "0") next(true); // No significance + var result, length = find("}", true) - S.pos; + // Avoid 32 bit integer overflow (1 << 32 === 1) + // We know first character isn't 0 and thus out of range anyway + if (length > 6 || (result = hex_bytes(length, strict_hex)) > 0x10FFFF) { + parse_error("Unicode reference out of bounds"); + } + next(true); + return from_char_code(result); + } + return String.fromCharCode(hex_bytes(4, strict_hex)); + case 10 : return ""; // newline + case 13 : // \r + if (peek() == "\n") { // DOS newline + next(true, in_string); + return ""; + } + } + if (ch >= "0" && ch <= "7") { + if (template_string && strict_hex) { + parse_error("Octal escape sequences are not allowed in template strings"); + } + return read_octal_escape_sequence(ch, strict_hex); + } + return ch; + } + + function read_octal_escape_sequence(ch, strict_octal) { + // Read + var p = peek(); + if (p >= "0" && p <= "7") { + ch += next(true); + if (ch[0] <= "3" && (p = peek()) >= "0" && p <= "7") + ch += next(true); + } + + // Parse + if (ch === "0") return "\0"; + if (ch.length > 0 && next_token.has_directive("use strict") && strict_octal) + parse_error("Legacy octal escape sequences are not allowed in strict mode"); + return String.fromCharCode(parseInt(ch, 8)); + } + + function hex_bytes(n, strict_hex) { + var num = 0; + for (; n > 0; --n) { + if (!strict_hex && isNaN(parseInt(peek(), 16))) { + return parseInt(num, 16) || ""; + } + var digit = next(true); + if (isNaN(parseInt(digit, 16))) + parse_error("Invalid hex-character pattern in string"); + num += digit; + } + return parseInt(num, 16); + } + + var read_string = with_eof_error("Unterminated string constant", function(quote_char) { + var quote = next(), ret = ""; + for (;;) { + var ch = next(true, true); + if (ch == "\\") ch = read_escaped_char(true, true); + else if (NEWLINE_CHARS(ch)) parse_error("Unterminated string constant"); + else if (ch == quote) break; + ret += ch; + } + var tok = token("string", ret); + tok.quote = quote_char; + return tok; + }); + + var read_template_characters = with_eof_error("Unterminated template", function(begin) { + if (begin) { + S.template_braces.push(S.brace_counter); + } + var content = "", raw = "", ch, tok; + next(true, true); + while ((ch = next(true, true)) != "`") { + if (ch == "\r") { + if (peek() == "\n") ++S.pos; + ch = "\n"; + } else if (ch == "$" && peek() == "{") { + next(true, true); + S.brace_counter++; + tok = token(begin ? "template_head" : "template_substitution", content); + tok.begin = begin; + tok.raw = raw; + tok.end = false; + return tok; + } + + raw += ch; + if (ch == "\\") { + var tmp = S.pos; + var prev_is_tag = previous_token.type === "name" || previous_token.type === "punc" && (previous_token.value === ")" || previous_token.value === "]"); + ch = read_escaped_char(true, !prev_is_tag, true); + raw += S.text.substr(tmp, S.pos - tmp); + } + + content += ch; + } + S.template_braces.pop(); + tok = token(begin ? "template_head" : "template_substitution", content); + tok.begin = begin; + tok.raw = raw; + tok.end = true; + return tok; + }); + + function skip_line_comment(type) { + var regex_allowed = S.regex_allowed; + var i = find_eol(), ret; + if (i == -1) { + ret = S.text.substr(S.pos); + S.pos = S.text.length; + } else { + ret = S.text.substring(S.pos, i); + S.pos = i; + } + S.col = S.tokcol + (S.pos - S.tokpos); + S.comments_before.push(token(type, ret, true)); + S.regex_allowed = regex_allowed; + return next_token; + } + + var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function() { + var regex_allowed = S.regex_allowed; + var i = find("*/", true); + var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, "\n"); + // update stream position + forward(get_full_char_length(text) /* text length doesn't count \r\n as 2 char while S.pos - i does */ + 2); + S.comments_before.push(token("comment2", text, true)); + S.newline_before = S.newline_before || text.indexOf("\n") >= 0; + S.regex_allowed = regex_allowed; + return next_token; + }); + + var read_name = with_eof_error("Unterminated identifier name", function() { + var name = "", ch, escaped = false, hex; + var read_escaped_identifier_char = function() { + escaped = true; + next(); + if (peek() !== "u") { + parse_error("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"); + } + return read_escaped_char(false, true); + }; + + // Read first character (ID_Start) + if ((name = peek()) === "\\") { + name = read_escaped_identifier_char(); + if (!is_identifier_start(name)) { + parse_error("First identifier char is an invalid identifier char"); + } + } else if (is_identifier_start(name)) { + next(); + } else { + return ""; + } + + // Read ID_Continue + while ((ch = peek()) != null) { + if ((ch = peek()) === "\\") { + ch = read_escaped_identifier_char(); + if (!is_identifier_char(ch)) { + parse_error("Invalid escaped identifier char"); + } + } else { + if (!is_identifier_char(ch)) { + break; + } + next(); + } + name += ch; + } + if (RESERVED_WORDS(name) && escaped) { + parse_error("Escaped characters are not allowed in keywords"); + } + return name; + }); + + var read_regexp = with_eof_error("Unterminated regular expression", function(source) { + var prev_backslash = false, ch, in_class = false; + while ((ch = next(true))) if (NEWLINE_CHARS(ch)) { + parse_error("Unexpected line terminator"); + } else if (prev_backslash) { + source += "\\" + ch; + prev_backslash = false; + } else if (ch == "[") { + in_class = true; + source += ch; + } else if (ch == "]" && in_class) { + in_class = false; + source += ch; + } else if (ch == "/" && !in_class) { + break; + } else if (ch == "\\") { + prev_backslash = true; + } else { + source += ch; + } + var mods = read_name(); + try { + var regexp = new RegExp(source, mods); + regexp.raw_source = "/" + source + "/" + mods; + return token("regexp", regexp); + } catch(e) { + parse_error(e.message); + } + }); + + function read_operator(prefix) { + function grow(op) { + if (!peek()) return op; + var bigger = op + peek(); + if (OPERATORS(bigger)) { + next(); + return grow(bigger); + } else { + return op; + } + } + return token("operator", grow(prefix || next())); + } + + function handle_slash() { + next(); + switch (peek()) { + case "/": + next(); + return skip_line_comment("comment1"); + case "*": + next(); + return skip_multiline_comment(); + } + return S.regex_allowed ? read_regexp("") : read_operator("/"); + } + + function handle_eq_sign() { + next(); + if (peek() === ">") { + next(); + return token("arrow", "=>"); + } else { + return read_operator("="); + } + } + + function handle_dot() { + next(); + if (is_digit(peek().charCodeAt(0))) { + return read_num("."); + } + if (peek() === ".") { + next(); // Consume second dot + next(); // Consume third dot + return token("expand", "..."); + } + + return token("punc", "."); + } + + function read_word() { + var word = read_name(); + if (prev_was_dot) return token("name", word); + return KEYWORDS_ATOM(word) ? token("atom", word) + : !KEYWORDS(word) ? token("name", word) + : OPERATORS(word) ? token("operator", word) + : token("keyword", word); + } + + function with_eof_error(eof_error, cont) { + return function(x) { + try { + return cont(x); + } catch(ex) { + if (ex === EX_EOF) parse_error(eof_error); + else throw ex; + } + }; + } + + function next_token(force_regexp) { + if (force_regexp != null) + return read_regexp(force_regexp); + if (shebang && S.pos == 0 && looking_at("#!")) { + start_token(); + forward(2); + skip_line_comment("comment5"); + } + for (;;) { + skip_whitespace(); + start_token(); + if (html5_comments) { + if (looking_at("") && S.newline_before) { + forward(3); + skip_line_comment("comment4"); + continue; + } + } + var ch = peek(); + if (!ch) return token("eof"); + var code = ch.charCodeAt(0); + switch (code) { + case 34: case 39: return read_string(ch); + case 46: return handle_dot(); + case 47: { + var tok = handle_slash(); + if (tok === next_token) continue; + return tok; + } + case 61: return handle_eq_sign(); + case 96: return read_template_characters(true); + case 123: + S.brace_counter++; + break; + case 125: + S.brace_counter--; + if (S.template_braces.length > 0 + && S.template_braces[S.template_braces.length - 1] === S.brace_counter) + return read_template_characters(false); + break; + } + if (is_digit(code)) return read_num(); + if (PUNC_CHARS(ch)) return token("punc", next()); + if (OPERATOR_CHARS(ch)) return read_operator(); + if (code == 92 || is_identifier_start(ch)) return read_word(); + break; + } + parse_error("Unexpected character '" + ch + "'"); + } + + next_token.next = next; + next_token.peek = peek; + + next_token.context = function(nc) { + if (nc) S = nc; + return S; + }; + + next_token.add_directive = function(directive) { + S.directive_stack[S.directive_stack.length - 1].push(directive); + + if (S.directives[directive] === undefined) { + S.directives[directive] = 1; + } else { + S.directives[directive]++; + } + }; + + next_token.push_directives_stack = function() { + S.directive_stack.push([]); + }; + + next_token.pop_directives_stack = function() { + var directives = S.directive_stack[S.directive_stack.length - 1]; + + for (var i = 0; i < directives.length; i++) { + S.directives[directives[i]]--; + } + + S.directive_stack.pop(); + }; + + next_token.has_directive = function(directive) { + return S.directives[directive] > 0; + }; + + return next_token; + +} + +/* -----[ Parser (constants) ]----- */ + +var UNARY_PREFIX = makePredicate([ + "typeof", + "void", + "delete", + "--", + "++", + "!", + "~", + "-", + "+" +]); + +var UNARY_POSTFIX = makePredicate([ "--", "++" ]); + +var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); + +var PRECEDENCE = (function(a, ret) { + for (var i = 0; i < a.length; ++i) { + var b = a[i]; + for (var j = 0; j < b.length; ++j) { + ret[b[j]] = i + 1; + } + } + return ret; +})( + [ + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "===", "!=", "!=="], + ["<", ">", "<=", ">=", "in", "instanceof"], + [">>", "<<", ">>>"], + ["+", "-"], + ["*", "/", "%"], + ["**"] + ], + {} +); + +var ATOMIC_START_TOKEN = makePredicate([ "atom", "num", "string", "regexp", "name" ]); + +/* -----[ Parser ]----- */ + +function parse($TEXT, options) { + + options = defaults(options, { + bare_returns : false, + ecma : 8, + expression : false, + filename : null, + html5_comments : true, + module : false, + shebang : true, + strict : false, + toplevel : null, + }, true); + + var S = { + input : (typeof $TEXT == "string" + ? tokenizer($TEXT, options.filename, + options.html5_comments, options.shebang) + : $TEXT), + token : null, + prev : null, + peeked : null, + in_function : 0, + in_async : -1, + in_generator : -1, + in_directives : true, + in_loop : 0, + labels : [] + }; + + S.token = next(); + + function is(type, value) { + return is_token(S.token, type, value); + } + + function peek() { return S.peeked || (S.peeked = S.input()); } + + function next() { + S.prev = S.token; + + if (!S.peeked) peek(); + S.token = S.peeked; + S.peeked = null; + S.in_directives = S.in_directives && ( + S.token.type == "string" || is("punc", ";") + ); + return S.token; + } + + function prev() { + return S.prev; + } + + function croak(msg, line, col, pos) { + var ctx = S.input.context(); + js_error(msg, + ctx.filename, + line != null ? line : ctx.tokline, + col != null ? col : ctx.tokcol, + pos != null ? pos : ctx.tokpos); + } + + function token_error(token, msg) { + croak(msg, token.line, token.col); + } + + function unexpected(token) { + if (token == null) + token = S.token; + token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); + } + + function expect_token(type, val) { + if (is(type, val)) { + return next(); + } + token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); + } + + function expect(punc) { return expect_token("punc", punc); } + + function has_newline_before(token) { + return token.nlb || !all(token.comments_before, function(comment) { + return !comment.nlb; + }); + } + + function can_insert_semicolon() { + return !options.strict + && (is("eof") || is("punc", "}") || has_newline_before(S.token)); + } + + function is_in_generator() { + return S.in_generator === S.in_function; + } + + function is_in_async() { + return S.in_async === S.in_function; + } + + function semicolon(optional) { + if (is("punc", ";")) next(); + else if (!optional && !can_insert_semicolon()) unexpected(); + } + + function parenthesised() { + expect("("); + var exp = expression(true); + expect(")"); + return exp; + } + + function embed_tokens(parser) { + return function() { + var start = S.token; + var expr = parser.apply(null, arguments); + var end = prev(); + expr.start = start; + expr.end = end; + return expr; + }; + } + + function handle_regexp() { + if (is("operator", "/") || is("operator", "/=")) { + S.peeked = null; + S.token = S.input(S.token.value.substr(1)); // force regexp + } + } + + var statement = embed_tokens(function(is_export_default, is_for_body, is_if_body) { + handle_regexp(); + switch (S.token.type) { + case "string": + if (S.in_directives) { + var token = peek(); + if (S.token.raw.indexOf("\\") == -1 + && (is_token(token, "punc", ";") + || is_token(token, "punc", "}") + || has_newline_before(token) + || is_token(token, "eof"))) { + S.input.add_directive(S.token.value); + } else { + S.in_directives = false; + } + } + var dir = S.in_directives, stat = simple_statement(); + return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat; + case "template_head": + case "num": + case "regexp": + case "operator": + case "atom": + return simple_statement(); + + case "name": + if (S.token.value == "async" && is_token(peek(), "keyword", "function")) { + next(); + next(); + if (is_for_body) { + croak("functions are not allowed as the body of a loop"); + } + return function_(AST_Defun, false, true, is_export_default); + } + if (S.token.value == "import" && !is_token(peek(), "punc", "(")) { + next(); + var node = import_(); + semicolon(); + return node; + } + return is_token(peek(), "punc", ":") + ? labeled_statement() + : simple_statement(); + + case "punc": + switch (S.token.value) { + case "{": + return new AST_BlockStatement({ + start : S.token, + body : block_(), + end : prev() + }); + case "[": + case "(": + return simple_statement(); + case ";": + S.in_directives = false; + next(); + return new AST_EmptyStatement(); + default: + unexpected(); + } + + case "keyword": + switch (S.token.value) { + case "break": + next(); + return break_cont(AST_Break); + + case "continue": + next(); + return break_cont(AST_Continue); + + case "debugger": + next(); + semicolon(); + return new AST_Debugger(); + + case "do": + next(); + var body = in_loop(statement); + expect_token("keyword", "while"); + var condition = parenthesised(); + semicolon(true); + return new AST_Do({ + body : body, + condition : condition + }); + + case "while": + next(); + return new AST_While({ + condition : parenthesised(), + body : in_loop(function() { return statement(false, true); }) + }); + + case "for": + next(); + return for_(); + + case "class": + next(); + if (is_for_body) { + croak("classes are not allowed as the body of a loop"); + } + if (is_if_body) { + croak("classes are not allowed as the body of an if"); + } + return class_(AST_DefClass); + + case "function": + next(); + if (is_for_body) { + croak("functions are not allowed as the body of a loop"); + } + return function_(AST_Defun, false, false, is_export_default); + + case "if": + next(); + return if_(); + + case "return": + if (S.in_function == 0 && !options.bare_returns) + croak("'return' outside of function"); + next(); + var value = null; + if (is("punc", ";")) { + next(); + } else if (!can_insert_semicolon()) { + value = expression(true); + semicolon(); + } + return new AST_Return({ + value: value + }); + + case "switch": + next(); + return new AST_Switch({ + expression : parenthesised(), + body : in_loop(switch_body_) + }); + + case "throw": + next(); + if (has_newline_before(S.token)) + croak("Illegal newline after 'throw'"); + var value = expression(true); + semicolon(); + return new AST_Throw({ + value: value + }); + + case "try": + next(); + return try_(); + + case "var": + next(); + var node = var_(); + semicolon(); + return node; + + case "let": + next(); + var node = let_(); + semicolon(); + return node; + + case "const": + next(); + var node = const_(); + semicolon(); + return node; + + case "with": + if (S.input.has_directive("use strict")) { + croak("Strict mode may not include a with statement"); + } + next(); + return new AST_With({ + expression : parenthesised(), + body : statement() + }); + + case "export": + if (!is_token(peek(), "punc", "(")) { + next(); + var node = export_(); + if (is("punc", ";")) semicolon(); + return node; + } + } + } + unexpected(); + }); + + function labeled_statement() { + var label = as_symbol(AST_Label); + if (label.name === "await" && is_in_async()) { + token_error(S.prev, "await cannot be used as label inside async function"); + } + if (find_if(function(l) { return l.name == label.name; }, S.labels)) { + // ECMA-262, 12.12: An ECMAScript program is considered + // syntactically incorrect if it contains a + // LabelledStatement that is enclosed by a + // LabelledStatement with the same Identifier as label. + croak("Label " + label.name + " defined twice"); + } + expect(":"); + S.labels.push(label); + var stat = statement(); + S.labels.pop(); + if (!(stat instanceof AST_IterationStatement)) { + // check for `continue` that refers to this label. + // those should be reported as syntax errors. + // https://github.com/mishoo/UglifyJS2/issues/287 + label.references.forEach(function(ref) { + if (ref instanceof AST_Continue) { + ref = ref.label.start; + croak("Continue label `" + label.name + "` refers to non-IterationStatement.", + ref.line, ref.col, ref.pos); + } + }); + } + return new AST_LabeledStatement({ body: stat, label: label }); + } + + function simple_statement(tmp) { + return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); + } + + function break_cont(type) { + var label = null, ldef; + if (!can_insert_semicolon()) { + label = as_symbol(AST_LabelRef, true); + } + if (label != null) { + ldef = find_if(function(l) { return l.name == label.name; }, S.labels); + if (!ldef) + croak("Undefined label " + label.name); + label.thedef = ldef; + } else if (S.in_loop == 0) + croak(type.TYPE + " not inside a loop or switch"); + semicolon(); + var stat = new type({ label: label }); + if (ldef) ldef.references.push(stat); + return stat; + } + + function for_() { + var for_await_error = "`for await` invalid in this context"; + var await_tok = S.token; + if (await_tok.type == "name" && await_tok.value == "await") { + if (!is_in_async()) { + token_error(await_tok, for_await_error); + } + next(); + } else { + await_tok = false; + } + expect("("); + var init = null; + if (!is("punc", ";")) { + init = + is("keyword", "var") ? (next(), var_(true)) : + is("keyword", "let") ? (next(), let_(true)) : + is("keyword", "const") ? (next(), const_(true)) : + expression(true, true); + var is_in = is("operator", "in"); + var is_of = is("name", "of"); + if (await_tok && !is_of) { + token_error(await_tok, for_await_error); + } + if (is_in || is_of) { + if (init instanceof AST_Definitions) { + if (init.definitions.length > 1) + token_error(init.start, "Only one variable declaration allowed in for..in loop"); + } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) { + token_error(init.start, "Invalid left-hand side in for..in loop"); + } + next(); + if (is_in) { + return for_in(init); + } else { + return for_of(init, !!await_tok); + } + } + } else if (await_tok) { + token_error(await_tok, for_await_error); + } + return regular_for(init); + } + + function regular_for(init) { + expect(";"); + var test = is("punc", ";") ? null : expression(true); + expect(";"); + var step = is("punc", ")") ? null : expression(true); + expect(")"); + return new AST_For({ + init : init, + condition : test, + step : step, + body : in_loop(function() { return statement(false, true); }) + }); + } + + function for_of(init, is_await) { + var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null; + var obj = expression(true); + expect(")"); + return new AST_ForOf({ + await : is_await, + init : init, + name : lhs, + object : obj, + body : in_loop(function() { return statement(false, true); }) + }); + } + + function for_in(init) { + var obj = expression(true); + expect(")"); + return new AST_ForIn({ + init : init, + object : obj, + body : in_loop(function() { return statement(false, true); }) + }); + } + + var arrow_function = function(start, argnames, is_async) { + if (has_newline_before(S.token)) { + croak("Unexpected newline before arrow (=>)"); + } + + expect_token("arrow", "=>"); + + var body = _function_body(is("punc", "{"), false, is_async); + + var end = + body instanceof Array && body.length ? body[body.length - 1].end : + body instanceof Array ? start : + body.end; + + return new AST_Arrow({ + start : start, + end : end, + async : is_async, + argnames : argnames, + body : body + }); + }; + + var function_ = function(ctor, is_generator_property, is_async, is_export_default) { + var start = S.token; + + var in_statement = ctor === AST_Defun; + var is_generator = is("operator", "*"); + if (is_generator) { + next(); + } + + var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null; + if (in_statement && !name) { + if (is_export_default) { + ctor = AST_Function; + } else { + unexpected(); + } + } + + if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration)) + unexpected(prev()); + + var args = []; + var body = _function_body(true, is_generator || is_generator_property, is_async, name, args); + return new ctor({ + start : args.start, + end : body.end, + is_generator: is_generator, + async : is_async, + name : name, + argnames: args, + body : body + }); + }; + + function track_used_binding_identifiers(is_parameter, strict) { + var parameters = {}; + var duplicate = false; + var default_assignment = false; + var spread = false; + var strict_mode = !!strict; + var tracker = { + add_parameter: function(token) { + if (parameters["$" + token.value] !== undefined) { + if (duplicate === false) { + duplicate = token; + } + tracker.check_strict(); + } else { + parameters["$" + token.value] = true; + if (is_parameter) { + switch (token.value) { + case "arguments": + case "eval": + case "yield": + if (strict_mode) { + token_error(token, "Unexpected " + token.value + " identifier as parameter inside strict mode"); + } + break; + default: + if (RESERVED_WORDS(token.value)) { + unexpected(); + } + } + } + } + }, + mark_default_assignment: function(token) { + if (default_assignment === false) { + default_assignment = token; + } + }, + mark_spread: function(token) { + if (spread === false) { + spread = token; + } + }, + mark_strict_mode: function() { + strict_mode = true; + }, + is_strict: function() { + return default_assignment !== false || spread !== false || strict_mode; + }, + check_strict: function() { + if (tracker.is_strict() && duplicate !== false) { + token_error(duplicate, "Parameter " + duplicate.value + " was used already"); + } + } + }; + + return tracker; + } + + function parameters(params) { + var start = S.token; + var used_parameters = track_used_binding_identifiers(true, S.input.has_directive("use strict")); + + expect("("); + + while (!is("punc", ")")) { + var param = parameter(used_parameters); + params.push(param); + + if (!is("punc", ")")) { + expect(","); + if (is("punc", ")") && options.ecma < 8) unexpected(); + } + + if (param instanceof AST_Expansion) { + break; + } + } + + next(); + } + + function parameter(used_parameters, symbol_type) { + var param; + var expand = false; + if (used_parameters === undefined) { + used_parameters = track_used_binding_identifiers(true, S.input.has_directive("use strict")); + } + if (is("expand", "...")) { + expand = S.token; + used_parameters.mark_spread(S.token); + next(); + } + param = binding_element(used_parameters, symbol_type); + + if (is("operator", "=") && expand === false) { + used_parameters.mark_default_assignment(S.token); + next(); + param = new AST_DefaultAssign({ + start: param.start, + left: param, + operator: "=", + right: expression(false), + end: S.token + }); + } + + if (expand !== false) { + if (!is("punc", ")")) { + unexpected(); + } + param = new AST_Expansion({ + start: expand, + expression: param, + end: expand + }); + } + used_parameters.check_strict(); + + return param; + } + + function binding_element(used_parameters, symbol_type) { + var elements = []; + var first = true; + var is_expand = false; + var expand_token; + var first_token = S.token; + if (used_parameters === undefined) { + used_parameters = track_used_binding_identifiers(false, S.input.has_directive("use strict")); + } + symbol_type = symbol_type === undefined ? AST_SymbolFunarg : symbol_type; + if (is("punc", "[")) { + next(); + while (!is("punc", "]")) { + if (first) { + first = false; + } else { + expect(","); + } + + if (is("expand", "...")) { + is_expand = true; + expand_token = S.token; + used_parameters.mark_spread(S.token); + next(); + } + if (is("punc")) { + switch (S.token.value) { + case ",": + elements.push(new AST_Hole({ + start: S.token, + end: S.token + })); + continue; + case "]": // Trailing comma after last element + break; + case "[": + case "{": + elements.push(binding_element(used_parameters, symbol_type)); + break; + default: + unexpected(); + } + } else if (is("name")) { + used_parameters.add_parameter(S.token); + elements.push(as_symbol(symbol_type)); + } else { + croak("Invalid function parameter"); + } + if (is("operator", "=") && is_expand === false) { + used_parameters.mark_default_assignment(S.token); + next(); + elements[elements.length - 1] = new AST_DefaultAssign({ + start: elements[elements.length - 1].start, + left: elements[elements.length - 1], + operator: "=", + right: expression(false), + end: S.token + }); + } + if (is_expand) { + if (!is("punc", "]")) { + croak("Rest element must be last element"); + } + elements[elements.length - 1] = new AST_Expansion({ + start: expand_token, + expression: elements[elements.length - 1], + end: expand_token + }); + } + } + expect("]"); + used_parameters.check_strict(); + return new AST_Destructuring({ + start: first_token, + names: elements, + is_array: true, + end: prev() + }); + } else if (is("punc", "{")) { + next(); + while (!is("punc", "}")) { + if (first) { + first = false; + } else { + expect(","); + } + if (is("expand", "...")) { + is_expand = true; + expand_token = S.token; + used_parameters.mark_spread(S.token); + next(); + } + if (is("name") && (is_token(peek(), "punc") || is_token(peek(), "operator")) && [",", "}", "="].indexOf(peek().value) !== -1) { + used_parameters.add_parameter(S.token); + var start = prev(); + var value = as_symbol(symbol_type); + if (is_expand) { + elements.push(new AST_Expansion({ + start: expand_token, + expression: value, + end: value.end, + })); + } else { + elements.push(new AST_ObjectKeyVal({ + start: start, + key: value.name, + value: value, + end: value.end, + })); + } + } else if (is("punc", "}")) { + continue; // Allow trailing hole + } else { + var property_token = S.token; + var property = as_property_name(); + if (property === null) { + unexpected(prev()); + } else if (prev().type === "name" && !is("punc", ":")) { + elements.push(new AST_ObjectKeyVal({ + start: prev(), + key: property, + value: new symbol_type({ + start: prev(), + name: property, + end: prev() + }), + end: prev() + })); + } else { + expect(":"); + elements.push(new AST_ObjectKeyVal({ + start: property_token, + quote: property_token.quote, + key: property, + value: binding_element(used_parameters, symbol_type), + end: prev() + })); + } + } + if (is_expand) { + if (!is("punc", "}")) { + croak("Rest element must be last element"); + } + } else if (is("operator", "=")) { + used_parameters.mark_default_assignment(S.token); + next(); + elements[elements.length - 1].value = new AST_DefaultAssign({ + start: elements[elements.length - 1].value.start, + left: elements[elements.length - 1].value, + operator: "=", + right: expression(false), + end: S.token + }); + } + } + expect("}"); + used_parameters.check_strict(); + return new AST_Destructuring({ + start: first_token, + names: elements, + is_array: false, + end: prev() + }); + } else if (is("name")) { + used_parameters.add_parameter(S.token); + return as_symbol(symbol_type); + } else { + croak("Invalid function parameter"); + } + } + + function params_or_seq_(allow_arrows, maybe_sequence) { + var spread_token; + var invalid_sequence; + var trailing_comma; + var a = []; + expect("("); + while (!is("punc", ")")) { + if (spread_token) unexpected(spread_token); + if (is("expand", "...")) { + spread_token = S.token; + if (maybe_sequence) invalid_sequence = S.token; + next(); + a.push(new AST_Expansion({ + start: prev(), + expression: expression(), + end: S.token, + })); + } else { + a.push(expression()); + } + if (!is("punc", ")")) { + expect(","); + if (is("punc", ")")) { + if (options.ecma < 8) unexpected(); + trailing_comma = prev(); + if (maybe_sequence) invalid_sequence = trailing_comma; + } + } + } + expect(")"); + if (allow_arrows && is("arrow", "=>")) { + if (spread_token && trailing_comma) unexpected(trailing_comma); + } else if (invalid_sequence) { + unexpected(invalid_sequence); + } + return a; + } + + function _function_body(block, generator, is_async, name, args) { + var loop = S.in_loop; + var labels = S.labels; + var current_generator = S.in_generator; + var current_async = S.in_async; + ++S.in_function; + if (generator) + S.in_generator = S.in_function; + if (is_async) + S.in_async = S.in_function; + if (args) parameters(args); + if (block) + S.in_directives = true; + S.in_loop = 0; + S.labels = []; + if (block) { + S.input.push_directives_stack(); + var a = block_(); + if (name) _verify_symbol(name); + if (args) args.forEach(_verify_symbol); + S.input.pop_directives_stack(); + } else { + var a = expression(false); + } + --S.in_function; + S.in_loop = loop; + S.labels = labels; + S.in_generator = current_generator; + S.in_async = current_async; + return a; + } + + function _await_expression() { + // Previous token must be "await" and not be interpreted as an identifier + if (!is_in_async()) { + croak("Unexpected await expression outside async function", + S.prev.line, S.prev.col, S.prev.pos); + } + // the await expression is parsed as a unary expression in Babel + return new AST_Await({ + start: prev(), + end: S.token, + expression : maybe_unary(true), + }); + } + + function _yield_expression() { + // Previous token must be keyword yield and not be interpret as an identifier + if (!is_in_generator()) { + croak("Unexpected yield expression outside generator function", + S.prev.line, S.prev.col, S.prev.pos); + } + var start = S.token; + var star = false; + var has_expression = true; + + // Attempt to get expression or star (and then the mandatory expression) + // behind yield on the same line. + // + // If nothing follows on the same line of the yieldExpression, + // it should default to the value `undefined` for yield to return. + // In that case, the `undefined` stored as `null` in ast. + // + // Note 1: It isn't allowed for yield* to close without an expression + // Note 2: If there is a nlb between yield and star, it is interpret as + // yield * + if (can_insert_semicolon() || + (is("punc") && PUNC_AFTER_EXPRESSION(S.token.value))) { + has_expression = false; + + } else if (is("operator", "*")) { + star = true; + next(); + } + + return new AST_Yield({ + start : start, + is_star : star, + expression : has_expression ? expression() : null, + end : prev() + }); + } + + function if_() { + var cond = parenthesised(), body = statement(false, false, true), belse = null; + if (is("keyword", "else")) { + next(); + belse = statement(false, false, true); + } + return new AST_If({ + condition : cond, + body : body, + alternative : belse + }); + } + + function block_() { + expect("{"); + var a = []; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + a.push(statement()); + } + next(); + return a; + } + + function switch_body_() { + expect("{"); + var a = [], cur = null, branch = null, tmp; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + if (is("keyword", "case")) { + if (branch) branch.end = prev(); + cur = []; + branch = new AST_Case({ + start : (tmp = S.token, next(), tmp), + expression : expression(true), + body : cur + }); + a.push(branch); + expect(":"); + } else if (is("keyword", "default")) { + if (branch) branch.end = prev(); + cur = []; + branch = new AST_Default({ + start : (tmp = S.token, next(), expect(":"), tmp), + body : cur + }); + a.push(branch); + } else { + if (!cur) unexpected(); + cur.push(statement()); + } + } + if (branch) branch.end = prev(); + next(); + return a; + } + + function try_() { + var body = block_(), bcatch = null, bfinally = null; + if (is("keyword", "catch")) { + var start = S.token; + next(); + if (is("punc", "{")) { + var name = null; + } else { + expect("("); + var name = parameter(undefined, AST_SymbolCatch); + expect(")"); + } + bcatch = new AST_Catch({ + start : start, + argname : name, + body : block_(), + end : prev() + }); + } + if (is("keyword", "finally")) { + var start = S.token; + next(); + bfinally = new AST_Finally({ + start : start, + body : block_(), + end : prev() + }); + } + if (!bcatch && !bfinally) + croak("Missing catch/finally blocks"); + return new AST_Try({ + body : body, + bcatch : bcatch, + bfinally : bfinally + }); + } + + function vardefs(no_in, kind) { + var a = []; + var def; + for (;;) { + var sym_type = + kind === "var" ? AST_SymbolVar : + kind === "const" ? AST_SymbolConst : + kind === "let" ? AST_SymbolLet : null; + if (is("punc", "{") || is("punc", "[")) { + def = new AST_VarDef({ + start: S.token, + name: binding_element(undefined ,sym_type), + value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null, + end: prev() + }); + } else { + def = new AST_VarDef({ + start : S.token, + name : as_symbol(sym_type), + value : is("operator", "=") + ? (next(), expression(false, no_in)) + : !no_in && kind === "const" + ? croak("Missing initializer in const declaration") : null, + end : prev() + }); + if (def.name.name == "import") croak("Unexpected token: import"); + } + a.push(def); + if (!is("punc", ",")) + break; + next(); + } + return a; + } + + var var_ = function(no_in) { + return new AST_Var({ + start : prev(), + definitions : vardefs(no_in, "var"), + end : prev() + }); + }; + + var let_ = function(no_in) { + return new AST_Let({ + start : prev(), + definitions : vardefs(no_in, "let"), + end : prev() + }); + }; + + var const_ = function(no_in) { + return new AST_Const({ + start : prev(), + definitions : vardefs(no_in, "const"), + end : prev() + }); + }; + + var new_ = function(allow_calls) { + var start = S.token; + expect_token("operator", "new"); + if (is("punc", ".")) { + next(); + expect_token("name", "target"); + return subscripts(new AST_NewTarget({ + start : start, + end : prev() + }), allow_calls); + } + var newexp = expr_atom(false), args; + if (is("punc", "(")) { + next(); + args = expr_list(")", options.ecma >= 8); + } else { + args = []; + } + var call = new AST_New({ + start : start, + expression : newexp, + args : args, + end : prev() + }); + mark_pure(call); + return subscripts(call, allow_calls); + }; + + function as_atom_node() { + var tok = S.token, ret; + switch (tok.type) { + case "name": + ret = _make_symbol(AST_SymbolRef); + break; + case "num": + ret = new AST_Number({ start: tok, end: tok, value: tok.value }); + break; + case "string": + ret = new AST_String({ + start : tok, + end : tok, + value : tok.value, + quote : tok.quote + }); + break; + case "regexp": + ret = new AST_RegExp({ start: tok, end: tok, value: tok.value }); + break; + case "atom": + switch (tok.value) { + case "false": + ret = new AST_False({ start: tok, end: tok }); + break; + case "true": + ret = new AST_True({ start: tok, end: tok }); + break; + case "null": + ret = new AST_Null({ start: tok, end: tok }); + break; + } + break; + } + next(); + return ret; + } + + function to_fun_args(ex, _, __, default_seen_above) { + var insert_default = function(ex, default_value) { + if (default_value) { + return new AST_DefaultAssign({ + start: ex.start, + left: ex, + operator: "=", + right: default_value, + end: default_value.end + }); + } + return ex; + }; + if (ex instanceof AST_Object) { + return insert_default(new AST_Destructuring({ + start: ex.start, + end: ex.end, + is_array: false, + names: ex.properties.map(to_fun_args) + }), default_seen_above); + } else if (ex instanceof AST_ObjectKeyVal) { + ex.value = to_fun_args(ex.value, 0, [ex.key]); + return insert_default(ex, default_seen_above); + } else if (ex instanceof AST_Hole) { + return ex; + } else if (ex instanceof AST_Destructuring) { + ex.names = ex.names.map(to_fun_args); + return insert_default(ex, default_seen_above); + } else if (ex instanceof AST_SymbolRef) { + return insert_default(new AST_SymbolFunarg({ + name: ex.name, + start: ex.start, + end: ex.end + }), default_seen_above); + } else if (ex instanceof AST_Expansion) { + ex.expression = to_fun_args(ex.expression); + return insert_default(ex, default_seen_above); + } else if (ex instanceof AST_Array) { + return insert_default(new AST_Destructuring({ + start: ex.start, + end: ex.end, + is_array: true, + names: ex.elements.map(to_fun_args) + }), default_seen_above); + } else if (ex instanceof AST_Assign) { + return insert_default(to_fun_args(ex.left, undefined, undefined, ex.right), default_seen_above); + } else if (ex instanceof AST_DefaultAssign) { + ex.left = to_fun_args(ex.left, 0, [ex.left]); + return ex; + } else { + croak("Invalid function parameter", ex.start.line, ex.start.col); + } + } + + var expr_atom = function(allow_calls, allow_arrows) { + if (is("operator", "new")) { + return new_(allow_calls); + } + var start = S.token; + var peeked; + var async = is("name", "async") + && (peeked = peek()).value != "[" + && peeked.type != "arrow" + && as_atom_node(); + if (is("punc")) { + switch (S.token.value) { + case "(": + if (async && !allow_calls) break; + var exprs = params_or_seq_(allow_arrows, !async); + if (allow_arrows && is("arrow", "=>")) { + return arrow_function(start, exprs.map(to_fun_args), !!async); + } + var ex = async ? new AST_Call({ + expression: async, + args: exprs + }) : exprs.length == 1 ? exprs[0] : new AST_Sequence({ + expressions: exprs + }); + if (ex.start) { + var len = start.comments_before.length; + [].unshift.apply(ex.start.comments_before, start.comments_before); + start.comments_before = ex.start.comments_before; + start.comments_before_length = len; + if (len == 0 && start.comments_before.length > 0) { + var comment = start.comments_before[0]; + if (!comment.nlb) { + comment.nlb = start.nlb; + start.nlb = false; + } + } + start.comments_after = ex.start.comments_after; + } + ex.start = start; + var end = prev(); + if (ex.end) { + end.comments_before = ex.end.comments_before; + [].push.apply(ex.end.comments_after, end.comments_after); + end.comments_after = ex.end.comments_after; + } + ex.end = end; + if (ex instanceof AST_Call) mark_pure(ex); + return subscripts(ex, allow_calls); + case "[": + return subscripts(array_(), allow_calls); + case "{": + return subscripts(object_or_destructuring_(), allow_calls); + } + if (!async) unexpected(); + } + if (allow_arrows && is("name") && is_token(peek(), "arrow")) { + var param = new AST_SymbolFunarg({ + name: S.token.value, + start: start, + end: start, + }); + next(); + return arrow_function(start, [param], !!async); + } + if (is("keyword", "function")) { + next(); + var func = function_(AST_Function, false, !!async); + func.start = start; + func.end = prev(); + return subscripts(func, allow_calls); + } + if (async) return subscripts(async, allow_calls); + if (is("keyword", "class")) { + next(); + var cls = class_(AST_ClassExpression); + cls.start = start; + cls.end = prev(); + return subscripts(cls, allow_calls); + } + if (is("template_head")) { + return subscripts(template_string(false), allow_calls); + } + if (ATOMIC_START_TOKEN(S.token.type)) { + return subscripts(as_atom_node(), allow_calls); + } + unexpected(); + }; + + function template_string(tagged) { + var segments = [], start = S.token; + + segments.push(new AST_TemplateSegment({ + start: S.token, + raw: S.token.raw, + value: S.token.value, + end: S.token + })); + while (S.token.end === false) { + next(); + handle_regexp(); + segments.push(expression(true)); + + if (!is_token("template_substitution")) { + unexpected(); + } + + segments.push(new AST_TemplateSegment({ + start: S.token, + raw: S.token.raw, + value: S.token.value, + end: S.token + })); + } + next(); + + return new AST_TemplateString({ + start: start, + segments: segments, + end: S.token + }); + } + + function expr_list(closing, allow_trailing_comma, allow_empty) { + var first = true, a = []; + while (!is("punc", closing)) { + if (first) first = false; else expect(","); + if (allow_trailing_comma && is("punc", closing)) break; + if (is("punc", ",") && allow_empty) { + a.push(new AST_Hole({ start: S.token, end: S.token })); + } else if (is("expand", "...")) { + next(); + a.push(new AST_Expansion({start: prev(), expression: expression(),end: S.token})); + } else { + a.push(expression(false)); + } + } + next(); + return a; + } + + var array_ = embed_tokens(function() { + expect("["); + return new AST_Array({ + elements: expr_list("]", !options.strict, true) + }); + }); + + var create_accessor = embed_tokens(function(is_generator, is_async) { + return function_(AST_Accessor, is_generator, is_async); + }); + + var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() { + var start = S.token, first = true, a = []; + expect("{"); + while (!is("punc", "}")) { + if (first) first = false; else expect(","); + if (!options.strict && is("punc", "}")) + // allow trailing comma + break; + + start = S.token; + if (start.type == "expand") { + next(); + a.push(new AST_Expansion({ + start: start, + expression: expression(false), + end: prev(), + })); + continue; + } + + var name = as_property_name(); + var value; + + // Check property and fetch value + if (!is("punc", ":")) { + var concise = concise_method_or_getset(name, start); + if (concise) { + a.push(concise); + continue; + } + + value = new AST_SymbolRef({ + start: prev(), + name: name, + end: prev() + }); + } else if (name === null) { + unexpected(prev()); + } else { + next(); // `:` - see first condition + value = expression(false); + } + + // Check for default value and alter value accordingly if necessary + if (is("operator", "=")) { + next(); + value = new AST_Assign({ + start: start, + left: value, + operator: "=", + right: expression(false), + end: prev() + }); + } + + // Create property + a.push(new AST_ObjectKeyVal({ + start: start, + quote: start.quote, + key: name instanceof AST_Node ? name : "" + name, + value: value, + end: prev() + })); + } + next(); + return new AST_Object({ properties: a }); + }); + + function class_(KindOfClass) { + var start, method, class_name, extends_, a = []; + + S.input.push_directives_stack(); // Push directive stack, but not scope stack + S.input.add_directive("use strict"); + + if (S.token.type == "name" && S.token.value != "extends") { + class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass); + } + + if (KindOfClass === AST_DefClass && !class_name) { + unexpected(); + } + + if (S.token.value == "extends") { + next(); + extends_ = expression(true); + } + + expect("{"); + + if (is("punc", ";")) { next(); } // Leading semicolons are okay in class bodies. + while (!is("punc", "}")) { + start = S.token; + method = concise_method_or_getset(as_property_name(), start, true); + if (!method) { unexpected(); } + a.push(method); + if (is("punc", ";")) { next(); } + } + + S.input.pop_directives_stack(); + + next(); + + return new KindOfClass({ + start: start, + name: class_name, + extends: extends_, + properties: a, + end: prev(), + }); + } + + function concise_method_or_getset(name, start, is_class) { + var get_ast = function(name, token) { + if (typeof name === "string" || typeof name === "number") { + return new AST_SymbolMethod({ + start: token, + name: "" + name, + end: prev() + }); + } else if (name === null) { + unexpected(); + } + return name; + }; + var is_async = false; + var is_static = false; + var is_generator = false; + var property_token = start; + if (is_class && name === "static" && !is("punc", "(")) { + is_static = true; + property_token = S.token; + name = as_property_name(); + } + if (name === "async" && !is("punc", "(") && !is("punc", ",") && !is("punc", "}")) { + is_async = true; + property_token = S.token; + name = as_property_name(); + } + if (name === null) { + is_generator = true; + property_token = S.token; + name = as_property_name(); + if (name === null) { + unexpected(); + } + } + if (is("punc", "(")) { + name = get_ast(name, start); + var node = new AST_ConciseMethod({ + start : start, + static : is_static, + is_generator: is_generator, + async : is_async, + key : name, + quote : name instanceof AST_SymbolMethod ? + property_token.quote : undefined, + value : create_accessor(is_generator, is_async), + end : prev() + }); + return node; + } + property_token = S.token; + if (name == "get") { + if (!is("punc") || is("punc", "[")) { + name = get_ast(as_property_name(), start); + return new AST_ObjectGetter({ + start : start, + static: is_static, + key : name, + quote : name instanceof AST_SymbolMethod ? + property_token.quote : undefined, + value : create_accessor(), + end : prev() + }); + } + } else if (name == "set") { + if (!is("punc") || is("punc", "[")) { + name = get_ast(as_property_name(), start); + return new AST_ObjectSetter({ + start : start, + static: is_static, + key : name, + quote : name instanceof AST_SymbolMethod ? + property_token.quote : undefined, + value : create_accessor(), + end : prev() + }); + } + } + } + + function import_() { + var start = prev(); + var imported_name; + var imported_names; + if (is("name")) { + imported_name = as_symbol(AST_SymbolImport); + } + + if (is("punc", ",")) { + next(); + } + + imported_names = map_names(true); + + if (imported_names || imported_name) { + expect_token("name", "from"); + } + var mod_str = S.token; + if (mod_str.type !== "string") { + unexpected(); + } + next(); + return new AST_Import({ + start: start, + imported_name: imported_name, + imported_names: imported_names, + module_name: new AST_String({ + start: mod_str, + value: mod_str.value, + quote: mod_str.quote, + end: mod_str, + }), + end: S.token, + }); + } + + function map_name(is_import) { + function make_symbol(type) { + return new type({ + name: as_property_name(), + start: prev(), + end: prev() + }); + } + + var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; + var type = is_import ? AST_SymbolImport : AST_SymbolExport; + var start = S.token; + var foreign_name; + var name; + + if (is_import) { + foreign_name = make_symbol(foreign_type); + } else { + name = make_symbol(type); + } + if (is("name", "as")) { + next(); // The "as" word + if (is_import) { + name = make_symbol(type); + } else { + foreign_name = make_symbol(foreign_type); + } + } else if (is_import) { + name = new type(foreign_name); + } else { + foreign_name = new foreign_type(name); + } + + return new AST_NameMapping({ + start: start, + foreign_name: foreign_name, + name: name, + end: prev(), + }); + } + + function map_nameAsterisk(is_import, name) { + var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; + var type = is_import ? AST_SymbolImport : AST_SymbolExport; + var start = S.token; + var foreign_name; + var end = prev(); + + name = name || new type({ + name: "*", + start: start, + end: end, + }); + + foreign_name = new foreign_type({ + name: "*", + start: start, + end: end, + }); + + return new AST_NameMapping({ + start: start, + foreign_name: foreign_name, + name: name, + end: end, + }); + } + + function map_names(is_import) { + var names; + if (is("punc", "{")) { + next(); + names = []; + while (!is("punc", "}")) { + names.push(map_name(is_import)); + if (is("punc", ",")) { + next(); + } + } + next(); + } else if (is("operator", "*")) { + var name; + next(); + if (is_import && is("name", "as")) { + next(); // The "as" word + name = as_symbol(is_import ? AST_SymbolImport : AST_SymbolExportForeign); + } + names = [map_nameAsterisk(is_import, name)]; + } + return names; + } + + function export_() { + var start = S.token; + var is_default; + var exported_names; + + if (is("keyword", "default")) { + is_default = true; + next(); + } else if (exported_names = map_names(false)) { + if (is("name", "from")) { + next(); + + var mod_str = S.token; + if (mod_str.type !== "string") { + unexpected(); + } + next(); + + return new AST_Export({ + start: start, + is_default: is_default, + exported_names: exported_names, + module_name: new AST_String({ + start: mod_str, + value: mod_str.value, + quote: mod_str.quote, + end: mod_str, + }), + end: prev(), + }); + } else { + return new AST_Export({ + start: start, + is_default: is_default, + exported_names: exported_names, + end: prev(), + }); + } + } + + var node; + var exported_value; + var exported_definition; + if (is("punc", "{") + || is_default + && (is("keyword", "class") || is("keyword", "function")) + && is_token(peek(), "punc")) { + exported_value = expression(false); + semicolon(); + } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) { + unexpected(node.start); + } else if (node instanceof AST_Definitions || node instanceof AST_Lambda || node instanceof AST_DefClass) { + exported_definition = node; + } else if (node instanceof AST_SimpleStatement) { + exported_value = node.body; + } else { + unexpected(node.start); + } + + return new AST_Export({ + start: start, + is_default: is_default, + exported_value: exported_value, + exported_definition: exported_definition, + end: prev(), + }); + } + + function as_property_name() { + var tmp = S.token; + switch (tmp.type) { + case "punc": + if (tmp.value === "[") { + next(); + var ex = expression(false); + expect("]"); + return ex; + } else unexpected(tmp); + case "operator": + if (tmp.value === "*") { + next(); + return null; + } + if (["delete", "in", "instanceof", "new", "typeof", "void"].indexOf(tmp.value) === -1) { + unexpected(tmp); + } + case "name": + if (tmp.value == "yield") { + if (is_in_generator()) { + token_error(tmp, "Yield cannot be used as identifier inside generators"); + } else if (!is_token(peek(), "punc", ":") + && !is_token(peek(), "punc", "(") + && S.input.has_directive("use strict")) { + token_error(tmp, "Unexpected yield identifier inside strict mode"); + } + } + case "string": + case "num": + case "keyword": + case "atom": + next(); + return tmp.value; + default: + unexpected(tmp); + } + } + + function as_name() { + var tmp = S.token; + if (tmp.type != "name") unexpected(); + next(); + return tmp.value; + } + + function _make_symbol(type) { + var name = S.token.value; + return new (name == "this" ? AST_This : + name == "super" ? AST_Super : + type)({ + name : String(name), + start : S.token, + end : S.token + }); + } + + function _verify_symbol(sym) { + var name = sym.name; + if (is_in_generator() && name == "yield") { + token_error(sym.start, "Yield cannot be used as identifier inside generators"); + } + if (S.input.has_directive("use strict")) { + if (name == "yield") { + token_error(sym.start, "Unexpected yield identifier inside strict mode"); + } + if (sym instanceof AST_SymbolDeclaration && (name == "arguments" || name == "eval")) { + token_error(sym.start, "Unexpected " + name + " in strict mode"); + } + } + } + + function as_symbol(type, noerror) { + if (!is("name")) { + if (!noerror) croak("Name expected"); + return null; + } + var sym = _make_symbol(type); + _verify_symbol(sym); + next(); + return sym; + } + + function mark_pure(call) { + var start = call.start; + var comments = start.comments_before; + var i = HOP(start, "comments_before_length") ? start.comments_before_length : comments.length; + while (--i >= 0) { + var comment = comments[i]; + if (/[@#]__PURE__/.test(comment.value)) { + call.pure = comment; + break; + } + } + } + + var subscripts = function(expr, allow_calls) { + var start = expr.start; + if (is("punc", ".")) { + next(); + return subscripts(new AST_Dot({ + start : start, + expression : expr, + property : as_name(), + end : prev() + }), allow_calls); + } + if (is("punc", "[")) { + next(); + var prop = expression(true); + expect("]"); + return subscripts(new AST_Sub({ + start : start, + expression : expr, + property : prop, + end : prev() + }), allow_calls); + } + if (allow_calls && is("punc", "(")) { + next(); + var call = new AST_Call({ + start : start, + expression : expr, + args : call_args(), + end : prev() + }); + mark_pure(call); + return subscripts(call, true); + } + if (is("template_head")) { + return subscripts(new AST_PrefixedTemplateString({ + start: start, + prefix: expr, + template_string: template_string(true), + end: prev() + }), allow_calls); + } + return expr; + }; + + var call_args = embed_tokens(function _call_args() { + var args = []; + while (!is("punc", ")")) { + if (is("expand", "...")) { + next(); + args.push(new AST_Expansion({ + start: prev(), + expression: expression(false), + end: prev() + })); + } else { + args.push(expression(false)); + } + if (!is("punc", ")")) { + expect(","); + if (is("punc", ")") && options.ecma < 8) unexpected(); + } + } + next(); + return args; + }); + + var maybe_unary = function(allow_calls, allow_arrows) { + var start = S.token; + if (start.type == "name" && start.value == "await") { + if (is_in_async()) { + next(); + return _await_expression(); + } else if (S.input.has_directive("use strict")) { + token_error(S.token, "Unexpected await identifier inside strict mode"); + } + } + if (is("operator") && UNARY_PREFIX(start.value)) { + next(); + handle_regexp(); + var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls)); + ex.start = start; + ex.end = prev(); + return ex; + } + var val = expr_atom(allow_calls, allow_arrows); + while (is("operator") && UNARY_POSTFIX(S.token.value) && !has_newline_before(S.token)) { + if (val instanceof AST_Arrow) unexpected(); + val = make_unary(AST_UnaryPostfix, S.token, val); + val.start = start; + val.end = S.token; + next(); + } + return val; + }; + + function make_unary(ctor, token, expr) { + var op = token.value; + switch (op) { + case "++": + case "--": + if (!is_assignable(expr)) + croak("Invalid use of " + op + " operator", token.line, token.col, token.pos); + break; + case "delete": + if (expr instanceof AST_SymbolRef && S.input.has_directive("use strict")) + croak("Calling delete on expression not allowed in strict mode", expr.start.line, expr.start.col, expr.start.pos); + break; + } + return new ctor({ operator: op, expression: expr }); + } + + var expr_op = function(left, min_prec, no_in) { + var op = is("operator") ? S.token.value : null; + if (op == "in" && no_in) op = null; + if (op == "**" && left instanceof AST_UnaryPrefix + /* unary token in front not allowed - parenthesis required */ + && !is_token(left.start, "punc", "(") + && left.operator !== "--" && left.operator !== "++") + unexpected(left.start); + var prec = op != null ? PRECEDENCE[op] : null; + if (prec != null && (prec > min_prec || (op === "**" && min_prec === prec))) { + next(); + var right = expr_op(maybe_unary(true), prec, no_in); + return expr_op(new AST_Binary({ + start : left.start, + left : left, + operator : op, + right : right, + end : right.end + }), min_prec, no_in); + } + return left; + }; + + function expr_ops(no_in) { + return expr_op(maybe_unary(true, true), 0, no_in); + } + + var maybe_conditional = function(no_in) { + var start = S.token; + var expr = expr_ops(no_in); + if (is("operator", "?")) { + next(); + var yes = expression(false); + expect(":"); + return new AST_Conditional({ + start : start, + condition : expr, + consequent : yes, + alternative : expression(false, no_in), + end : prev() + }); + } + return expr; + }; + + function is_assignable(expr) { + return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef; + } + + function to_destructuring(node) { + if (node instanceof AST_Object) { + node = new AST_Destructuring({ + start: node.start, + names: node.properties.map(to_destructuring), + is_array: false, + end: node.end + }); + } else if (node instanceof AST_Array) { + var names = []; + + for (var i = 0; i < node.elements.length; i++) { + // Only allow expansion as last element + if (node.elements[i] instanceof AST_Expansion) { + if (i + 1 !== node.elements.length) { + token_error(node.elements[i].start, "Spread must the be last element in destructuring array"); + } + node.elements[i].expression = to_destructuring(node.elements[i].expression); + } + + names.push(to_destructuring(node.elements[i])); + } + + node = new AST_Destructuring({ + start: node.start, + names: names, + is_array: true, + end: node.end + }); + } else if (node instanceof AST_ObjectProperty) { + node.value = to_destructuring(node.value); + } else if (node instanceof AST_Assign) { + node = new AST_DefaultAssign({ + start: node.start, + left: node.left, + operator: "=", + right: node.right, + end: node.end + }); + } + return node; + } + + // In ES6, AssignmentExpression can also be an ArrowFunction + var maybe_assign = function(no_in) { + handle_regexp(); + var start = S.token; + + if (start.type == "name" && start.value == "yield") { + if (is_in_generator()) { + next(); + return _yield_expression(); + } else if (S.input.has_directive("use strict")) { + token_error(S.token, "Unexpected yield identifier inside strict mode"); + } + } + + var left = maybe_conditional(no_in); + var val = S.token.value; + + if (is("operator") && ASSIGNMENT(val)) { + if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { + next(); + return new AST_Assign({ + start : start, + left : left, + operator : val, + right : maybe_assign(no_in), + end : prev() + }); + } + croak("Invalid assignment"); + } + return left; + }; + + var expression = function(commas, no_in) { + var start = S.token; + var exprs = []; + while (true) { + exprs.push(maybe_assign(no_in)); + if (!commas || !is("punc", ",")) break; + next(); + commas = true; + } + return exprs.length == 1 ? exprs[0] : new AST_Sequence({ + start : start, + expressions : exprs, + end : peek() + }); + }; + + function in_loop(cont) { + ++S.in_loop; + var ret = cont(); + --S.in_loop; + return ret; + } + + if (options.expression) { + return expression(true); + } + + return (function() { + var start = S.token; + var body = []; + S.input.push_directives_stack(); + if (options.module) S.input.add_directive("use strict"); + while (!is("eof")) + body.push(statement()); + S.input.pop_directives_stack(); + var end = prev(); + var toplevel = options.toplevel; + if (toplevel) { + toplevel.body = toplevel.body.concat(body); + toplevel.end = end; + } else { + toplevel = new AST_Toplevel({ start: start, body: body, end: end }); + } + return toplevel; + })(); + +} +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +function SymbolDef(scope, orig, init) { + this.name = orig.name; + this.orig = [ orig ]; + this.init = init; + this.eliminated = 0; + this.scope = scope; + this.references = []; + this.replaced = 0; + this.global = false; + this.export = false; + this.mangled_name = null; + this.undeclared = false; + this.id = SymbolDef.next_id++; +} + +SymbolDef.next_id = 1; + +var MASK_EXPORT_DONT_MANGLE = 1 << 0; +var MASK_EXPORT_WANT_MANGLE = 1 << 1; + +SymbolDef.prototype = { + unmangleable: function(options) { + if (!options) options = {}; + + return this.global && !options.toplevel + || (this.export & MASK_EXPORT_DONT_MANGLE) + || this.undeclared + || !options.eval && this.scope.pinned() + || (this.orig[0] instanceof AST_SymbolLambda + || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name) + || this.orig[0] instanceof AST_SymbolMethod + || (this.orig[0] instanceof AST_SymbolClass + || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name); + }, + mangle: function(options) { + var cache = options.cache && options.cache.props; + if (this.global && cache && cache.has(this.name)) { + this.mangled_name = cache.get(this.name); + } else if (!this.mangled_name && !this.unmangleable(options)) { + var s = this.scope; + var sym = this.orig[0]; + if (options.ie8 && sym instanceof AST_SymbolLambda) + s = s.parent_scope; + var def; + if (def = this.redefined()) { + this.mangled_name = def.mangled_name || def.name; + } else + this.mangled_name = s.next_mangled(options, this); + if (this.global && cache) { + cache.set(this.name, this.mangled_name); + } + } + }, + redefined: function() { + return this.defun && this.defun.variables.get(this.name); + } +}; + +AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) { + options = defaults(options, { + cache: null, + ie8: false, + safari10: false, + }); + + // pass 1: setup scope chaining and handle definitions + var self = this; + var scope = self.parent_scope = null; + var labels = new Dictionary(); + var defun = null; + var in_destructuring = null; + var for_scopes = []; + var tw = new TreeWalker(function(node, descend) { + if (node.is_block_scope()) { + var save_scope = scope; + node.block_scope = scope = new AST_Scope(node); + scope.init_scope_vars(save_scope); + if (!(node instanceof AST_Scope)) { + scope.uses_with = save_scope.uses_with; + scope.uses_eval = save_scope.uses_eval; + scope.directives = save_scope.directives; + } + if (options.safari10) { + if (node instanceof AST_For || node instanceof AST_ForIn) { + for_scopes.push(scope); + } + } + descend(); + scope = save_scope; + return true; + } + if (node instanceof AST_Destructuring) { + in_destructuring = node; // These don't nest + descend(); + in_destructuring = null; + return true; + } + if (node instanceof AST_Scope) { + node.init_scope_vars(scope); + var save_scope = scope; + var save_defun = defun; + var save_labels = labels; + defun = scope = node; + labels = new Dictionary(); + descend(); + scope = save_scope; + defun = save_defun; + labels = save_labels; + return true; // don't descend again in TreeWalker + } + if (node instanceof AST_LabeledStatement) { + var l = node.label; + if (labels.has(l.name)) { + throw new Error(string_template("Label {name} defined twice", l)); + } + labels.set(l.name, l); + descend(); + labels.del(l.name); + return true; // no descend again + } + if (node instanceof AST_With) { + for (var s = scope; s; s = s.parent_scope) + s.uses_with = true; + return; + } + if (node instanceof AST_Symbol) { + node.scope = scope; + } + if (node instanceof AST_Label) { + node.thedef = node; + node.references = []; + } + if (node instanceof AST_SymbolLambda) { + defun.def_function(node, node.name == "arguments" ? undefined : defun); + } else if (node instanceof AST_SymbolDefun) { + // Careful here, the scope where this should be defined is + // the parent scope. The reason is that we enter a new + // scope when we encounter the AST_Defun node (which is + // instanceof AST_Scope) but we get to the symbol a bit + // later. + mark_export((node.scope = defun.parent_scope.get_defun_scope()).def_function(node, defun), 1); + } else if (node instanceof AST_SymbolClass) { + mark_export(defun.def_variable(node, defun), 1); + } else if (node instanceof AST_SymbolImport) { + scope.def_variable(node); + } else if (node instanceof AST_SymbolDefClass) { + // This deals with the name of the class being available + // inside the class. + mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1); + } else if (node instanceof AST_SymbolVar + || node instanceof AST_SymbolLet + || node instanceof AST_SymbolConst) { + var def; + if (node instanceof AST_SymbolBlockDeclaration) { + def = scope.def_variable(node, null); + } else { + def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : undefined); + } + if (!all(def.orig, function(sym) { + if (sym === node) return true; + if (node instanceof AST_SymbolBlockDeclaration) { + return sym instanceof AST_SymbolLambda; + } + return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst); + })) { + js_error( + node.name + " redeclared", + node.start.file, + node.start.line, + node.start.col, + node.start.pos + ); + } + if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2); + def.destructuring = in_destructuring; + if (defun !== scope) { + node.mark_enclosed(options); + var def = scope.find_variable(node); + if (node.thedef !== def) { + node.thedef = def; + node.reference(options); + } + } + } else if (node instanceof AST_SymbolCatch) { + scope.def_variable(node).defun = defun; + } else if (node instanceof AST_LabelRef) { + var sym = labels.get(node.name); + if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { + name: node.name, + line: node.start.line, + col: node.start.col + })); + node.thedef = sym; + } + if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) { + js_error( + node.TYPE + " statement may only appear at top level", + node.start.file, + node.start.line, + node.start.col, + node.start.pos + ); + } + + function mark_export(def, level) { + if (in_destructuring) { + var i = 0; + do { + level++; + } while (tw.parent(i++) !== in_destructuring); + } + var node = tw.parent(level); + if (def.export = node instanceof AST_Export && MASK_EXPORT_DONT_MANGLE) { + var exported = node.exported_definition; + if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) { + def.export = MASK_EXPORT_WANT_MANGLE; + } + } + } + }); + self.walk(tw); + + // pass 2: find back references and eval + self.globals = new Dictionary(); + var tw = new TreeWalker(function(node, descend) { + if (node instanceof AST_LoopControl && node.label) { + node.label.thedef.references.push(node); + return true; + } + if (node instanceof AST_SymbolRef) { + var name = node.name; + if (name == "eval" && tw.parent() instanceof AST_Call) { + for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) { + s.uses_eval = true; + } + } + var sym; + if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name + || !(sym = node.scope.find_variable(name))) { + sym = self.def_global(node); + if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE; + } else if (sym.scope instanceof AST_Lambda && name == "arguments") { + sym.scope.uses_arguments = true; + } + node.thedef = sym; + node.reference(options); + if (node.scope.is_block_scope() + && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) { + node.scope = node.scope.get_defun_scope(); + } + return true; + } + // ensure mangling works if catch reuses a scope variable + var def; + if (node instanceof AST_SymbolCatch && (def = node.definition().redefined())) { + var s = node.scope; + while (s) { + push_uniq(s.enclosed, def); + if (s === def.scope) break; + s = s.parent_scope; + } + } + }); + self.walk(tw); + + // pass 3: work around IE8 and Safari catch scope bugs + if (options.ie8 || options.safari10) { + self.walk(new TreeWalker(function(node, descend) { + if (node instanceof AST_SymbolCatch) { + var name = node.name; + var refs = node.thedef.references; + var scope = node.thedef.defun; + var def = scope.find_variable(name) || self.globals.get(name) || scope.def_variable(node); + refs.forEach(function(ref) { + ref.thedef = def; + ref.reference(options); + }); + node.thedef = def; + node.reference(options); + return true; + } + })); + } + + // pass 4: add symbol definitions to loop scopes + // Safari/Webkit bug workaround - loop init let variable shadowing argument. + // https://github.com/mishoo/UglifyJS2/issues/1753 + // https://bugs.webkit.org/show_bug.cgi?id=171041 + if (options.safari10) { + for (var i = 0; i < for_scopes.length; i++) { + var scope = for_scopes[i]; + scope.parent_scope.variables.each(function(def) { + push_uniq(scope.enclosed, def); + }); + } + } +}); + +AST_Toplevel.DEFMETHOD("def_global", function(node) { + var globals = this.globals, name = node.name; + if (globals.has(name)) { + return globals.get(name); + } else { + var g = new SymbolDef(this, node); + g.undeclared = true; + g.global = true; + globals.set(name, g); + return g; + } +}); + +AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope) { + this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) + this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope) + this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement + this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` + this.parent_scope = parent_scope; // the parent scope + this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes + this.cname = -1; // the current index for mangling functions/variables +}); + +AST_Node.DEFMETHOD("is_block_scope", return_false); +AST_Class.DEFMETHOD("is_block_scope", return_false); +AST_Lambda.DEFMETHOD("is_block_scope", return_false); +AST_Toplevel.DEFMETHOD("is_block_scope", return_false); +AST_SwitchBranch.DEFMETHOD("is_block_scope", return_false); +AST_Block.DEFMETHOD("is_block_scope", return_true); +AST_IterationStatement.DEFMETHOD("is_block_scope", return_true); + +AST_Lambda.DEFMETHOD("init_scope_vars", function() { + AST_Scope.prototype.init_scope_vars.apply(this, arguments); + this.uses_arguments = false; + this.def_variable(new AST_SymbolFunarg({ + name: "arguments", + start: this.start, + end: this.end + })); +}); + +AST_Arrow.DEFMETHOD("init_scope_vars", function() { + AST_Scope.prototype.init_scope_vars.apply(this, arguments); + this.uses_arguments = false; +}); + +AST_Symbol.DEFMETHOD("mark_enclosed", function(options) { + var def = this.definition(); + var s = this.scope; + while (s) { + push_uniq(s.enclosed, def); + if (options.keep_fnames) { + s.functions.each(function(d) { + if (keep_name(options.keep_fnames, d.name)) { + push_uniq(def.scope.enclosed, d); + } + }); + } + if (s === def.scope) break; + s = s.parent_scope; + } +}); + +AST_Symbol.DEFMETHOD("reference", function(options) { + this.definition().references.push(this); + this.mark_enclosed(options); +}); + +AST_Scope.DEFMETHOD("find_variable", function(name) { + if (name instanceof AST_Symbol) name = name.name; + return this.variables.get(name) + || (this.parent_scope && this.parent_scope.find_variable(name)); +}); + +AST_Scope.DEFMETHOD("def_function", function(symbol, init) { + var def = this.def_variable(symbol, init); + if (!def.init || def.init instanceof AST_Defun) def.init = init; + this.functions.set(symbol.name, def); + return def; +}); + +AST_Scope.DEFMETHOD("def_variable", function(symbol, init) { + var def = this.variables.get(symbol.name); + if (def) { + def.orig.push(symbol); + if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) { + def.init = init; + } + } else { + def = new SymbolDef(this, symbol, init); + this.variables.set(symbol.name, def); + def.global = !this.parent_scope; + } + return symbol.thedef = def; +}); + +function next_mangled(scope, options) { + var ext = scope.enclosed; + out: while (true) { + var m = base54(++scope.cname); + if (!is_identifier(m)) continue; // skip over "do" + + // https://github.com/mishoo/UglifyJS2/issues/242 -- do not + // shadow a name reserved from mangling. + if (member(m, options.reserved)) continue; + + // we must ensure that the mangled name does not shadow a name + // from some parent scope that is referenced in this or in + // inner scopes. + for (var i = ext.length; --i >= 0;) { + var sym = ext[i]; + var name = sym.mangled_name || (sym.unmangleable(options) && sym.name); + if (m == name) continue out; + } + return m; + } +} + +AST_Scope.DEFMETHOD("next_mangled", function(options) { + return next_mangled(this, options); +}); + +AST_Toplevel.DEFMETHOD("next_mangled", function(options) { + var name; + do { + name = next_mangled(this, options); + } while (member(name, this.mangled_names)); + return name; +}); + +AST_Function.DEFMETHOD("next_mangled", function(options, def) { + // #179, #326 + // in Safari strict mode, something like (function x(x){...}) is a syntax error; + // a function expression's argument cannot shadow the function expression's name + + var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition(); + + // the function's mangled_name is null when keep_fnames is true + var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null; + + while (true) { + var name = next_mangled(this, options); + if (!tricky_name || tricky_name != name) + return name; + } +}); + +AST_Symbol.DEFMETHOD("unmangleable", function(options) { + var def = this.definition(); + return !def || def.unmangleable(options); +}); + +// labels are always mangleable +AST_Label.DEFMETHOD("unmangleable", return_false); + +AST_Symbol.DEFMETHOD("unreferenced", function() { + return !this.definition().references.length && !this.scope.pinned(); +}); + +AST_Symbol.DEFMETHOD("definition", function() { + return this.thedef; +}); + +AST_Symbol.DEFMETHOD("global", function() { + return this.definition().global; +}); + +AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options) { + options = defaults(options, { + eval : false, + ie8 : false, + keep_classnames: false, + keep_fnames : false, + module : false, + reserved : [], + toplevel : false, + }); + if (options["module"]) { + options.toplevel = true; + } + if (!Array.isArray(options.reserved)) options.reserved = []; + // Never mangle arguments + push_uniq(options.reserved, "arguments"); + return options; +}); + +AST_Toplevel.DEFMETHOD("mangle_names", function(options) { + options = this._default_mangler_options(options); + + // We only need to mangle declaration nodes. Special logic wired + // into the code generator will display the mangled name if it's + // present (and for AST_SymbolRef-s it'll use the mangled name of + // the AST_SymbolDeclaration that it points to). + var lname = -1; + var to_mangle = []; + + var mangled_names = this.mangled_names = []; + if (options.cache) { + this.globals.each(collect); + if (options.cache.props) { + options.cache.props.each(function(mangled_name) { + push_uniq(mangled_names, mangled_name); + }); + } + } + + var tw = new TreeWalker(function(node, descend) { + if (node instanceof AST_LabeledStatement) { + // lname is incremented when we get to the AST_Label + var save_nesting = lname; + descend(); + lname = save_nesting; + return true; // don't descend again in TreeWalker + } + if (node instanceof AST_Scope) { + node.variables.each(collect); + return; + } + if (node.is_block_scope()) { + node.block_scope.variables.each(collect); + return; + } + if (node instanceof AST_Label) { + var name; + do name = base54(++lname); while (!is_identifier(name)); + node.mangled_name = name; + return true; + } + if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) { + to_mangle.push(node.definition()); + return; + } + }); + this.walk(tw); + to_mangle.forEach(function(def) { def.mangle(options); }); + + function collect(symbol) { + if (!member(symbol.name, options.reserved)) { + if (!(symbol.export & MASK_EXPORT_DONT_MANGLE)) { + to_mangle.push(symbol); + } + } + } +}); + +AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { + var cache = options.cache && options.cache.props; + var avoid = Object.create(null); + options.reserved.forEach(to_avoid); + this.globals.each(add_def); + this.walk(new TreeWalker(function(node) { + if (node instanceof AST_Scope) node.variables.each(add_def); + if (node instanceof AST_SymbolCatch) add_def(node.definition()); + })); + return avoid; + + function to_avoid(name) { + avoid[name] = true; + } + + function add_def(def) { + var name = def.name; + if (def.global && cache && cache.has(name)) name = cache.get(name); + else if (!def.unmangleable(options)) return; + to_avoid(name); + } +}); + +AST_Toplevel.DEFMETHOD("expand_names", function(options) { + base54.reset(); + base54.sort(); + options = this._default_mangler_options(options); + var avoid = this.find_colliding_names(options); + var cname = 0; + this.globals.each(rename); + this.walk(new TreeWalker(function(node) { + if (node instanceof AST_Scope) node.variables.each(rename); + if (node instanceof AST_SymbolCatch) rename(node.definition()); + })); + + function next_name() { + var name; + do { + name = base54(cname++); + } while (avoid[name] || !is_identifier(name)); + return name; + } + + function rename(def) { + if (def.global && options.cache) return; + if (def.unmangleable(options)) return; + if (member(def.name, options.reserved)) return; + var d = def.redefined(); + def.name = d ? d.name : next_name(); + def.orig.forEach(function(sym) { + sym.name = def.name; + }); + def.references.forEach(function(sym) { + sym.name = def.name; + }); + } +}); + +AST_Node.DEFMETHOD("tail_node", return_this); +AST_Sequence.DEFMETHOD("tail_node", function() { + return this.expressions[this.expressions.length - 1]; +}); + +AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { + options = this._default_mangler_options(options); + try { + AST_Node.prototype.print = function(stream, force_parens) { + this._print(stream, force_parens); + if (this instanceof AST_Symbol && !this.unmangleable(options)) { + base54.consider(this.name, -1); + } else if (options.properties) { + if (this instanceof AST_Dot) { + base54.consider(this.property, -1); + } else if (this instanceof AST_Sub) { + skip_string(this.property); + } + } + }; + base54.consider(this.print_to_string(), 1); + } finally { + AST_Node.prototype.print = AST_Node.prototype._print; + } + base54.sort(); + + function skip_string(node) { + if (node instanceof AST_String) { + base54.consider(node.value, -1); + } else if (node instanceof AST_Conditional) { + skip_string(node.consequent); + skip_string(node.alternative); + } else if (node instanceof AST_Sequence) { + skip_string(node.tail_node()); + } + } +}); + +var base54 = (function() { + var leading = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""); + var digits = "0123456789".split(""); + var chars, frequency; + function reset() { + frequency = Object.create(null); + leading.forEach(function(ch) { + frequency[ch] = 0; + }); + digits.forEach(function(ch) { + frequency[ch] = 0; + }); + } + base54.consider = function(str, delta) { + for (var i = str.length; --i >= 0;) { + frequency[str[i]] += delta; + } + }; + function compare(a, b) { + return frequency[b] - frequency[a]; + } + base54.sort = function() { + chars = mergeSort(leading, compare).concat(mergeSort(digits, compare)); + }; + base54.reset = reset; + reset(); + function base54(num) { + var ret = "", base = 54; + num++; + do { + num--; + ret += chars[num % base]; + num = Math.floor(num / base); + base = 64; + } while (num > 0); + return ret; + } + return base54; +})(); +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + https://github.com/mishoo/UglifyJS2 + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2012 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +"use strict"; + +var EXPECT_DIRECTIVE = /^$|[;{][\s\n]*$/; + +function is_some_comments(comment) { + // multiline comment + return comment.type == "comment2" && /@preserve|@license|@cc_on/i.test(comment.value); +} + +function OutputStream(options) { + + var readonly = !options; + options = defaults(options, { + ascii_only : false, + beautify : false, + braces : false, + comments : false, + ecma : 5, + ie8 : false, + indent_level : 4, + indent_start : 0, + inline_script : true, + keep_quoted_props: false, + max_line_len : false, + preamble : null, + quote_keys : false, + quote_style : 0, + safari10 : false, + semicolons : true, + shebang : true, + shorthand : undefined, + source_map : null, + webkit : false, + width : 80, + wrap_iife : false, + }, true); + + if (options.shorthand === undefined) + options.shorthand = options.ecma > 5; + + // Convert comment option to RegExp if neccessary and set up comments filter + var comment_filter = return_false; // Default case, throw all comments away + if (options.comments) { + var comments = options.comments; + if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { + var regex_pos = options.comments.lastIndexOf("/"); + comments = new RegExp( + options.comments.substr(1, regex_pos - 1), + options.comments.substr(regex_pos + 1) + ); + } + if (comments instanceof RegExp) { + comment_filter = function(comment) { + return comment.type != "comment5" && comments.test(comment.value); + }; + } else if (typeof comments === "function") { + comment_filter = function(comment) { + return comment.type != "comment5" && comments(this, comment); + }; + } else if (comments === "some") { + comment_filter = is_some_comments; + } else { // NOTE includes "all" option + comment_filter = return_true; + } + } + + var indentation = 0; + var current_col = 0; + var current_line = 1; + var current_pos = 0; + var OUTPUT = ""; + + var to_utf8 = options.ascii_only ? function(str, identifier) { + if (options.ecma >= 6) { + str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { + var code = get_full_char_code(ch, 0).toString(16); + return "\\u{" + code + "}"; + }); + } + return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { + var code = ch.charCodeAt(0).toString(16); + if (code.length <= 2 && !identifier) { + while (code.length < 2) code = "0" + code; + return "\\x" + code; + } else { + while (code.length < 4) code = "0" + code; + return "\\u" + code; + } + }); + } : function(str) { + var s = ""; + for (var i = 0, len = str.length; i < len; i++) { + if (is_surrogate_pair_head(str[i]) && !is_surrogate_pair_tail(str[i + 1]) + || is_surrogate_pair_tail(str[i]) && !is_surrogate_pair_head(str[i - 1])) { + s += "\\u" + str.charCodeAt(i).toString(16); + } else { + s += str[i]; + } + } + return s; + }; + + function make_string(str, quote) { + var dq = 0, sq = 0; + str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, + function(s, i) { + switch (s) { + case '"': ++dq; return '"'; + case "'": ++sq; return "'"; + case "\\": return "\\\\"; + case "\n": return "\\n"; + case "\r": return "\\r"; + case "\t": return "\\t"; + case "\b": return "\\b"; + case "\f": return "\\f"; + case "\x0B": return options.ie8 ? "\\x0B" : "\\v"; + case "\u2028": return "\\u2028"; + case "\u2029": return "\\u2029"; + case "\ufeff": return "\\ufeff"; + case "\0": + return /[0-9]/.test(get_full_char(str, i+1)) ? "\\x00" : "\\0"; + } + return s; + }); + function quote_single() { + return "'" + str.replace(/\x27/g, "\\'") + "'"; + } + function quote_double() { + return '"' + str.replace(/\x22/g, '\\"') + '"'; + } + function quote_template() { + return "`" + str.replace(/`/g, "\\`") + "`"; + } + str = to_utf8(str); + if (quote === "`") return quote_template(); + switch (options.quote_style) { + case 1: + return quote_single(); + case 2: + return quote_double(); + case 3: + return quote == "'" ? quote_single() : quote_double(); + default: + return dq > sq ? quote_single() : quote_double(); + } + } + + function encode_string(str, quote) { + var ret = make_string(str, quote); + if (options.inline_script) { + ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); + ret = ret.replace(/\x3c!--/g, "\\x3c!--"); + ret = ret.replace(/--\x3e/g, "--\\x3e"); + } + return ret; + } + + function make_name(name) { + name = name.toString(); + name = to_utf8(name, true); + return name; + } + + function make_indent(back) { + return repeat_string(" ", options.indent_start + indentation - back * options.indent_level); + } + + /* -----[ beautification/minification ]----- */ + + var has_parens = false; + var might_need_space = false; + var might_need_semicolon = false; + var might_add_newline = 0; + var need_newline_indented = false; + var need_space = false; + var newline_insert = -1; + var last = ""; + var mapping_token, mapping_name, mappings = options.source_map && []; + + var do_add_mapping = mappings ? function() { + mappings.forEach(function(mapping) { + try { + options.source_map.add( + mapping.token.file, + mapping.line, mapping.col, + mapping.token.line, mapping.token.col, + !mapping.name && mapping.token.type == "name" ? mapping.token.value : mapping.name + ); + } catch(ex) { + mapping.token.file != null && AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", { + file: mapping.token.file, + line: mapping.token.line, + col: mapping.token.col, + cline: mapping.line, + ccol: mapping.col, + name: mapping.name || "" + }); + } + }); + mappings = []; + } : noop; + + var ensure_line_len = options.max_line_len ? function() { + if (current_col > options.max_line_len) { + if (might_add_newline) { + var left = OUTPUT.slice(0, might_add_newline); + var right = OUTPUT.slice(might_add_newline); + if (mappings) { + var delta = right.length - current_col; + mappings.forEach(function(mapping) { + mapping.line++; + mapping.col += delta; + }); + } + OUTPUT = left + "\n" + right; + current_line++; + current_pos++; + current_col = right.length; + } + if (current_col > options.max_line_len) { + AST_Node.warn("Output exceeds {max_line_len} characters", options); + } + } + if (might_add_newline) { + might_add_newline = 0; + do_add_mapping(); + } + } : noop; + + var requireSemicolonChars = makePredicate("( [ + * / - , . `"); + + function print(str) { + str = String(str); + var ch = get_full_char(str, 0); + var prev = get_full_char(last, last.length - 1); + if (need_newline_indented && ch) { + need_newline_indented = false; + if (ch != "\n") { + print("\n"); + indent(); + } + } + if (need_space && ch) { + need_space = false; + if (!/[\s;})]/.test(ch)) { + space(); + } + } + newline_insert = -1; + var prev = last.charAt(last.length - 1); + if (might_need_semicolon) { + might_need_semicolon = false; + + if (prev == ":" && ch == "}" || (!ch || ";}".indexOf(ch) < 0) && prev != ";") { + if (options.semicolons || requireSemicolonChars(ch)) { + OUTPUT += ";"; + current_col++; + current_pos++; + } else { + ensure_line_len(); + OUTPUT += "\n"; + current_pos++; + current_line++; + current_col = 0; + + if (/^\s+$/.test(str)) { + // reset the semicolon flag, since we didn't print one + // now and might still have to later + might_need_semicolon = true; + } + } + + if (!options.beautify) + might_need_space = false; + } + } + + if (might_need_space) { + if ((is_identifier_char(prev) + && (is_identifier_char(ch) || ch == "\\")) + || (ch == "/" && ch == prev) + || ((ch == "+" || ch == "-") && ch == last) + ) { + OUTPUT += " "; + current_col++; + current_pos++; + } + might_need_space = false; + } + + if (mapping_token) { + mappings.push({ + token: mapping_token, + name: mapping_name, + line: current_line, + col: current_col + }); + mapping_token = false; + if (!might_add_newline) do_add_mapping(); + } + + OUTPUT += str; + has_parens = str[str.length - 1] == "("; + current_pos += str.length; + var a = str.split(/\r?\n/), n = a.length - 1; + current_line += n; + current_col += a[0].length; + if (n > 0) { + ensure_line_len(); + current_col = a[n].length; + } + last = str; + } + + var star = function() { + print("*"); + }; + + var space = options.beautify ? function() { + print(" "); + } : function() { + might_need_space = true; + }; + + var indent = options.beautify ? function(half) { + if (options.beautify) { + print(make_indent(half ? 0.5 : 0)); + } + } : noop; + + var with_indent = options.beautify ? function(col, cont) { + if (col === true) col = next_indent(); + var save_indentation = indentation; + indentation = col; + var ret = cont(); + indentation = save_indentation; + return ret; + } : function(col, cont) { return cont(); }; + + var newline = options.beautify ? function() { + if (newline_insert < 0) return print("\n"); + if (OUTPUT[newline_insert] != "\n") { + OUTPUT = OUTPUT.slice(0, newline_insert) + "\n" + OUTPUT.slice(newline_insert); + current_pos++; + current_line++; + } + newline_insert++; + } : options.max_line_len ? function() { + ensure_line_len(); + might_add_newline = OUTPUT.length; + } : noop; + + var semicolon = options.beautify ? function() { + print(";"); + } : function() { + might_need_semicolon = true; + }; + + function force_semicolon() { + might_need_semicolon = false; + print(";"); + } + + function next_indent() { + return indentation + options.indent_level; + } + + function with_block(cont) { + var ret; + print("{"); + newline(); + with_indent(next_indent(), function() { + ret = cont(); + }); + indent(); + print("}"); + return ret; + } + + function with_parens(cont) { + print("("); + //XXX: still nice to have that for argument lists + //var ret = with_indent(current_col, cont); + var ret = cont(); + print(")"); + return ret; + } + + function with_square(cont) { + print("["); + //var ret = with_indent(current_col, cont); + var ret = cont(); + print("]"); + return ret; + } + + function comma() { + print(","); + space(); + } + + function colon() { + print(":"); + space(); + } + + var add_mapping = mappings ? function(token, name) { + mapping_token = token; + mapping_name = name; + } : noop; + + function get() { + if (might_add_newline) { + ensure_line_len(); + } + return OUTPUT; + } + + function has_nlb() { + var index = OUTPUT.lastIndexOf("\n"); + return /^ *$/.test(OUTPUT.slice(index + 1)); + } + + function prepend_comments(node) { + var self = this; + var start = node.start; + if (!start) return; + if (start.comments_before && start.comments_before._dumped === self) return; + var comments = start.comments_before; + if (!comments) { + comments = start.comments_before = []; + } + comments._dumped = self; + + if (node instanceof AST_Exit && node.value) { + var tw = new TreeWalker(function(node) { + var parent = tw.parent(); + if (parent instanceof AST_Exit + || parent instanceof AST_Binary && parent.left === node + || parent.TYPE == "Call" && parent.expression === node + || parent instanceof AST_Conditional && parent.condition === node + || parent instanceof AST_Dot && parent.expression === node + || parent instanceof AST_Sequence && parent.expressions[0] === node + || parent instanceof AST_Sub && parent.expression === node + || parent instanceof AST_UnaryPostfix) { + if (!node.start) return; + var text = node.start.comments_before; + if (text && text._dumped !== self) { + text._dumped = self; + comments = comments.concat(text); + } + } else { + return true; + } + }); + tw.push(node); + node.value.walk(tw); + } + + if (current_pos == 0) { + if (comments.length > 0 && options.shebang && comments[0].type == "comment5") { + print("#!" + comments.shift().value + "\n"); + indent(); + } + var preamble = options.preamble; + if (preamble) { + print(preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n")); + } + } + + comments = comments.filter(comment_filter, node); + if (comments.length == 0) return; + var last_nlb = has_nlb(); + comments.forEach(function(c, i) { + if (!last_nlb) { + if (c.nlb) { + print("\n"); + indent(); + last_nlb = true; + } else if (i > 0) { + space(); + } + } + if (/comment[134]/.test(c.type)) { + print("//" + c.value.replace(/[@#]__PURE__/g, " ") + "\n"); + indent(); + last_nlb = true; + } else if (c.type == "comment2") { + print("/*" + c.value.replace(/[@#]__PURE__/g, " ") + "*/"); + last_nlb = false; + } + }); + if (!last_nlb) { + if (start.nlb) { + print("\n"); + indent(); + } else { + space(); + } + } + } + + function append_comments(node, tail) { + var self = this; + var token = node.end; + if (!token) return; + var comments = token[tail ? "comments_before" : "comments_after"]; + if (!comments || comments._dumped === self) return; + if (!(node instanceof AST_Statement || all(comments, function(c) { + return !/comment[134]/.test(c.type); + }))) return; + comments._dumped = self; + var insert = OUTPUT.length; + comments.filter(comment_filter, node).forEach(function(c, i) { + need_space = false; + if (need_newline_indented) { + print("\n"); + indent(); + need_newline_indented = false; + } else if (c.nlb && (i > 0 || !has_nlb())) { + print("\n"); + indent(); + } else if (i > 0 || !tail) { + space(); + } + if (/comment[134]/.test(c.type)) { + print("//" + c.value.replace(/[@#]__PURE__/g, " ")); + need_newline_indented = true; + } else if (c.type == "comment2") { + print("/*" + c.value.replace(/[@#]__PURE__/g, " ") + "*/"); + need_space = true; + } + }); + if (OUTPUT.length > insert) newline_insert = insert; + } + + var stack = []; + return { + get : get, + toString : get, + indent : indent, + indentation : function() { return indentation; }, + current_width : function() { return current_col - indentation; }, + should_break : function() { return options.width && this.current_width() >= options.width; }, + has_parens : function() { return has_parens; }, + newline : newline, + print : print, + star : star, + space : space, + comma : comma, + colon : colon, + last : function() { return last; }, + semicolon : semicolon, + force_semicolon : force_semicolon, + to_utf8 : to_utf8, + print_name : function(name) { print(make_name(name)); }, + print_string : function(str, quote, escape_directive) { + var encoded = encode_string(str, quote); + if (escape_directive === true && encoded.indexOf("\\") === -1) { + // Insert semicolons to break directive prologue + if (!EXPECT_DIRECTIVE.test(OUTPUT)) { + force_semicolon(); + } + force_semicolon(); + } + print(encoded); + }, + print_template_string_chars: function(str) { + var encoded = encode_string(str, "`").replace(/\${/g, "\\${"); + return print(encoded.substr(1, encoded.length - 2)); + }, + encode_string : encode_string, + next_indent : next_indent, + with_indent : with_indent, + with_block : with_block, + with_parens : with_parens, + with_square : with_square, + add_mapping : add_mapping, + option : function(opt) { return options[opt]; }, + prepend_comments: readonly ? noop : prepend_comments, + append_comments : readonly || comment_filter === return_false ? noop : append_comments, + line : function() { return current_line; }, + col : function() { return current_col; }, + pos : function() { return current_pos; }, + push_node : function(node) { stack.push(node); }, + pop_node : function() { return stack.pop(); }, + parent : function(n) { + return stack[stack.length - 2 - (n || 0)]; + } + }; + +} + +/* -----[ code generators ]----- */ + +(function() { + + /* -----[ utils ]----- */ + + function DEFPRINT(nodetype, generator) { + nodetype.DEFMETHOD("_codegen", generator); + } + + var in_directive = false; + var active_scope = null; + var use_asm = null; + + AST_Node.DEFMETHOD("print", function(stream, force_parens) { + var self = this, generator = self._codegen; + if (self instanceof AST_Scope) { + active_scope = self; + } else if (!use_asm && self instanceof AST_Directive && self.value == "use asm") { + use_asm = active_scope; + } + function doit() { + stream.prepend_comments(self); + self.add_source_map(stream); + generator(self, stream); + stream.append_comments(self); + } + stream.push_node(self); + if (force_parens || self.needs_parens(stream)) { + stream.with_parens(doit); + } else { + doit(); + } + stream.pop_node(); + if (self === use_asm) { + use_asm = null; + } + }); + AST_Node.DEFMETHOD("_print", AST_Node.prototype.print); + + AST_Node.DEFMETHOD("print_to_string", function(options) { + var s = OutputStream(options); + this.print(s); + return s.get(); + }); + + /* -----[ PARENTHESES ]----- */ + + function PARENS(nodetype, func) { + if (Array.isArray(nodetype)) { + nodetype.forEach(function(nodetype) { + PARENS(nodetype, func); + }); + } else { + nodetype.DEFMETHOD("needs_parens", func); + } + } + + PARENS(AST_Node, return_false); + + // a function expression needs parens around it when it's provably + // the first token to appear in a statement. + PARENS(AST_Function, function(output) { + if (!output.has_parens() && first_in_statement(output)) { + return true; + } + + if (output.option("webkit")) { + var p = output.parent(); + if (p instanceof AST_PropAccess && p.expression === this) { + return true; + } + } + + if (output.option("wrap_iife")) { + var p = output.parent(); + return p instanceof AST_Call && p.expression === this; + } + + return false; + }); + + PARENS(AST_Arrow, function(output) { + var p = output.parent(); + return p instanceof AST_PropAccess && p.expression === this; + }); + + // same goes for an object literal, because otherwise it would be + // interpreted as a block of code. + PARENS(AST_Object, function(output) { + return !output.has_parens() && first_in_statement(output); + }); + + PARENS(AST_ClassExpression, first_in_statement); + + PARENS(AST_Unary, function(output) { + var p = output.parent(); + return p instanceof AST_PropAccess && p.expression === this + || p instanceof AST_Call && p.expression === this + || p instanceof AST_Binary + && p.operator === "**" + && this instanceof AST_UnaryPrefix + && p.left === this + && this.operator !== "++" + && this.operator !== "--"; + }); + + PARENS(AST_Await, function(output) { + var p = output.parent(); + return p instanceof AST_PropAccess && p.expression === this + || p instanceof AST_Call && p.expression === this + || output.option("safari10") && p instanceof AST_UnaryPrefix; + }); + + PARENS(AST_Sequence, function(output) { + var p = output.parent(); + return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) + || p instanceof AST_Unary // !(foo, bar, baz) + || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8 + || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4 + || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2 + || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ] + || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2 + || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30) + * ==> 20 (side effect, set a := 10 and b := 20) */ + || p instanceof AST_Arrow // x => (x, x) + || p instanceof AST_DefaultAssign // x => (x = (0, function(){})) + || p instanceof AST_Expansion // [...(a, b)] + || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {} + || p instanceof AST_Yield // yield (foo, bar) + || p instanceof AST_Export // export default (foo, bar) + ; + }); + + PARENS(AST_Binary, function(output) { + var p = output.parent(); + // (foo && bar)() + if (p instanceof AST_Call && p.expression === this) + return true; + // typeof (foo && bar) + if (p instanceof AST_Unary) + return true; + // (foo && bar)["prop"], (foo && bar).prop + if (p instanceof AST_PropAccess && p.expression === this) + return true; + // this deals with precedence: 3 * (2 + 1) + if (p instanceof AST_Binary) { + var po = p.operator, pp = PRECEDENCE[po]; + var so = this.operator, sp = PRECEDENCE[so]; + if (pp > sp + || (pp == sp + && (this === p.right || po == "**"))) { + return true; + } + } + }); + + PARENS(AST_Yield, function(output) { + var p = output.parent(); + // (yield 1) + (yield 2) + // a = yield 3 + if (p instanceof AST_Binary && p.operator !== "=") + return true; + // (yield 1)() + // new (yield 1)() + if (p instanceof AST_Call && p.expression === this) + return true; + // (yield 1) ? yield 2 : yield 3 + if (p instanceof AST_Conditional && p.condition === this) + return true; + // -(yield 4) + if (p instanceof AST_Unary) + return true; + // (yield x).foo + // (yield x)['foo'] + if (p instanceof AST_PropAccess && p.expression === this) + return true; + }); + + PARENS(AST_PropAccess, function(output) { + var p = output.parent(); + if (p instanceof AST_New && p.expression === this) { + // i.e. new (foo.bar().baz) + // + // if there's one call into this subtree, then we need + // parens around it too, otherwise the call will be + // interpreted as passing the arguments to the upper New + // expression. + var parens = false; + this.walk(new TreeWalker(function(node) { + if (parens || node instanceof AST_Scope) return true; + if (node instanceof AST_Call) { + parens = true; + return true; + } + })); + return parens; + } + }); + + PARENS(AST_Call, function(output) { + var p = output.parent(), p1; + if (p instanceof AST_New && p.expression === this + || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function) + return true; + + // workaround for Safari bug. + // https://bugs.webkit.org/show_bug.cgi?id=123506 + return this.expression instanceof AST_Function + && p instanceof AST_PropAccess + && p.expression === this + && (p1 = output.parent(1)) instanceof AST_Assign + && p1.left === p; + }); + + PARENS(AST_New, function(output) { + var p = output.parent(); + if (!need_constructor_parens(this, output) + && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() + || p instanceof AST_Call && p.expression === this)) // (new foo)(bar) + return true; + }); + + PARENS(AST_Number, function(output) { + var p = output.parent(); + if (p instanceof AST_PropAccess && p.expression === this) { + var value = this.getValue(); + if (value < 0 || /^0/.test(make_num(value))) { + return true; + } + } + }); + + PARENS([ AST_Assign, AST_Conditional ], function(output) { + var p = output.parent(); + // !(a = false) → true + if (p instanceof AST_Unary) + return true; + // 1 + (a = 2) + 3 → 6, side effect setting a = 2 + if (p instanceof AST_Binary && !(p instanceof AST_Assign)) + return true; + // (a = func)() —or— new (a = Object)() + if (p instanceof AST_Call && p.expression === this) + return true; + // (a = foo) ? bar : baz + if (p instanceof AST_Conditional && p.condition === this) + return true; + // (a = foo)["prop"] —or— (a = foo).prop + if (p instanceof AST_PropAccess && p.expression === this) + return true; + // ({a, b} = {a: 1, b: 2}), a destructuring assignment + if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false) + return true; + }); + + /* -----[ PRINTERS ]----- */ + + DEFPRINT(AST_Directive, function(self, output) { + output.print_string(self.value, self.quote); + output.semicolon(); + }); + + DEFPRINT(AST_Expansion, function (self, output) { + output.print("..."); + self.expression.print(output); + }); + + DEFPRINT(AST_Destructuring, function (self, output) { + output.print(self.is_array ? "[" : "{"); + var len = self.names.length; + self.names.forEach(function (name, i) { + if (i > 0) output.comma(); + name.print(output); + // If the final element is a hole, we need to make sure it + // doesn't look like a trailing comma, by inserting an actual + // trailing comma. + if (i == len - 1 && name instanceof AST_Hole) output.comma(); + }); + output.print(self.is_array ? "]" : "}"); + }); + + DEFPRINT(AST_Debugger, function(self, output) { + output.print("debugger"); + output.semicolon(); + }); + + /* -----[ statements ]----- */ + + function display_body(body, is_toplevel, output, allow_directives) { + var last = body.length - 1; + in_directive = allow_directives; + body.forEach(function(stmt, i) { + if (in_directive === true && !(stmt instanceof AST_Directive || + stmt instanceof AST_EmptyStatement || + (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String) + )) { + in_directive = false; + } + if (!(stmt instanceof AST_EmptyStatement)) { + output.indent(); + stmt.print(output); + if (!(i == last && is_toplevel)) { + output.newline(); + if (is_toplevel) output.newline(); + } + } + if (in_directive === true && + stmt instanceof AST_SimpleStatement && + stmt.body instanceof AST_String + ) { + in_directive = false; + } + }); + in_directive = false; + } + + AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { + force_statement(this.body, output); + }); + + DEFPRINT(AST_Statement, function(self, output) { + self.body.print(output); + output.semicolon(); + }); + DEFPRINT(AST_Toplevel, function(self, output) { + display_body(self.body, true, output, true); + output.print(""); + }); + DEFPRINT(AST_LabeledStatement, function(self, output) { + self.label.print(output); + output.colon(); + self.body.print(output); + }); + DEFPRINT(AST_SimpleStatement, function(self, output) { + self.body.print(output); + output.semicolon(); + }); + function print_braced_empty(self, output) { + output.print("{"); + output.with_indent(output.next_indent(), function() { + output.append_comments(self, true); + }); + output.print("}"); + } + function print_braced(self, output, allow_directives) { + if (self.body.length > 0) { + output.with_block(function() { + display_body(self.body, false, output, allow_directives); + }); + } else print_braced_empty(self, output); + } + DEFPRINT(AST_BlockStatement, function(self, output) { + print_braced(self, output); + }); + DEFPRINT(AST_EmptyStatement, function(self, output) { + output.semicolon(); + }); + DEFPRINT(AST_Do, function(self, output) { + output.print("do"); + output.space(); + make_block(self.body, output); + output.space(); + output.print("while"); + output.space(); + output.with_parens(function() { + self.condition.print(output); + }); + output.semicolon(); + }); + DEFPRINT(AST_While, function(self, output) { + output.print("while"); + output.space(); + output.with_parens(function() { + self.condition.print(output); + }); + output.space(); + self._do_print_body(output); + }); + DEFPRINT(AST_For, function(self, output) { + output.print("for"); + output.space(); + output.with_parens(function() { + if (self.init) { + if (self.init instanceof AST_Definitions) { + self.init.print(output); + } else { + parenthesize_for_noin(self.init, output, true); + } + output.print(";"); + output.space(); + } else { + output.print(";"); + } + if (self.condition) { + self.condition.print(output); + output.print(";"); + output.space(); + } else { + output.print(";"); + } + if (self.step) { + self.step.print(output); + } + }); + output.space(); + self._do_print_body(output); + }); + DEFPRINT(AST_ForIn, function(self, output) { + output.print("for"); + if (self.await) { + output.space(); + output.print("await"); + } + output.space(); + output.with_parens(function() { + self.init.print(output); + output.space(); + output.print(self instanceof AST_ForOf ? "of" : "in"); + output.space(); + self.object.print(output); + }); + output.space(); + self._do_print_body(output); + }); + DEFPRINT(AST_With, function(self, output) { + output.print("with"); + output.space(); + output.with_parens(function() { + self.expression.print(output); + }); + output.space(); + self._do_print_body(output); + }); + + /* -----[ functions ]----- */ + AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { + var self = this; + if (!nokeyword) { + if (self.async) { + output.print("async"); + output.space(); + } + output.print("function"); + if (self.is_generator) { + output.star(); + } + if (self.name) { + output.space(); + } + } + if (self.name instanceof AST_Symbol) { + self.name.print(output); + } else if (nokeyword && self.name instanceof AST_Node) { + output.with_square(function() { + self.name.print(output); // Computed method name + }); + } + output.with_parens(function() { + self.argnames.forEach(function(arg, i) { + if (i) output.comma(); + arg.print(output); + }); + }); + output.space(); + print_braced(self, output, true); + }); + DEFPRINT(AST_Lambda, function(self, output) { + self._do_print(output); + }); + + DEFPRINT(AST_PrefixedTemplateString, function(self, output) { + var tag = self.prefix; + var parenthesize_tag = tag instanceof AST_Arrow + || tag instanceof AST_Binary + || tag instanceof AST_Conditional + || tag instanceof AST_Sequence + || tag instanceof AST_Unary; + if (parenthesize_tag) output.print("("); + self.prefix.print(output); + if (parenthesize_tag) output.print(")"); + self.template_string.print(output); + }); + DEFPRINT(AST_TemplateString, function(self, output) { + var is_tagged = output.parent() instanceof AST_PrefixedTemplateString; + + output.print("`"); + for (var i = 0; i < self.segments.length; i++) { + if (!(self.segments[i] instanceof AST_TemplateSegment)) { + output.print("${"); + self.segments[i].print(output); + output.print("}"); + } else if (is_tagged) { + output.print(self.segments[i].raw); + } else { + output.print_template_string_chars(self.segments[i].value); + } + } + output.print("`"); + }); + + AST_Arrow.DEFMETHOD("_do_print", function(output) { + var self = this; + var parent = output.parent(); + var needs_parens = parent instanceof AST_Binary || + parent instanceof AST_Unary || + (parent instanceof AST_Call && self === parent.expression); + if (needs_parens) { output.print("("); } + if (self.async) { + output.print("async"); + output.space(); + } + if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) { + self.argnames[0].print(output); + } else { + output.with_parens(function() { + self.argnames.forEach(function(arg, i) { + if (i) output.comma(); + arg.print(output); + }); + }); + } + output.space(); + output.print("=>"); + output.space(); + if (self.body instanceof AST_Node) { + self.body.print(output); + } else { + print_braced(self, output); + } + if (needs_parens) { output.print(")"); } + }); + + /* -----[ exits ]----- */ + AST_Exit.DEFMETHOD("_do_print", function(output, kind) { + output.print(kind); + if (this.value) { + output.space(); + this.value.print(output); + } + output.semicolon(); + }); + DEFPRINT(AST_Return, function(self, output) { + self._do_print(output, "return"); + }); + DEFPRINT(AST_Throw, function(self, output) { + self._do_print(output, "throw"); + }); + + /* -----[ yield ]----- */ + + DEFPRINT(AST_Yield, function(self, output) { + var star = self.is_star ? "*" : ""; + output.print("yield" + star); + if (self.expression) { + output.space(); + self.expression.print(output); + } + }); + + DEFPRINT(AST_Await, function(self, output) { + output.print("await"); + output.space(); + var e = self.expression; + var parens = !( + e instanceof AST_Call + || e instanceof AST_SymbolRef + || e instanceof AST_PropAccess + || e instanceof AST_Unary + || e instanceof AST_Constant + ); + if (parens) output.print("("); + self.expression.print(output); + if (parens) output.print(")"); + }); + + /* -----[ loop control ]----- */ + AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { + output.print(kind); + if (this.label) { + output.space(); + this.label.print(output); + } + output.semicolon(); + }); + DEFPRINT(AST_Break, function(self, output) { + self._do_print(output, "break"); + }); + DEFPRINT(AST_Continue, function(self, output) { + self._do_print(output, "continue"); + }); + + /* -----[ if ]----- */ + function make_then(self, output) { + var b = self.body; + if (output.option("braces") + || output.option("ie8") && b instanceof AST_Do) + return make_block(b, output); + // The squeezer replaces "block"-s that contain only a single + // statement with the statement itself; technically, the AST + // is correct, but this can create problems when we output an + // IF having an ELSE clause where the THEN clause ends in an + // IF *without* an ELSE block (then the outer ELSE would refer + // to the inner IF). This function checks for this case and + // adds the block braces if needed. + if (!b) return output.force_semicolon(); + while (true) { + if (b instanceof AST_If) { + if (!b.alternative) { + make_block(self.body, output); + return; + } + b = b.alternative; + } else if (b instanceof AST_StatementWithBody) { + b = b.body; + } else break; + } + force_statement(self.body, output); + } + DEFPRINT(AST_If, function(self, output) { + output.print("if"); + output.space(); + output.with_parens(function() { + self.condition.print(output); + }); + output.space(); + if (self.alternative) { + make_then(self, output); + output.space(); + output.print("else"); + output.space(); + if (self.alternative instanceof AST_If) + self.alternative.print(output); + else + force_statement(self.alternative, output); + } else { + self._do_print_body(output); + } + }); + + /* -----[ switch ]----- */ + DEFPRINT(AST_Switch, function(self, output) { + output.print("switch"); + output.space(); + output.with_parens(function() { + self.expression.print(output); + }); + output.space(); + var last = self.body.length - 1; + if (last < 0) print_braced_empty(self, output); + else output.with_block(function() { + self.body.forEach(function(branch, i) { + output.indent(true); + branch.print(output); + if (i < last && branch.body.length > 0) + output.newline(); + }); + }); + }); + AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { + output.newline(); + this.body.forEach(function(stmt) { + output.indent(); + stmt.print(output); + output.newline(); + }); + }); + DEFPRINT(AST_Default, function(self, output) { + output.print("default:"); + self._do_print_body(output); + }); + DEFPRINT(AST_Case, function(self, output) { + output.print("case"); + output.space(); + self.expression.print(output); + output.print(":"); + self._do_print_body(output); + }); + + /* -----[ exceptions ]----- */ + DEFPRINT(AST_Try, function(self, output) { + output.print("try"); + output.space(); + print_braced(self, output); + if (self.bcatch) { + output.space(); + self.bcatch.print(output); + } + if (self.bfinally) { + output.space(); + self.bfinally.print(output); + } + }); + DEFPRINT(AST_Catch, function(self, output) { + output.print("catch"); + if (self.argname) { + output.space(); + output.with_parens(function() { + self.argname.print(output); + }); + } + output.space(); + print_braced(self, output); + }); + DEFPRINT(AST_Finally, function(self, output) { + output.print("finally"); + output.space(); + print_braced(self, output); + }); + + /* -----[ var/const ]----- */ + AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { + output.print(kind); + output.space(); + this.definitions.forEach(function(def, i) { + if (i) output.comma(); + def.print(output); + }); + var p = output.parent(); + var in_for = p instanceof AST_For || p instanceof AST_ForIn; + var output_semicolon = !in_for || p && p.init !== this; + if (output_semicolon) + output.semicolon(); + }); + DEFPRINT(AST_Let, function(self, output) { + self._do_print(output, "let"); + }); + DEFPRINT(AST_Var, function(self, output) { + self._do_print(output, "var"); + }); + DEFPRINT(AST_Const, function(self, output) { + self._do_print(output, "const"); + }); + DEFPRINT(AST_Import, function(self, output) { + output.print("import"); + output.space(); + if (self.imported_name) { + self.imported_name.print(output); + } + if (self.imported_name && self.imported_names) { + output.print(","); + output.space(); + } + if (self.imported_names) { + if (self.imported_names.length === 1 && self.imported_names[0].foreign_name.name === "*") { + self.imported_names[0].print(output); + } else { + output.print("{"); + self.imported_names.forEach(function (name_import, i) { + output.space(); + name_import.print(output); + if (i < self.imported_names.length - 1) { + output.print(","); + } + }); + output.space(); + output.print("}"); + } + } + if (self.imported_name || self.imported_names) { + output.space(); + output.print("from"); + output.space(); + } + self.module_name.print(output); + output.semicolon(); + }); + + DEFPRINT(AST_NameMapping, function(self, output) { + var is_import = output.parent() instanceof AST_Import; + var definition = self.name.definition(); + var names_are_different = + (definition && definition.mangled_name || self.name.name) !== + self.foreign_name.name; + if (names_are_different) { + if (is_import) { + output.print(self.foreign_name.name); + } else { + self.name.print(output); + } + output.space(); + output.print("as"); + output.space(); + if (is_import) { + self.name.print(output); + } else { + output.print(self.foreign_name.name); + } + } else { + self.name.print(output); + } + }); + + DEFPRINT(AST_Export, function(self, output) { + output.print("export"); + output.space(); + if (self.is_default) { + output.print("default"); + output.space(); + } + if (self.exported_names) { + if (self.exported_names.length === 1 && self.exported_names[0].name.name === "*") { + self.exported_names[0].print(output); + } else { + output.print("{"); + self.exported_names.forEach(function(name_export, i) { + output.space(); + name_export.print(output); + if (i < self.exported_names.length - 1) { + output.print(","); + } + }); + output.space(); + output.print("}"); + } + } else if (self.exported_value) { + self.exported_value.print(output); + } else if (self.exported_definition) { + self.exported_definition.print(output); + if (self.exported_definition instanceof AST_Definitions) return; + } + if (self.module_name) { + output.space(); + output.print("from"); + output.space(); + self.module_name.print(output); + } + if (self.exported_value + && !(self.exported_value instanceof AST_Defun || + self.exported_value instanceof AST_Function || + self.exported_value instanceof AST_Class) + || self.module_name + || self.exported_names + ) { + output.semicolon(); + } + }); + + function parenthesize_for_noin(node, output, noin) { + var parens = false; + // need to take some precautions here: + // https://github.com/mishoo/UglifyJS2/issues/60 + if (noin) node.walk(new TreeWalker(function(node) { + if (parens || node instanceof AST_Scope) return true; + if (node instanceof AST_Binary && node.operator == "in") { + parens = true; + return true; + } + })); + node.print(output, parens); + } + + DEFPRINT(AST_VarDef, function(self, output) { + self.name.print(output); + if (self.value) { + output.space(); + output.print("="); + output.space(); + var p = output.parent(1); + var noin = p instanceof AST_For || p instanceof AST_ForIn; + parenthesize_for_noin(self.value, output, noin); + } + }); + + /* -----[ other expressions ]----- */ + DEFPRINT(AST_Call, function(self, output) { + self.expression.print(output); + if (self instanceof AST_New && !need_constructor_parens(self, output)) + return; + if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) { + output.add_mapping(self.start); + } + output.with_parens(function() { + self.args.forEach(function(expr, i) { + if (i) output.comma(); + expr.print(output); + }); + }); + }); + DEFPRINT(AST_New, function(self, output) { + output.print("new"); + output.space(); + AST_Call.prototype._codegen(self, output); + }); + + AST_Sequence.DEFMETHOD("_do_print", function(output) { + this.expressions.forEach(function(node, index) { + if (index > 0) { + output.comma(); + if (output.should_break()) { + output.newline(); + output.indent(); + } + } + node.print(output); + }); + }); + DEFPRINT(AST_Sequence, function(self, output) { + self._do_print(output); + // var p = output.parent(); + // if (p instanceof AST_Statement) { + // output.with_indent(output.next_indent(), function(){ + // self._do_print(output); + // }); + // } else { + // self._do_print(output); + // } + }); + DEFPRINT(AST_Dot, function(self, output) { + var expr = self.expression; + expr.print(output); + var prop = self.property; + if (output.option("ie8") && RESERVED_WORDS(prop)) { + output.print("["); + output.add_mapping(self.end); + output.print_string(prop); + output.print("]"); + } else { + if (expr instanceof AST_Number && expr.getValue() >= 0) { + if (!/[xa-f.)]/i.test(output.last())) { + output.print("."); + } + } + output.print("."); + // the name after dot would be mapped about here. + output.add_mapping(self.end); + output.print_name(prop); + } + }); + DEFPRINT(AST_Sub, function(self, output) { + self.expression.print(output); + output.print("["); + self.property.print(output); + output.print("]"); + }); + DEFPRINT(AST_UnaryPrefix, function(self, output) { + var op = self.operator; + output.print(op); + if (/^[a-z]/i.test(op) + || (/[+-]$/.test(op) + && self.expression instanceof AST_UnaryPrefix + && /^[+-]/.test(self.expression.operator))) { + output.space(); + } + self.expression.print(output); + }); + DEFPRINT(AST_UnaryPostfix, function(self, output) { + self.expression.print(output); + output.print(self.operator); + }); + DEFPRINT(AST_Binary, function(self, output) { + var op = self.operator; + self.left.print(output); + if (op[0] == ">" /* ">>" ">>>" ">" ">=" */ + && self.left instanceof AST_UnaryPostfix + && self.left.operator == "--") { + // space is mandatory to avoid outputting --> + output.print(" "); + } else { + // the space is optional depending on "beautify" + output.space(); + } + output.print(op); + if ((op == "<" || op == "<<") + && self.right instanceof AST_UnaryPrefix + && self.right.operator == "!" + && self.right.expression instanceof AST_UnaryPrefix + && self.right.expression.operator == "--") { + // space is mandatory to avoid outputting - - - -## Table of Contents - -- [Examples](#examples) - - [Consuming a source map](#consuming-a-source-map) - - [Generating a source map](#generating-a-source-map) - - [With SourceNode (high level API)](#with-sourcenode-high-level-api) - - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) -- [API](#api) - - [SourceMapConsumer](#sourcemapconsumer) - - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) - - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) - - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) - - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) - - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) - - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) - - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) - - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) - - [SourceMapGenerator](#sourcemapgenerator) - - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) - - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) - - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) - - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) - - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) - - [SourceNode](#sourcenode) - - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) - - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) - - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) - - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) - - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) - - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) - - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) - - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) - - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) - - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) - - - -## Examples - -### Consuming a source map - -```js -var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' -}; - -var smc = new SourceMapConsumer(rawSourceMap); - -console.log(smc.sources); -// [ 'http://example.com/www/js/one.js', -// 'http://example.com/www/js/two.js' ] - -console.log(smc.originalPositionFor({ - line: 2, - column: 28 -})); -// { source: 'http://example.com/www/js/two.js', -// line: 2, -// column: 10, -// name: 'n' } - -console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 -})); -// { line: 2, column: 28 } - -smc.eachMapping(function (m) { - // ... -}); -``` - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - -```js -function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } -} - -var ast = parse("40 + 2", "add.js"); -console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' -})); -// { code: '40 + 2', -// map: [object SourceMapGenerator] } -``` - -#### With SourceMapGenerator (low level API) - -```js -var map = new SourceMapGenerator({ - file: "source-mapped.js" -}); - -map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" -}); - -console.log(map.toString()); -// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' -``` - -## API - -Get a reference to the module: - -```js -// Node.js -var sourceMap = require('source-map'); - -// Browser builds -var sourceMap = window.sourceMap; - -// Inside Firefox -const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); -``` - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: Optional. The generated filename this source map is associated with. - -```js -var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); -``` - -#### SourceMapConsumer.prototype.computeColumnSpans() - -Compute the last column for each generated mapping. The last column is -inclusive. - -```js -// Before: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] - -consumer.computeColumnSpans(); - -// After: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1, -// lastColumn: 9 }, -// { line: 2, -// column: 10, -// lastColumn: 19 }, -// { line: 2, -// column: 20, -// lastColumn: Infinity } ] - -``` - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. - -* `column`: The column number in the generated source. - -* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or - `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest - element that is smaller than or greater than the one we are searching for, - respectively, if the exact element cannot be found. Defaults to - `SourceMapConsumer.GREATEST_LOWER_BOUND`. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. - -* `column`: The column number in the original source, or null or null if this - information is not available. - -* `name`: The original identifier, or null if this information is not available. - -```js -consumer.originalPositionFor({ line: 2, column: 10 }) -// { source: 'foo.coffee', -// line: 2, -// column: 2, -// name: null } - -consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) -// { source: null, -// line: null, -// column: null, -// name: null } -``` - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. - -* `column`: The column number in the original source. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. - -* `column`: The column number in the generated source, or null. - -```js -consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) -// { line: 1, -// column: 56 } -``` - -#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) - -Returns all generated line and column information for the original source, line, -and column provided. If no column is provided, returns all mappings -corresponding to a either the line we are searching for or the next closest line -that has any mappings. Otherwise, returns all mappings corresponding to the -given line and either the column we are searching for or the next closest column -that has any offsets. - -The only argument is an object with the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. - -* `column`: Optional. The column number in the original source. - -and an array of objects is returned, each with the following properties: - -* `line`: The line number in the generated source, or null. - -* `column`: The column number in the generated source, or null. - -```js -consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] -``` - -#### SourceMapConsumer.prototype.hasContentsOfAllSources() - -Return true if we have the embedded source content for every source listed in -the source map, false otherwise. - -In other words, if this method returns `true`, then -`consumer.sourceContentFor(s)` will succeed for every source `s` in -`consumer.sources`. - -```js -// ... -if (consumer.hasContentsOfAllSources()) { - consumerReadyCallback(consumer); -} else { - fetchSources(consumer, consumerReadyCallback); -} -// ... -``` - -#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -If the source content for the given source is not found, then an error is -thrown. Optionally, pass `true` as the second param to have `null` returned -instead. - -```js -consumer.sources -// [ "my-cool-lib.clj" ] - -consumer.sourceContentFor("my-cool-lib.clj") -// "..." - -consumer.sourceContentFor("this is not in the source map"); -// Error: "this is not in the source map" is not in the source map - -consumer.sourceContentFor("this is not in the source map", true); -// null -``` - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -```js -consumer.eachMapping(function (m) { console.log(m); }) -// ... -// { source: 'illmatic.js', -// generatedLine: 1, -// generatedColumn: 0, -// originalLine: 1, -// originalColumn: 0, -// name: null } -// { source: 'illmatic.js', -// generatedLine: 2, -// generatedColumn: 0, -// originalLine: 2, -// originalColumn: 0, -// name: null } -// ... -``` -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator([startOfSourceMap]) - -You may pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: A root for all relative URLs in this source map. - -* `skipValidation`: Optional. When `true`, disables validation of mappings as - they are added. This can improve performance but should be used with - discretion, as a last resort. Even then, one should avoid using this flag when - running tests, if possible. - -```js -var generator = new sourceMap.SourceMapGenerator({ - file: "my-generated-javascript-file.js", - sourceRoot: "http://example.com/app/js/" -}); -``` - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. - -* `sourceMapConsumer` The SourceMap. - -```js -var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); -``` - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -```js -generator.addMapping({ - source: "module-one.scm", - original: { line: 128, column: 0 }, - generated: { line: 3, column: 456 } -}) -``` - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -```js -generator.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimum of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used, if it exists. - Otherwise an error will be thrown. - -* `sourceMapPath`: Optional. The dirname of the path to the SourceMap - to be applied. If relative, it is relative to the SourceMap. - - This parameter is needed when the two SourceMaps aren't in the same - directory, and the SourceMap to be applied contains relative source - paths. If so, those relative source paths need to be rewritten - relative to the SourceMap. - - If omitted, it is assumed that both SourceMaps are in the same directory, - thus not needing any rewriting. (Supplying `'.'` has the same effect.) - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -```js -generator.toString() -// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' -``` - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode([line, column, source[, chunk[, name]]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. - -* `source`: The original source's filename; null if no filename is provided. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -```js -var node = new SourceNode(1, 2, "a.cpp", [ - new SourceNode(3, 4, "b.cpp", "extern int status;\n"), - new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), - new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), -]); -``` - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -* `relativePath` The optional path that relative sources in `sourceMapConsumer` - should be relative to. - -```js -var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map")); -var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), - consumer); -``` - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.add(" + "); -node.add(otherNode); -node.add([leftHandOperandNode, " + ", rightHandOperandNode]); -``` - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.prepend("/** Build Id: f783haef86324gf **/\n\n"); -``` - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -```js -node.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.walk(function (code, loc) { console.log("WALK:", code, loc); }) -// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } -// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } -// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } -// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } -``` - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -```js -var a = new SourceNode(1, 2, "a.js", "generated from a"); -a.setSourceContent("a.js", "original a"); -var b = new SourceNode(1, 2, "b.js", "generated from b"); -b.setSourceContent("b.js", "original b"); -var c = new SourceNode(1, 2, "c.js", "generated from c"); -c.setSourceContent("c.js", "original c"); - -var node = new SourceNode(null, null, null, [a, b, c]); -node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) -// WALK: a.js : original a -// WALK: b.js : original b -// WALK: c.js : original c -``` - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -```js -var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); -var operand = new SourceNode(3, 4, "a.rs", "="); -var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); - -var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); -var joinedNode = node.join(" "); -``` - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming white space from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -```js -// Trim trailing white space. -node.replaceRight(/\s*$/, ""); -``` - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toString() -// 'unodostresquatro' -``` - -#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toStringWithSourceMap({ file: "my-output-file.js" }) -// { code: 'unodostresquatro', -// map: [object SourceMapGenerator] } -``` diff --git a/tools/node_modules/source-map/lib/array-set.js b/tools/node_modules/source-map/lib/array-set.js deleted file mode 100644 index 51dffeb59dbd..000000000000 --- a/tools/node_modules/source-map/lib/array-set.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var has = Object.prototype.hasOwnProperty; - -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -function ArraySet() { - this._array = []; - this._set = Object.create(null); -} - -/** - * Static method for creating ArraySet instances from an existing array. - */ -ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; -}; - -/** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ -ArraySet.prototype.size = function ArraySet_size() { - return Object.getOwnPropertyNames(this._set).length; -}; - -/** - * Add the given string to this set. - * - * @param String aStr - */ -ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = util.toSetString(aStr); - var isDuplicate = has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - this._set[sStr] = idx; - } -}; - -/** - * Is the given string a member of this set? - * - * @param String aStr - */ -ArraySet.prototype.has = function ArraySet_has(aStr) { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); -}; - -/** - * What is the index of the given string in the array? - * - * @param String aStr - */ -ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - throw new Error('"' + aStr + '" is not in the set.'); -}; - -/** - * What is the element at the given index? - * - * @param Number aIdx - */ -ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); -}; - -/** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ -ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); -}; - -exports.ArraySet = ArraySet; diff --git a/tools/node_modules/source-map/lib/base64-vlq.js b/tools/node_modules/source-map/lib/base64-vlq.js deleted file mode 100644 index 612b404018ec..000000000000 --- a/tools/node_modules/source-map/lib/base64-vlq.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var base64 = require('./base64'); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -var VLQ_BASE_SHIFT = 5; - -// binary: 100000 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -var VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -var VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} - -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - -/** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; -}; diff --git a/tools/node_modules/source-map/lib/base64.js b/tools/node_modules/source-map/lib/base64.js deleted file mode 100644 index 8aa86b302643..000000000000 --- a/tools/node_modules/source-map/lib/base64.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - -/** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ -exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; -}; diff --git a/tools/node_modules/source-map/lib/binary-search.js b/tools/node_modules/source-map/lib/binary-search.js deleted file mode 100644 index 010ac941e156..000000000000 --- a/tools/node_modules/source-map/lib/binary-search.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; diff --git a/tools/node_modules/source-map/lib/mapping-list.js b/tools/node_modules/source-map/lib/mapping-list.js deleted file mode 100644 index 06d1274a025a..000000000000 --- a/tools/node_modules/source-map/lib/mapping-list.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ -function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; -} - -/** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ -MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - -/** - * Add the given source mapping. - * - * @param Object aMapping - */ -MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } -}; - -/** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ -MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; -}; - -exports.MappingList = MappingList; diff --git a/tools/node_modules/source-map/lib/quick-sort.js b/tools/node_modules/source-map/lib/quick-sort.js deleted file mode 100644 index 6a7caadbbdbe..000000000000 --- a/tools/node_modules/source-map/lib/quick-sort.js +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -// It turns out that some (most?) JavaScript engines don't self-host -// `Array.prototype.sort`. This makes sense because C++ will likely remain -// faster than JS when doing raw CPU-intensive sorting. However, when using a -// custom comparator function, calling back and forth between the VM's C++ and -// JIT'd JS is rather slow *and* loses JIT type information, resulting in -// worse generated code for the comparator function than would be optimal. In -// fact, when sorting with a comparator, these costs outweigh the benefits of -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get -// a ~3500ms mean speed-up in `bench/bench.html`. - -/** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ -function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; -} - -/** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ -function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); -} - -/** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ -function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } -} - -/** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ -exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); -}; diff --git a/tools/node_modules/source-map/lib/source-map-consumer.js b/tools/node_modules/source-map/lib/source-map-consumer.js deleted file mode 100644 index 6abcc280eea1..000000000000 --- a/tools/node_modules/source-map/lib/source-map-consumer.js +++ /dev/null @@ -1,1082 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var binarySearch = require('./binary-search'); -var ArraySet = require('./array-set').ArraySet; -var base64VLQ = require('./base64-vlq'); -var quickSort = require('./quick-sort').quickSort; - -function SourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap) - : new BasicSourceMapConsumer(sourceMap); -} - -SourceMapConsumer.fromSourceMap = function(aSourceMap) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap); -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; - -// `__generatedMappings` and `__originalMappings` are arrays that hold the -// parsed mapping coordinates from the source map's "mappings" attribute. They -// are lazily instantiated, accessed via the `_generatedMappings` and -// `_originalMappings` getters respectively, and we only parse the mappings -// and create these arrays once queried for a source location. We jump through -// these hoops because there can be many thousands of mappings, and parsing -// them is expensive, so we only want to do it if we must. -// -// Each object in the arrays is of the form: -// -// { -// generatedLine: The line number in the generated code, -// generatedColumn: The column number in the generated code, -// source: The path to the original source file that generated this -// chunk of code, -// originalLine: The line number in the original source that -// corresponds to this chunk of generated code, -// originalColumn: The column number in the original source that -// corresponds to this chunk of generated code, -// name: The name of the original symbol which generated this chunk of -// code. -// } -// -// All properties except for `generatedLine` and `generatedColumn` can be -// `null`. -// -// `_generatedMappings` is ordered by the generated positions. -// -// `_originalMappings` is ordered by the original positions. - -SourceMapConsumer.prototype.__generatedMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } -}); - -SourceMapConsumer.prototype.__originalMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } -}); - -SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -/** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ -SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - if (source != null && sourceRoot != null) { - source = util.join(sourceRoot, source); - } - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - -/** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: Optional. the column number in the original source. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ -SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - if (this.sourceRoot != null) { - needle.source = util.relative(this.sourceRoot, needle.source); - } - if (!this._sources.has(needle.source)) { - return []; - } - needle.source = this._sources.indexOf(needle.source); - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The only parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -function BasicSourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this.file = file; -} - -BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - -/** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @returns BasicSourceMapConsumer - */ -BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - -/** - * The version of the source mapping spec that we are consuming. - */ -BasicSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._sources.toArray().map(function (s) { - return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; - }, this); - } -}); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - -/** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ -BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - -/** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ -BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ -BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - if (this.sourceRoot != null) { - source = util.join(this.sourceRoot, source); - } - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - if (this.sourceRoot != null) { - aSource = util.relative(this.sourceRoot, aSource); - } - - if (this._sources.has(aSource)) { - return this.sourcesContent[this._sources.indexOf(aSource)]; - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + aSource)) { - return this.sourcesContent[this._sources.indexOf("/" + aSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ -BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - if (this.sourceRoot != null) { - source = util.relative(this.sourceRoot, source); - } - if (!this._sources.has(source)) { - return { - line: null, - column: null, - lastColumn: null - }; - } - source = this._sources.indexOf(source); - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The only parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -function IndexedSourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map')) - } - }); -} - -IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - -/** - * The version of the source mapping spec that we are consuming. - */ -IndexedSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } -}); - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ -IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ -IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - if (section.consumer.sourceRoot !== null) { - source = util.join(section.consumer.sourceRoot, source); - } - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/tools/node_modules/source-map/lib/source-map-generator.js b/tools/node_modules/source-map/lib/source-map-generator.js deleted file mode 100644 index 8fbb8e8b79d7..000000000000 --- a/tools/node_modules/source-map/lib/source-map-generator.js +++ /dev/null @@ -1,404 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var base64VLQ = require('./base64-vlq'); -var util = require('./util'); -var ArraySet = require('./array-set').ArraySet; -var MappingList = require('./mapping-list').MappingList; - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; -} - -SourceMapGenerator.prototype._version = 3; - -/** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ -SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - -/** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ -SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - -/** - * Set the source content for a source file. - */ -SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - -/** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ -SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - -/** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ -SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - -/** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ -SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - -SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - -/** - * Externalize the source map. - */ -SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - -/** - * Render the source map being generated to a string. - */ -SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - -exports.SourceMapGenerator = SourceMapGenerator; diff --git a/tools/node_modules/source-map/lib/source-node.js b/tools/node_modules/source-map/lib/source-node.js deleted file mode 100644 index e927f6663ef0..000000000000 --- a/tools/node_modules/source-map/lib/source-node.js +++ /dev/null @@ -1,407 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; -var util = require('./util'); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -var REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -var NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -var isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); -} - -/** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ -SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are removed from this array, by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var shiftNextLine = function() { - var lineContents = remainingLines.shift(); - // The last line of a file might not have a newline. - var newLine = remainingLines.shift() || ""; - return lineContents + newLine; - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[0]; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLines.length > 0) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - -/** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } -}; - -/** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ -SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; -}; - -/** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ -SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; -}; - -/** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ -SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - -/** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - -/** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ -SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; -}; - -/** - * Returns the string representation of this source node along with a source - * map. - */ -SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; -}; - -exports.SourceNode = SourceNode; diff --git a/tools/node_modules/source-map/lib/util.js b/tools/node_modules/source-map/lib/util.js deleted file mode 100644 index 44e0e4520523..000000000000 --- a/tools/node_modules/source-map/lib/util.js +++ /dev/null @@ -1,417 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } -} -exports.getArg = getArg; - -var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; -var dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -} -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); -}()); - -function identity (s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = mappingA.source - mappingB.source; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return mappingA.name - mappingB.name; -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = mappingA.source - mappingB.source; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return mappingA.name - mappingB.name; -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; diff --git a/tools/node_modules/source-map/package.json b/tools/node_modules/source-map/package.json deleted file mode 100644 index e96469ef51fd..000000000000 --- a/tools/node_modules/source-map/package.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "_from": "source-map@0.5.6", - "_id": "source-map@0.5.6", - "_inBundle": false, - "_integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", - "_location": "/source-map", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "source-map@0.5.6", - "name": "source-map", - "escapedName": "source-map", - "rawSpec": "0.5.6", - "saveSpec": null, - "fetchSpec": "0.5.6" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "_shasum": "75ce38f52bf0733c5a7f0c118d81334a2bb5f412", - "_spec": "source-map@0.5.6", - "_where": "/usr/local/google/home/azakai/Dev/emscripten/tools", - "author": { - "name": "Nick Fitzgerald", - "email": "nfitzgerald@mozilla.com" - }, - "bugs": { - "url": "https://github.com/mozilla/source-map/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Tobias Koppers", - "email": "tobias.koppers@googlemail.com" - }, - { - "name": "Duncan Beevers", - "email": "duncan@dweebd.com" - }, - { - "name": "Stephen Crane", - "email": "scrane@mozilla.com" - }, - { - "name": "Ryan Seddon", - "email": "seddon.ryan@gmail.com" - }, - { - "name": "Miles Elam", - "email": "miles.elam@deem.com" - }, - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com" - }, - { - "name": "Michael Ficarra", - "email": "github.public.email@michael.ficarra.me" - }, - { - "name": "Todd Wolfson", - "email": "todd@twolfson.com" - }, - { - "name": "Alexander Solovyov", - "email": "alexander@solovyov.net" - }, - { - "name": "Felix Gnass", - "email": "fgnass@gmail.com" - }, - { - "name": "Conrad Irwin", - "email": "conrad.irwin@gmail.com" - }, - { - "name": "usrbincc", - "email": "usrbincc@yahoo.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Chase Douglas", - "email": "chase@newrelic.com" - }, - { - "name": "Evan Wallace", - "email": "evan.exe@gmail.com" - }, - { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Simon Lydell", - "email": "simon.lydell@gmail.com" - }, - { - "name": "Jmeas Smith", - "email": "jellyes2@gmail.com" - }, - { - "name": "Michael Z Goddard", - "email": "mzgoddard@gmail.com" - }, - { - "name": "azu", - "email": "azu@users.noreply.github.com" - }, - { - "name": "John Gozde", - "email": "john@gozde.ca" - }, - { - "name": "Adam Kirkton", - "email": "akirkton@truefitinnovation.com" - }, - { - "name": "Chris Montgomery", - "email": "christopher.montgomery@dowjones.com" - }, - { - "name": "J. Ryan Stinnett", - "email": "jryans@gmail.com" - }, - { - "name": "Jack Herrington", - "email": "jherrington@walmartlabs.com" - }, - { - "name": "Chris Truter", - "email": "jeffpalentine@gmail.com" - }, - { - "name": "Daniel Espeset", - "email": "daniel@danielespeset.com" - }, - { - "name": "Jamie Wong", - "email": "jamie.lf.wong@gmail.com" - }, - { - "name": "Eddy Bruël", - "email": "ejpbruel@mozilla.com" - }, - { - "name": "Hawken Rives", - "email": "hawkrives@gmail.com" - }, - { - "name": "Gilad Peleg", - "email": "giladp007@gmail.com" - }, - { - "name": "djchie", - "email": "djchie.dev@gmail.com" - }, - { - "name": "Gary Ye", - "email": "garysye@gmail.com" - }, - { - "name": "Nicolas Lalevée", - "email": "nicolas.lalevee@hibnet.org" - } - ], - "deprecated": false, - "description": "Generates and consumes source maps", - "devDependencies": { - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "source-map.js", - "lib/", - "dist/source-map.debug.js", - "dist/source-map.js", - "dist/source-map.min.js", - "dist/source-map.min.js.map" - ], - "homepage": "https://github.com/mozilla/source-map", - "license": "BSD-3-Clause", - "main": "./source-map.js", - "name": "source-map", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/mozilla/source-map.git" - }, - "scripts": { - "build": "webpack --color", - "test": "npm run build && node test/run-tests.js", - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" - }, - "version": "0.5.6" -} diff --git a/tools/node_modules/source-map/source-map.js b/tools/node_modules/source-map/source-map.js deleted file mode 100644 index bc88fe820c87..000000000000 --- a/tools/node_modules/source-map/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/tools/node_modules/terser/node_modules/source-map/CHANGELOG.md b/tools/node_modules/terser/node_modules/source-map/CHANGELOG.md deleted file mode 100644 index 3a8c066c66b1..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/CHANGELOG.md +++ /dev/null @@ -1,301 +0,0 @@ -# Change Log - -## 0.5.6 - -* Fix for regression when people were using numbers as names in source maps. See - #236. - -## 0.5.5 - -* Fix "regression" of unsupported, implementation behavior that half the world - happens to have come to depend on. See #235. - -* Fix regression involving function hoisting in SpiderMonkey. See #233. - -## 0.5.4 - -* Large performance improvements to source-map serialization. See #228 and #229. - -## 0.5.3 - -* Do not include unnecessary distribution files. See - commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. - -## 0.5.2 - -* Include browser distributions of the library in package.json's `files`. See - issue #212. - -## 0.5.1 - -* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See - ff05274becc9e6e1295ed60f3ea090d31d843379. - -## 0.5.0 - -* Node 0.8 is no longer supported. - -* Use webpack instead of dryice for bundling. - -* Big speedups serializing source maps. See pull request #203. - -* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that - explicitly start with the source root. See issue #199. - -## 0.4.4 - -* Fix an issue where using a `SourceMapGenerator` after having created a - `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See - issue #191. - -* Fix an issue with where `SourceMapGenerator` would mistakenly consider - different mappings as duplicates of each other and avoid generating them. See - issue #192. - -## 0.4.3 - -* A very large number of performance improvements, particularly when parsing - source maps. Collectively about 75% of time shaved off of the source map - parsing benchmark! - -* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy - searching in the presence of a column option. See issue #177. - -* Fix a bug with joining a source and its source root when the source is above - the root. See issue #182. - -* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to - determine when all sources' contents are inlined into the source map. See - issue #190. - -## 0.4.2 - -* Add an `.npmignore` file so that the benchmarks aren't pulled down by - dependent projects. Issue #169. - -* Add an optional `column` argument to - `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines - with no mappings. Issues #172 and #173. - -## 0.4.1 - -* Fix accidentally defining a global variable. #170. - -## 0.4.0 - -* The default direction for fuzzy searching was changed back to its original - direction. See #164. - -* There is now a `bias` option you can supply to `SourceMapConsumer` to control - the fuzzy searching direction. See #167. - -* About an 8% speed up in parsing source maps. See #159. - -* Added a benchmark for parsing and generating source maps. - -## 0.3.0 - -* Change the default direction that searching for positions fuzzes when there is - not an exact match. See #154. - -* Support for environments using json2.js for JSON serialization. See #156. - -## 0.2.0 - -* Support for consuming "indexed" source maps which do not have any remote - sections. See pull request #127. This introduces a minor backwards - incompatibility if you are monkey patching `SourceMapConsumer.prototype` - methods. - -## 0.1.43 - -* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue - #148 for some discussion and issues #150, #151, and #152 for implementations. - -## 0.1.42 - -* Fix an issue where `SourceNode`s from different versions of the source-map - library couldn't be used in conjunction with each other. See issue #142. - -## 0.1.41 - -* Fix a bug with getting the source content of relative sources with a "./" - prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). - -* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the - column span of each mapping. - -* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find - all generated positions associated with a given original source and line. - -## 0.1.40 - -* Performance improvements for parsing source maps in SourceMapConsumer. - -## 0.1.39 - -* Fix a bug where setting a source's contents to null before any source content - had been set before threw a TypeError. See issue #131. - -## 0.1.38 - -* Fix a bug where finding relative paths from an empty path were creating - absolute paths. See issue #129. - -## 0.1.37 - -* Fix a bug where if the source root was an empty string, relative source paths - would turn into absolute source paths. Issue #124. - -## 0.1.36 - -* Allow the `names` mapping property to be an empty string. Issue #121. - -## 0.1.35 - -* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` - to specify a path that relative sources in the second parameter should be - relative to. Issue #105. - -* If no file property is given to a `SourceMapGenerator`, then the resulting - source map will no longer have a `null` file property. The property will - simply not exist. Issue #104. - -* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. - Issue #116. - -## 0.1.34 - -* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. - -* Fix bug involving source contents and the - `SourceMapGenerator.prototype.applySourceMap`. Issue #100. - -## 0.1.33 - -* Fix some edge cases surrounding path joining and URL resolution. - -* Add a third parameter for relative path to - `SourceMapGenerator.prototype.applySourceMap`. - -* Fix issues with mappings and EOLs. - -## 0.1.32 - -* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns - (issue 92). - -* Fixed test runner to actually report number of failed tests as its process - exit code. - -* Fixed a typo when reporting bad mappings (issue 87). - -## 0.1.31 - -* Delay parsing the mappings in SourceMapConsumer until queried for a source - location. - -* Support Sass source maps (which at the time of writing deviate from the spec - in small ways) in SourceMapConsumer. - -## 0.1.30 - -* Do not join source root with a source, when the source is a data URI. - -* Extend the test runner to allow running single specific test files at a time. - -* Performance improvements in `SourceNode.prototype.walk` and - `SourceMapConsumer.prototype.eachMapping`. - -* Source map browser builds will now work inside Workers. - -* Better error messages when attempting to add an invalid mapping to a - `SourceMapGenerator`. - -## 0.1.29 - -* Allow duplicate entries in the `names` and `sources` arrays of source maps - (usually from TypeScript) we are parsing. Fixes github issue 72. - -## 0.1.28 - -* Skip duplicate mappings when creating source maps from SourceNode; github - issue 75. - -## 0.1.27 - -* Don't throw an error when the `file` property is missing in SourceMapConsumer, - we don't use it anyway. - -## 0.1.26 - -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. - -## 0.1.25 - -* Make compatible with browserify - -## 0.1.24 - -* Fix issue with absolute paths and `file://` URIs. See - https://bugzilla.mozilla.org/show_bug.cgi?id=885597 - -## 0.1.23 - -* Fix issue with absolute paths and sourcesContent, github issue 64. - -## 0.1.22 - -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. - -## 0.1.21 - -* Fixed handling of sources that start with a slash so that they are relative to - the source root's host. - -## 0.1.20 - -* Fixed github issue #43: absolute URLs aren't joined with the source root - anymore. - -## 0.1.19 - -* Using Travis CI to run tests. - -## 0.1.18 - -* Fixed a bug in the handling of sourceRoot. - -## 0.1.17 - -* Added SourceNode.fromStringWithSourceMap. - -## 0.1.16 - -* Added missing documentation. - -* Fixed the generating of empty mappings in SourceNode. - -## 0.1.15 - -* Added SourceMapGenerator.applySourceMap. - -## 0.1.14 - -* The sourceRoot is now handled consistently. - -## 0.1.13 - -* Added SourceMapGenerator.fromSourceMap. - -## 0.1.12 - -* SourceNode now generates empty mappings too. - -## 0.1.11 - -* Added name support to SourceNode. - -## 0.1.10 - -* Added sourcesContent support to the customer and generator. diff --git a/tools/node_modules/terser/node_modules/source-map/LICENSE b/tools/node_modules/terser/node_modules/source-map/LICENSE deleted file mode 100644 index ed1b7cf27e97..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/terser/node_modules/source-map/README.md b/tools/node_modules/terser/node_modules/source-map/README.md deleted file mode 100644 index fea4beb193f3..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/README.md +++ /dev/null @@ -1,742 +0,0 @@ -# Source Map - -[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) - -[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) - -This is a library to generate and consume the source map format -[described here][format]. - -[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit - -## Use with Node - - $ npm install source-map - -## Use on the Web - - - --------------------------------------------------------------------------------- - - - - - -## Table of Contents - -- [Examples](#examples) - - [Consuming a source map](#consuming-a-source-map) - - [Generating a source map](#generating-a-source-map) - - [With SourceNode (high level API)](#with-sourcenode-high-level-api) - - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) -- [API](#api) - - [SourceMapConsumer](#sourcemapconsumer) - - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) - - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) - - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) - - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) - - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) - - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) - - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) - - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) - - [SourceMapGenerator](#sourcemapgenerator) - - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) - - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) - - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) - - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) - - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) - - [SourceNode](#sourcenode) - - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) - - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) - - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) - - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) - - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) - - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) - - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) - - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) - - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) - - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) - - - -## Examples - -### Consuming a source map - -```js -var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' -}; - -var smc = new SourceMapConsumer(rawSourceMap); - -console.log(smc.sources); -// [ 'http://example.com/www/js/one.js', -// 'http://example.com/www/js/two.js' ] - -console.log(smc.originalPositionFor({ - line: 2, - column: 28 -})); -// { source: 'http://example.com/www/js/two.js', -// line: 2, -// column: 10, -// name: 'n' } - -console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 -})); -// { line: 2, column: 28 } - -smc.eachMapping(function (m) { - // ... -}); -``` - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - -```js -function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } -} - -var ast = parse("40 + 2", "add.js"); -console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' -})); -// { code: '40 + 2', -// map: [object SourceMapGenerator] } -``` - -#### With SourceMapGenerator (low level API) - -```js -var map = new SourceMapGenerator({ - file: "source-mapped.js" -}); - -map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" -}); - -console.log(map.toString()); -// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' -``` - -## API - -Get a reference to the module: - -```js -// Node.js -var sourceMap = require('source-map'); - -// Browser builds -var sourceMap = window.sourceMap; - -// Inside Firefox -const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); -``` - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: Optional. The generated filename this source map is associated with. - -```js -var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); -``` - -#### SourceMapConsumer.prototype.computeColumnSpans() - -Compute the last column for each generated mapping. The last column is -inclusive. - -```js -// Before: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] - -consumer.computeColumnSpans(); - -// After: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1, -// lastColumn: 9 }, -// { line: 2, -// column: 10, -// lastColumn: 19 }, -// { line: 2, -// column: 20, -// lastColumn: Infinity } ] - -``` - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. Line numbers in - this library are 1-based (note that the underlying source map - specification uses 0-based line numbers -- this library handles the - translation). - -* `column`: The column number in the generated source. Column numbers - in this library are 0-based. - -* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or - `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest - element that is smaller than or greater than the one we are searching for, - respectively, if the exact element cannot be found. Defaults to - `SourceMapConsumer.GREATEST_LOWER_BOUND`. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. The line number is 1-based. - -* `column`: The column number in the original source, or null if this - information is not available. The column number is 0-based. - -* `name`: The original identifier, or null if this information is not available. - -```js -consumer.originalPositionFor({ line: 2, column: 10 }) -// { source: 'foo.coffee', -// line: 2, -// column: 2, -// name: null } - -consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) -// { source: null, -// line: null, -// column: null, -// name: null } -``` - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: The column number in the original source. The column - number is 0-based. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) -// { line: 1, -// column: 56 } -``` - -#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) - -Returns all generated line and column information for the original source, line, -and column provided. If no column is provided, returns all mappings -corresponding to a either the line we are searching for or the next closest line -that has any mappings. Otherwise, returns all mappings corresponding to the -given line and either the column we are searching for or the next closest column -that has any offsets. - -The only argument is an object with the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: Optional. The column number in the original source. The - column number is 0-based. - -and an array of objects is returned, each with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] -``` - -#### SourceMapConsumer.prototype.hasContentsOfAllSources() - -Return true if we have the embedded source content for every source listed in -the source map, false otherwise. - -In other words, if this method returns `true`, then -`consumer.sourceContentFor(s)` will succeed for every source `s` in -`consumer.sources`. - -```js -// ... -if (consumer.hasContentsOfAllSources()) { - consumerReadyCallback(consumer); -} else { - fetchSources(consumer, consumerReadyCallback); -} -// ... -``` - -#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -If the source content for the given source is not found, then an error is -thrown. Optionally, pass `true` as the second param to have `null` returned -instead. - -```js -consumer.sources -// [ "my-cool-lib.clj" ] - -consumer.sourceContentFor("my-cool-lib.clj") -// "..." - -consumer.sourceContentFor("this is not in the source map"); -// Error: "this is not in the source map" is not in the source map - -consumer.sourceContentFor("this is not in the source map", true); -// null -``` - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -```js -consumer.eachMapping(function (m) { console.log(m); }) -// ... -// { source: 'illmatic.js', -// generatedLine: 1, -// generatedColumn: 0, -// originalLine: 1, -// originalColumn: 0, -// name: null } -// { source: 'illmatic.js', -// generatedLine: 2, -// generatedColumn: 0, -// originalLine: 2, -// originalColumn: 0, -// name: null } -// ... -``` -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator([startOfSourceMap]) - -You may pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: A root for all relative URLs in this source map. - -* `skipValidation`: Optional. When `true`, disables validation of mappings as - they are added. This can improve performance but should be used with - discretion, as a last resort. Even then, one should avoid using this flag when - running tests, if possible. - -```js -var generator = new sourceMap.SourceMapGenerator({ - file: "my-generated-javascript-file.js", - sourceRoot: "http://example.com/app/js/" -}); -``` - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. - -* `sourceMapConsumer` The SourceMap. - -```js -var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); -``` - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -```js -generator.addMapping({ - source: "module-one.scm", - original: { line: 128, column: 0 }, - generated: { line: 3, column: 456 } -}) -``` - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -```js -generator.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimum of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used, if it exists. - Otherwise an error will be thrown. - -* `sourceMapPath`: Optional. The dirname of the path to the SourceMap - to be applied. If relative, it is relative to the SourceMap. - - This parameter is needed when the two SourceMaps aren't in the same - directory, and the SourceMap to be applied contains relative source - paths. If so, those relative source paths need to be rewritten - relative to the SourceMap. - - If omitted, it is assumed that both SourceMaps are in the same directory, - thus not needing any rewriting. (Supplying `'.'` has the same effect.) - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -```js -generator.toString() -// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' -``` - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode([line, column, source[, chunk[, name]]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. The line number is 1-based. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. The column number - is 0-based. - -* `source`: The original source's filename; null if no filename is provided. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -```js -var node = new SourceNode(1, 2, "a.cpp", [ - new SourceNode(3, 4, "b.cpp", "extern int status;\n"), - new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), - new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), -]); -``` - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -* `relativePath` The optional path that relative sources in `sourceMapConsumer` - should be relative to. - -```js -var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); -var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), - consumer); -``` - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.add(" + "); -node.add(otherNode); -node.add([leftHandOperandNode, " + ", rightHandOperandNode]); -``` - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.prepend("/** Build Id: f783haef86324gf **/\n\n"); -``` - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -```js -node.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.walk(function (code, loc) { console.log("WALK:", code, loc); }) -// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } -// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } -// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } -// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } -``` - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -```js -var a = new SourceNode(1, 2, "a.js", "generated from a"); -a.setSourceContent("a.js", "original a"); -var b = new SourceNode(1, 2, "b.js", "generated from b"); -b.setSourceContent("b.js", "original b"); -var c = new SourceNode(1, 2, "c.js", "generated from c"); -c.setSourceContent("c.js", "original c"); - -var node = new SourceNode(null, null, null, [a, b, c]); -node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) -// WALK: a.js : original a -// WALK: b.js : original b -// WALK: c.js : original c -``` - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -```js -var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); -var operand = new SourceNode(3, 4, "a.rs", "="); -var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); - -var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); -var joinedNode = node.join(" "); -``` - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming white space from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -```js -// Trim trailing white space. -node.replaceRight(/\s*$/, ""); -``` - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toString() -// 'unodostresquatro' -``` - -#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toStringWithSourceMap({ file: "my-output-file.js" }) -// { code: 'unodostresquatro', -// map: [object SourceMapGenerator] } -``` diff --git a/tools/node_modules/terser/node_modules/source-map/dist/source-map.debug.js b/tools/node_modules/terser/node_modules/source-map/dist/source-map.debug.js deleted file mode 100644 index aad0620d70e1..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/dist/source-map.debug.js +++ /dev/null @@ -1,3234 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAxNjI0YzcyOTliODg3ZjdiZGY2NCIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LXZscS5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LmpzIiwid2VicGFjazovLy8uL2xpYi91dGlsLmpzIiwid2VicGFjazovLy8uL2xpYi9hcnJheS1zZXQuanMiLCJ3ZWJwYWN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uICAgICAgfVxuXG4gICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5nZW5lcmF0ZWRDb2x1bW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4pO1xuICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgaWYgKG1hcHBpbmcuc291cmNlICE9IG51bGwpIHtcbiAgICAgICAgc291cmNlSWR4ID0gdGhpcy5fc291cmNlcy5pbmRleE9mKG1hcHBpbmcuc291cmNlKTtcbiAgICAgICAgbmV4dCArPSBiYXNlNjRWTFEuZW5jb2RlKHNvdXJjZUlkeCAtIHByZXZpb3VzU291cmNlKTtcbiAgICAgICAgcHJldmlvdXNTb3VyY2UgPSBzb3VyY2VJZHg7XG5cbiAgICAgICAgLy8gbGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkIGluIFNvdXJjZU1hcCBzcGVjIHZlcnNpb24gM1xuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbExpbmUgLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNPcmlnaW5hbExpbmUpO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsTGluZSA9IG1hcHBpbmcub3JpZ2luYWxMaW5lIC0gMTtcblxuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHByZXZpb3VzT3JpZ2luYWxDb2x1bW4pO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsQ29sdW1uID0gbWFwcGluZy5vcmlnaW5hbENvbHVtbjtcblxuICAgICAgICBpZiAobWFwcGluZy5uYW1lICE9IG51bGwpIHtcbi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tbjtcblxuICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgLy8gT3JpZ2luYWwgc291cmNlLlxuICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gcHJldmlvdXNTb3VyY2UgKyBzZWdtZW50WzFdO1xuICAgICAgICAgIHByZXZpb3VzU291cmNlICs9IHNlZ21lbnRbMV07XG5cbiAgICAgICAgICAvLyBPcmlnaW5hbCBsaW5lLlxuICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxMaW5lID0gcHJldmlvdXNPcmlnaW5hbExpbmUgKyBzZWdtZW50WzJdO1xuICAgICAgICAgIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gbWFwcGluZy5vcmlnaW5hbExpbmU7XG4gICAgICAgICAgLy8gTGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkXG4gICAgICAgICAgbWFwcGluZy5vcmlnaW5hbExpbmUgKz0gMTtcblxuICAgICAgICAgIC8vIE9yaWdpbmFsIGNvbHVtbi5cbiAgICAgICAgICBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uID0gcHJldmlvdXNPcmlnaW5hbENvbHVtbiArIHNlZ21lbnRbM107XG4gICAgICAgICAgcHJldmlvdXNPcmlnaW5hbENvbHVtbiA9IG1hcHBpbmcub3JpZ2luYWxDb2x1bW47XG5cbiAgICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiA0KSB7XG4gICAgICAgICAgICAvLyBPcmlnaW5hbCBuYW1lLlxuICAgICAgICAgICAgbWFwcGluZy5uYW1lID0gcHJldmlvdXNOYW1lICsgc2VnbWVudFs0XTtcbiAgICAgICAgICAgIHByZXZpb3VzTmFtZSArPSBzZWdtZW50WzRdO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGdlbmVyYXRlZE1hcHBpbmdzLnB1c2gobWFwcGluZyk7XG4gICAgICAgIGlmICh0eXBlb2YgbWFwcGluZy5vcmlnaW5hbExpbmUgPT09ICdudW1iZ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HV0aWwuam9pbihhUmVsYXRpdmVQYXRoLCBtYXBwaW5nLnNvdXJjZSlcbiAgICAgICAgICA6IG1hcHBpbmcuc291cmNlO1xuICAgICAgICBub2RlLmFkZChuZXcgU291cmNlTm9kZShtYXBwaW5nLm9yaWdpbmFsTGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwcGluZy5vcmlnaW5hbENvbHVtbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBwaW5nLm5hbWUpKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbi8qKlxuICogQWRkIGEgY2h1bmsgb2YgZ2VuZXJhdGVkIEpTIHRvIHRoaXMgc291cmNlIG5vZGUuXG4gKlxuICogQHBhcmFtIGFDaHVuayBBIHN0cmluZyBzbmlwcGV0IG9mIGdlbmVyYXRlZCBKUyBjb2RlLCBhbm90aGVyIGluc3RhbmNlIG9mXG4gKiAgICAgICAgU291cmNlTm9kZSwgb3IgYW4gYXJyYXkgd2hlcmUgZWFjaCBtZW1iZXIgaXMgb25lIG9mIHRob3NlIHRoaW5ncy5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24gU291cmNlTm9kZV9hZGQoYUNodW5rKSB7XG4gIGlmIChBcnJheS5pc0FycmF5KGFDaHVuaykpIHtcbiAgICBhQ2h1bmsuZm9yRWFjaChmdW5jdGlvbiAoY2h1bmspIHtcbiAgICAgIHRoaXMuYWRkKGNodW5rKTtcbiAgICB9LCB0aGlzKTtcbiAgfVxuICBlbHNlIGlmIChhQ2h1bmtbaXNTb3VyY2VOb2RlXSB8fCB0eXBlb2YgYUNodW5rID09PSBcInN0cmluZ1wiKSB7XG4gICAgaWYgKGFDaHVuaykge1xuICAgICAgdGhpcy5jaGlsZHJlbi5wdXNoKGFD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1bW46IG9yaWdpbmFsLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWQubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWQuY29sdW1uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmFtZTogb3JpZ2luYWwubmFtZVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBnZW5lcmF0ZWQuY29sdW1uKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbiAgdGhpcy53YWxrU291cmNlQ29udGVudHMoZnVuY3Rpb24gKHNvdXJjZUZpbGUsIHNvdXJjZUNvbnRlbnQpIHtcbiAgICBtYXAuc2V0U291cmNlQ29udGVudChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KTtcbiAgfSk7XG5cbiAgcmV0dXJuIHsgY29kZTogZ2VuZXJhdGVkLmNvZGUsIG1hcDogbWFwIH07XG59O1xuXG5leHBvcnRzLlNvdXJjZU5vZGUgPSBTb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW5vZGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/tools/node_modules/terser/node_modules/source-map/dist/source-map.js b/tools/node_modules/terser/node_modules/source-map/dist/source-map.js deleted file mode 100644 index b4eb08742598..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/dist/source-map.js +++ /dev/null @@ -1,3233 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; \ No newline at end of file diff --git a/tools/node_modules/terser/node_modules/source-map/dist/source-map.min.js b/tools/node_modules/terser/node_modules/source-map/dist/source-map.min.js deleted file mode 100644 index c7c72dad8b59..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/dist/source-map.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var o=t;null!==n&&(o=i.relative(n,t)),r._sources.has(o)||r._sources.add(o);var s=e.sourceContentFor(t);null!=s&&r.setSourceContent(t,s)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(y))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=f(e.source,n.source);return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:f(e.name,n.name)))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=f(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:f(e.name,n.name)))))}function f(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}function m(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function _(e,n,r){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),r){var a=t(r);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var u=a.path.lastIndexOf("/");u>=0&&(a.path=a.path.substring(0,u+1))}n=s(o(a),n)}return i(n)}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,y=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||v.test(e)},n.relative=a;var C=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=C?u:l,n.fromSetString=C?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d,n.parseSourceMapInput=m,n.computeSourceURL=_},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e,n){var r=e;return"string"==typeof e&&(r=a.parseSourceMapInput(e)),null!=r.sections?new s(r,n):new o(r,n)}function o(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var t=a.getArg(r,"version"),o=a.getArg(r,"sources"),i=a.getArg(r,"names",[]),s=a.getArg(r,"sourceRoot",null),u=a.getArg(r,"sourcesContent",null),c=a.getArg(r,"mappings"),g=a.getArg(r,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);s&&(s=a.normalize(s)),o=o.map(String).map(a.normalize).map(function(e){return s&&a.isAbsolute(s)&&a.isAbsolute(e)?a.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return a.computeSourceURL(s,e,n)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=n,this.file=g}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var o=a.getArg(r,"version"),i=a.getArg(r,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=a.getArg(e,"offset"),o=a.getArg(r,"line"),i=a.getArg(r,"column");if(o=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(e){var n=e;if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),A.push(r),"number"==typeof r.originalLine&&S.push(r)}g(A,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,g(S,a.compareByOriginalPositions),this.__originalMappings=S},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=a.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var t=e;null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t));var o;if(null!=this.sourceRoot&&(o=a.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!o.path||"/"==o.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(n)return null;throw new Error('"'+t+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r0){for(n=[],r=0;r 0 && aGenerated.column >= 0\n\t && !aOriginal && !aSource && !aName) {\n\t // Case 1.\n\t return;\n\t }\n\t else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n\t && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n\t && aGenerated.line > 0 && aGenerated.column >= 0\n\t && aOriginal.line > 0 && aOriginal.column >= 0\n\t && aSource) {\n\t // Cases 2 and 3.\n\t return;\n\t }\n\t else {\n\t throw new Error('Invalid mapping: ' + JSON.stringify({\n\t generated: aGenerated,\n\t source: aSource,\n\t original: aOriginal,\n\t name: aName\n\t }));\n\t }\n\t };\n\t\n\t/**\n\t * Serialize the accumulated mappings in to the stream of base 64 VLQs\n\t * specified by the source map format.\n\t */\n\tSourceMapGenerator.prototype._serializeMappings =\n\t function SourceMapGenerator_serializeMappings() {\n\t var previousGeneratedColumn = 0;\n\t var previousGeneratedLine = 1;\n\t var previousOriginalColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousName = 0;\n\t var previousSource = 0;\n\t var result = '';\n\t var next;\n\t var mapping;\n\t var nameIdx;\n\t var sourceIdx;\n\t\n\t var mappings = this._mappings.toArray();\n\t for (var i = 0, len = mappings.length; i < len; i++) {\n\t mapping = mappings[i];\n\t next = ''\n\t\n\t if (mapping.generatedLine !== previousGeneratedLine) {\n\t previousGeneratedColumn = 0;\n\t while (mapping.generatedLine !== previousGeneratedLine) {\n\t next += ';';\n\t previousGeneratedLine++;\n\t }\n\t }\n\t else {\n\t if (i > 0) {\n\t if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n\t continue;\n\t }\n\t next += ',';\n\t }\n\t }\n\t\n\t next += base64VLQ.encode(mapping.generatedColumn\n\t - previousGeneratedColumn);\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (mapping.source != null) {\n\t sourceIdx = this._sources.indexOf(mapping.source);\n\t next += base64VLQ.encode(sourceIdx - previousSource);\n\t previousSource = sourceIdx;\n\t\n\t // lines are stored 0-based in SourceMap spec version 3\n\t next += base64VLQ.encode(mapping.originalLine - 1\n\t - previousOriginalLine);\n\t previousOriginalLine = mapping.originalLine - 1;\n\t\n\t next += base64VLQ.encode(mapping.originalColumn\n\t - previousOriginalColumn);\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (mapping.name != null) {\n\t nameIdx = this._names.indexOf(mapping.name);\n\t next += base64VLQ.encode(nameIdx - previousName);\n\t previousName = nameIdx;\n\t }\n\t }\n\t\n\t result += next;\n\t }\n\t\n\t return result;\n\t };\n\t\n\tSourceMapGenerator.prototype._generateSourcesContent =\n\t function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n\t return aSources.map(function (source) {\n\t if (!this._sourcesContents) {\n\t return null;\n\t }\n\t if (aSourceRoot != null) {\n\t source = util.relative(aSourceRoot, source);\n\t }\n\t var key = util.toSetString(source);\n\t return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n\t ? this._sourcesContents[key]\n\t : null;\n\t }, this);\n\t };\n\t\n\t/**\n\t * Externalize the source map.\n\t */\n\tSourceMapGenerator.prototype.toJSON =\n\t function SourceMapGenerator_toJSON() {\n\t var map = {\n\t version: this._version,\n\t sources: this._sources.toArray(),\n\t names: this._names.toArray(),\n\t mappings: this._serializeMappings()\n\t };\n\t if (this._file != null) {\n\t map.file = this._file;\n\t }\n\t if (this._sourceRoot != null) {\n\t map.sourceRoot = this._sourceRoot;\n\t }\n\t if (this._sourcesContents) {\n\t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n\t }\n\t\n\t return map;\n\t };\n\t\n\t/**\n\t * Render the source map being generated to a string.\n\t */\n\tSourceMapGenerator.prototype.toString =\n\t function SourceMapGenerator_toString() {\n\t return JSON.stringify(this.toJSON());\n\t };\n\t\n\texports.SourceMapGenerator = SourceMapGenerator;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t *\n\t * Based on the Base 64 VLQ implementation in Closure Compiler:\n\t * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n\t *\n\t * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * * Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t * * Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t * * Neither the name of Google Inc. nor the names of its\n\t * contributors may be used to endorse or promote products derived\n\t * from this software without specific prior written permission.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\t * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\t * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\t * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\t * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n\t * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n\t * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\t * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n\t * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t */\n\t\n\tvar base64 = __webpack_require__(3);\n\t\n\t// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n\t// length quantities we use in the source map spec, the first bit is the sign,\n\t// the next four bits are the actual value, and the 6th bit is the\n\t// continuation bit. The continuation bit tells us whether there are more\n\t// digits in this value following this digit.\n\t//\n\t// Continuation\n\t// | Sign\n\t// | |\n\t// V V\n\t// 101011\n\t\n\tvar VLQ_BASE_SHIFT = 5;\n\t\n\t// binary: 100000\n\tvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\t\n\t// binary: 011111\n\tvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\t\n\t// binary: 100000\n\tvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\t\n\t/**\n\t * Converts from a two-complement value to a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n\t * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n\t */\n\tfunction toVLQSigned(aValue) {\n\t return aValue < 0\n\t ? ((-aValue) << 1) + 1\n\t : (aValue << 1) + 0;\n\t}\n\t\n\t/**\n\t * Converts to a two-complement value from a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n\t * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n\t */\n\tfunction fromVLQSigned(aValue) {\n\t var isNegative = (aValue & 1) === 1;\n\t var shifted = aValue >> 1;\n\t return isNegative\n\t ? -shifted\n\t : shifted;\n\t}\n\t\n\t/**\n\t * Returns the base 64 VLQ encoded value.\n\t */\n\texports.encode = function base64VLQ_encode(aValue) {\n\t var encoded = \"\";\n\t var digit;\n\t\n\t var vlq = toVLQSigned(aValue);\n\t\n\t do {\n\t digit = vlq & VLQ_BASE_MASK;\n\t vlq >>>= VLQ_BASE_SHIFT;\n\t if (vlq > 0) {\n\t // There are still more digits in this value, so we must make sure the\n\t // continuation bit is marked.\n\t digit |= VLQ_CONTINUATION_BIT;\n\t }\n\t encoded += base64.encode(digit);\n\t } while (vlq > 0);\n\t\n\t return encoded;\n\t};\n\t\n\t/**\n\t * Decodes the next base 64 VLQ value from the given string and returns the\n\t * value and the rest of the string via the out parameter.\n\t */\n\texports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n\t var strLen = aStr.length;\n\t var result = 0;\n\t var shift = 0;\n\t var continuation, digit;\n\t\n\t do {\n\t if (aIndex >= strLen) {\n\t throw new Error(\"Expected more digits in base 64 VLQ value.\");\n\t }\n\t\n\t digit = base64.decode(aStr.charCodeAt(aIndex++));\n\t if (digit === -1) {\n\t throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n\t }\n\t\n\t continuation = !!(digit & VLQ_CONTINUATION_BIT);\n\t digit &= VLQ_BASE_MASK;\n\t result = result + (digit << shift);\n\t shift += VLQ_BASE_SHIFT;\n\t } while (continuation);\n\t\n\t aOutParam.value = fromVLQSigned(result);\n\t aOutParam.rest = aIndex;\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\t\n\t/**\n\t * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n\t */\n\texports.encode = function (number) {\n\t if (0 <= number && number < intToCharMap.length) {\n\t return intToCharMap[number];\n\t }\n\t throw new TypeError(\"Must be between 0 and 63: \" + number);\n\t};\n\t\n\t/**\n\t * Decode a single base 64 character code digit to an integer. Returns -1 on\n\t * failure.\n\t */\n\texports.decode = function (charCode) {\n\t var bigA = 65; // 'A'\n\t var bigZ = 90; // 'Z'\n\t\n\t var littleA = 97; // 'a'\n\t var littleZ = 122; // 'z'\n\t\n\t var zero = 48; // '0'\n\t var nine = 57; // '9'\n\t\n\t var plus = 43; // '+'\n\t var slash = 47; // '/'\n\t\n\t var littleOffset = 26;\n\t var numberOffset = 52;\n\t\n\t // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\t if (bigA <= charCode && charCode <= bigZ) {\n\t return (charCode - bigA);\n\t }\n\t\n\t // 26 - 51: abcdefghijklmnopqrstuvwxyz\n\t if (littleA <= charCode && charCode <= littleZ) {\n\t return (charCode - littleA + littleOffset);\n\t }\n\t\n\t // 52 - 61: 0123456789\n\t if (zero <= charCode && charCode <= nine) {\n\t return (charCode - zero + numberOffset);\n\t }\n\t\n\t // 62: +\n\t if (charCode == plus) {\n\t return 62;\n\t }\n\t\n\t // 63: /\n\t if (charCode == slash) {\n\t return 63;\n\t }\n\t\n\t // Invalid base64 digit.\n\t return -1;\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t/**\n\t * This is a helper function for getting values from parameter/options\n\t * objects.\n\t *\n\t * @param args The object we are extracting values from\n\t * @param name The name of the property we are getting.\n\t * @param defaultValue An optional value to return if the property is missing\n\t * from the object. If this is not specified and the property is missing, an\n\t * error will be thrown.\n\t */\n\tfunction getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}\n\texports.getArg = getArg;\n\t\n\tvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\n\tvar dataUrlRegexp = /^data:.+\\,.+$/;\n\t\n\tfunction urlParse(aUrl) {\n\t var match = aUrl.match(urlRegexp);\n\t if (!match) {\n\t return null;\n\t }\n\t return {\n\t scheme: match[1],\n\t auth: match[2],\n\t host: match[3],\n\t port: match[4],\n\t path: match[5]\n\t };\n\t}\n\texports.urlParse = urlParse;\n\t\n\tfunction urlGenerate(aParsedUrl) {\n\t var url = '';\n\t if (aParsedUrl.scheme) {\n\t url += aParsedUrl.scheme + ':';\n\t }\n\t url += '//';\n\t if (aParsedUrl.auth) {\n\t url += aParsedUrl.auth + '@';\n\t }\n\t if (aParsedUrl.host) {\n\t url += aParsedUrl.host;\n\t }\n\t if (aParsedUrl.port) {\n\t url += \":\" + aParsedUrl.port\n\t }\n\t if (aParsedUrl.path) {\n\t url += aParsedUrl.path;\n\t }\n\t return url;\n\t}\n\texports.urlGenerate = urlGenerate;\n\t\n\t/**\n\t * Normalizes a path, or the path portion of a URL:\n\t *\n\t * - Replaces consecutive slashes with one slash.\n\t * - Removes unnecessary '.' parts.\n\t * - Removes unnecessary '/..' parts.\n\t *\n\t * Based on code in the Node.js 'path' core module.\n\t *\n\t * @param aPath The path or url to normalize.\n\t */\n\tfunction normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}\n\texports.normalize = normalize;\n\t\n\t/**\n\t * Joins two paths/URLs.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be joined with the root.\n\t *\n\t * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n\t * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n\t * first.\n\t * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n\t * is updated with the result and aRoot is returned. Otherwise the result\n\t * is returned.\n\t * - If aPath is absolute, the result is aPath.\n\t * - Otherwise the two paths are joined with a slash.\n\t * - Joining for example 'http://' and 'www.example.com' is also supported.\n\t */\n\tfunction join(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t if (aPath === \"\") {\n\t aPath = \".\";\n\t }\n\t var aPathUrl = urlParse(aPath);\n\t var aRootUrl = urlParse(aRoot);\n\t if (aRootUrl) {\n\t aRoot = aRootUrl.path || '/';\n\t }\n\t\n\t // `join(foo, '//www.example.org')`\n\t if (aPathUrl && !aPathUrl.scheme) {\n\t if (aRootUrl) {\n\t aPathUrl.scheme = aRootUrl.scheme;\n\t }\n\t return urlGenerate(aPathUrl);\n\t }\n\t\n\t if (aPathUrl || aPath.match(dataUrlRegexp)) {\n\t return aPath;\n\t }\n\t\n\t // `join('http://', 'www.example.com')`\n\t if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n\t aRootUrl.host = aPath;\n\t return urlGenerate(aRootUrl);\n\t }\n\t\n\t var joined = aPath.charAt(0) === '/'\n\t ? aPath\n\t : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\t\n\t if (aRootUrl) {\n\t aRootUrl.path = joined;\n\t return urlGenerate(aRootUrl);\n\t }\n\t return joined;\n\t}\n\texports.join = join;\n\t\n\texports.isAbsolute = function (aPath) {\n\t return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n\t};\n\t\n\t/**\n\t * Make a path relative to a URL or another path.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be made relative to aRoot.\n\t */\n\tfunction relative(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t\n\t aRoot = aRoot.replace(/\\/$/, '');\n\t\n\t // It is possible for the path to be above the root. In this case, simply\n\t // checking whether the root is a prefix of the path won't work. Instead, we\n\t // need to remove components from the root one by one, until either we find\n\t // a prefix that fits, or we run out of components to remove.\n\t var level = 0;\n\t while (aPath.indexOf(aRoot + '/') !== 0) {\n\t var index = aRoot.lastIndexOf(\"/\");\n\t if (index < 0) {\n\t return aPath;\n\t }\n\t\n\t // If the only part of the root that is left is the scheme (i.e. http://,\n\t // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n\t // have exhausted all components, so the path is not relative to the root.\n\t aRoot = aRoot.slice(0, index);\n\t if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n\t return aPath;\n\t }\n\t\n\t ++level;\n\t }\n\t\n\t // Make sure we add a \"../\" for each component we removed from the root.\n\t return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n\t}\n\texports.relative = relative;\n\t\n\tvar supportsNullProto = (function () {\n\t var obj = Object.create(null);\n\t return !('__proto__' in obj);\n\t}());\n\t\n\tfunction identity (s) {\n\t return s;\n\t}\n\t\n\t/**\n\t * Because behavior goes wacky when you set `__proto__` on objects, we\n\t * have to prefix all the strings in our set with an arbitrary character.\n\t *\n\t * See https://github.com/mozilla/source-map/pull/31 and\n\t * https://github.com/mozilla/source-map/issues/30\n\t *\n\t * @param String aStr\n\t */\n\tfunction toSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return '$' + aStr;\n\t }\n\t\n\t return aStr;\n\t}\n\texports.toSetString = supportsNullProto ? identity : toSetString;\n\t\n\tfunction fromSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return aStr.slice(1);\n\t }\n\t\n\t return aStr;\n\t}\n\texports.fromSetString = supportsNullProto ? identity : fromSetString;\n\t\n\tfunction isProtoString(s) {\n\t if (!s) {\n\t return false;\n\t }\n\t\n\t var length = s.length;\n\t\n\t if (length < 9 /* \"__proto__\".length */) {\n\t return false;\n\t }\n\t\n\t if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n\t s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n\t s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n\t s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 9) !== 95 /* '_' */) {\n\t return false;\n\t }\n\t\n\t for (var i = length - 10; i >= 0; i--) {\n\t if (s.charCodeAt(i) !== 36 /* '$' */) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings where the original positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same original source/line/column, but different generated\n\t * line and column the same. Useful when searching for a mapping with a\n\t * stubbed out mapping.\n\t */\n\tfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n\t var cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0 || onlyCompareOriginal) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByOriginalPositions = compareByOriginalPositions;\n\t\n\t/**\n\t * Comparator between two mappings with deflated source and name indices where\n\t * the generated positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same generated line and column, but different\n\t * source/name/original line and column the same. Useful when searching for a\n\t * mapping with a stubbed out mapping.\n\t */\n\tfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0 || onlyCompareGenerated) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\t\n\tfunction strcmp(aStr1, aStr2) {\n\t if (aStr1 === aStr2) {\n\t return 0;\n\t }\n\t\n\t if (aStr1 === null) {\n\t return 1; // aStr2 !== null\n\t }\n\t\n\t if (aStr2 === null) {\n\t return -1; // aStr1 !== null\n\t }\n\t\n\t if (aStr1 > aStr2) {\n\t return 1;\n\t }\n\t\n\t return -1;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings with inflated source and name strings where\n\t * the generated positions are compared.\n\t */\n\tfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\t\n\t/**\n\t * Strip any JSON XSSI avoidance prefix from the string (as documented\n\t * in the source maps specification), and then parse the string as\n\t * JSON.\n\t */\n\tfunction parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}\n\texports.parseSourceMapInput = parseSourceMapInput;\n\t\n\t/**\n\t * Compute the URL of a source given the the source root, the source's\n\t * URL, and the source map's URL.\n\t */\n\tfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n\t sourceURL = sourceURL || '';\n\t\n\t if (sourceRoot) {\n\t // This follows what Chrome does.\n\t if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n\t sourceRoot += '/';\n\t }\n\t // The spec says:\n\t // Line 4: An optional source root, useful for relocating source\n\t // files on a server or removing repeated values in the\n\t // “sources” entry. This value is prepended to the individual\n\t // entries in the “source” field.\n\t sourceURL = sourceRoot + sourceURL;\n\t }\n\t\n\t // Historically, SourceMapConsumer did not take the sourceMapURL as\n\t // a parameter. This mode is still somewhat supported, which is why\n\t // this code block is conditional. However, it's preferable to pass\n\t // the source map URL to SourceMapConsumer, so that this function\n\t // can implement the source URL resolution algorithm as outlined in\n\t // the spec. This block is basically the equivalent of:\n\t // new URL(sourceURL, sourceMapURL).toString()\n\t // ... except it avoids using URL, which wasn't available in the\n\t // older releases of node still supported by this library.\n\t //\n\t // The spec says:\n\t // If the sources are not absolute URLs after prepending of the\n\t // “sourceRoot”, the sources are resolved relative to the\n\t // SourceMap (like resolving script src in a html document).\n\t if (sourceMapURL) {\n\t var parsed = urlParse(sourceMapURL);\n\t if (!parsed) {\n\t throw new Error(\"sourceMapURL could not be parsed\");\n\t }\n\t if (parsed.path) {\n\t // Strip the last path component, but keep the \"/\".\n\t var index = parsed.path.lastIndexOf('/');\n\t if (index >= 0) {\n\t parsed.path = parsed.path.substring(0, index + 1);\n\t }\n\t }\n\t sourceURL = join(urlGenerate(parsed), sourceURL);\n\t }\n\t\n\t return normalize(sourceURL);\n\t}\n\texports.computeSourceURL = computeSourceURL;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar hasNativeMap = typeof Map !== \"undefined\";\n\t\n\t/**\n\t * A data structure which is a combination of an array and a set. Adding a new\n\t * member is O(1), testing for membership is O(1), and finding the index of an\n\t * element is O(1). Removing elements from the set is not supported. Only\n\t * strings are supported for membership.\n\t */\n\tfunction ArraySet() {\n\t this._array = [];\n\t this._set = hasNativeMap ? new Map() : Object.create(null);\n\t}\n\t\n\t/**\n\t * Static method for creating ArraySet instances from an existing array.\n\t */\n\tArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n\t var set = new ArraySet();\n\t for (var i = 0, len = aArray.length; i < len; i++) {\n\t set.add(aArray[i], aAllowDuplicates);\n\t }\n\t return set;\n\t};\n\t\n\t/**\n\t * Return how many unique items are in this ArraySet. If duplicates have been\n\t * added, than those do not count towards the size.\n\t *\n\t * @returns Number\n\t */\n\tArraySet.prototype.size = function ArraySet_size() {\n\t return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n\t};\n\t\n\t/**\n\t * Add the given string to this set.\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n\t var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n\t var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n\t var idx = this._array.length;\n\t if (!isDuplicate || aAllowDuplicates) {\n\t this._array.push(aStr);\n\t }\n\t if (!isDuplicate) {\n\t if (hasNativeMap) {\n\t this._set.set(aStr, idx);\n\t } else {\n\t this._set[sStr] = idx;\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Is the given string a member of this set?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.has = function ArraySet_has(aStr) {\n\t if (hasNativeMap) {\n\t return this._set.has(aStr);\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t return has.call(this._set, sStr);\n\t }\n\t};\n\t\n\t/**\n\t * What is the index of the given string in the array?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n\t if (hasNativeMap) {\n\t var idx = this._set.get(aStr);\n\t if (idx >= 0) {\n\t return idx;\n\t }\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t if (has.call(this._set, sStr)) {\n\t return this._set[sStr];\n\t }\n\t }\n\t\n\t throw new Error('\"' + aStr + '\" is not in the set.');\n\t};\n\t\n\t/**\n\t * What is the element at the given index?\n\t *\n\t * @param Number aIdx\n\t */\n\tArraySet.prototype.at = function ArraySet_at(aIdx) {\n\t if (aIdx >= 0 && aIdx < this._array.length) {\n\t return this._array[aIdx];\n\t }\n\t throw new Error('No element indexed by ' + aIdx);\n\t};\n\t\n\t/**\n\t * Returns the array representation of this set (which has the proper indices\n\t * indicated by indexOf). Note that this is a copy of the internal array used\n\t * for storing the members so that no one can mess with internal state.\n\t */\n\tArraySet.prototype.toArray = function ArraySet_toArray() {\n\t return this._array.slice();\n\t};\n\t\n\texports.ArraySet = ArraySet;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2014 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\t\n\t/**\n\t * Determine whether mappingB is after mappingA with respect to generated\n\t * position.\n\t */\n\tfunction generatedPositionAfter(mappingA, mappingB) {\n\t // Optimized for most common case\n\t var lineA = mappingA.generatedLine;\n\t var lineB = mappingB.generatedLine;\n\t var columnA = mappingA.generatedColumn;\n\t var columnB = mappingB.generatedColumn;\n\t return lineB > lineA || lineB == lineA && columnB >= columnA ||\n\t util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n\t}\n\t\n\t/**\n\t * A data structure to provide a sorted view of accumulated mappings in a\n\t * performance conscious manner. It trades a neglibable overhead in general\n\t * case for a large speedup in case of mappings being added in order.\n\t */\n\tfunction MappingList() {\n\t this._array = [];\n\t this._sorted = true;\n\t // Serves as infimum\n\t this._last = {generatedLine: -1, generatedColumn: 0};\n\t}\n\t\n\t/**\n\t * Iterate through internal items. This method takes the same arguments that\n\t * `Array.prototype.forEach` takes.\n\t *\n\t * NOTE: The order of the mappings is NOT guaranteed.\n\t */\n\tMappingList.prototype.unsortedForEach =\n\t function MappingList_forEach(aCallback, aThisArg) {\n\t this._array.forEach(aCallback, aThisArg);\n\t };\n\t\n\t/**\n\t * Add the given source mapping.\n\t *\n\t * @param Object aMapping\n\t */\n\tMappingList.prototype.add = function MappingList_add(aMapping) {\n\t if (generatedPositionAfter(this._last, aMapping)) {\n\t this._last = aMapping;\n\t this._array.push(aMapping);\n\t } else {\n\t this._sorted = false;\n\t this._array.push(aMapping);\n\t }\n\t};\n\t\n\t/**\n\t * Returns the flat, sorted array of mappings. The mappings are sorted by\n\t * generated position.\n\t *\n\t * WARNING: This method returns internal data without copying, for\n\t * performance. The return value must NOT be mutated, and should be treated as\n\t * an immutable borrow. If you want to take ownership, you must make your own\n\t * copy.\n\t */\n\tMappingList.prototype.toArray = function MappingList_toArray() {\n\t if (!this._sorted) {\n\t this._array.sort(util.compareByGeneratedPositionsInflated);\n\t this._sorted = true;\n\t }\n\t return this._array;\n\t};\n\t\n\texports.MappingList = MappingList;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar binarySearch = __webpack_require__(8);\n\tvar ArraySet = __webpack_require__(5).ArraySet;\n\tvar base64VLQ = __webpack_require__(2);\n\tvar quickSort = __webpack_require__(9).quickSort;\n\t\n\tfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t return sourceMap.sections != null\n\t ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n\t : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n\t}\n\t\n\tSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n\t return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n\t}\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tSourceMapConsumer.prototype._version = 3;\n\t\n\t// `__generatedMappings` and `__originalMappings` are arrays that hold the\n\t// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n\t// are lazily instantiated, accessed via the `_generatedMappings` and\n\t// `_originalMappings` getters respectively, and we only parse the mappings\n\t// and create these arrays once queried for a source location. We jump through\n\t// these hoops because there can be many thousands of mappings, and parsing\n\t// them is expensive, so we only want to do it if we must.\n\t//\n\t// Each object in the arrays is of the form:\n\t//\n\t// {\n\t// generatedLine: The line number in the generated code,\n\t// generatedColumn: The column number in the generated code,\n\t// source: The path to the original source file that generated this\n\t// chunk of code,\n\t// originalLine: The line number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// originalColumn: The column number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// name: The name of the original symbol which generated this chunk of\n\t// code.\n\t// }\n\t//\n\t// All properties except for `generatedLine` and `generatedColumn` can be\n\t// `null`.\n\t//\n\t// `_generatedMappings` is ordered by the generated positions.\n\t//\n\t// `_originalMappings` is ordered by the original positions.\n\t\n\tSourceMapConsumer.prototype.__generatedMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__generatedMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__generatedMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype.__originalMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__originalMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__originalMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype._charIsMappingSeparator =\n\t function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n\t var c = aStr.charAt(index);\n\t return c === \";\" || c === \",\";\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t throw new Error(\"Subclasses must implement _parseMappings\");\n\t };\n\t\n\tSourceMapConsumer.GENERATED_ORDER = 1;\n\tSourceMapConsumer.ORIGINAL_ORDER = 2;\n\t\n\tSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\n\tSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Iterate over each mapping between an original source/line/column and a\n\t * generated line/column in this source map.\n\t *\n\t * @param Function aCallback\n\t * The function that is called with each mapping.\n\t * @param Object aContext\n\t * Optional. If specified, this object will be the value of `this` every\n\t * time that `aCallback` is called.\n\t * @param aOrder\n\t * Either `SourceMapConsumer.GENERATED_ORDER` or\n\t * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n\t * iterate over the mappings sorted by the generated file's line/column\n\t * order or the original's source/line/column order, respectively. Defaults to\n\t * `SourceMapConsumer.GENERATED_ORDER`.\n\t */\n\tSourceMapConsumer.prototype.eachMapping =\n\t function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n\t var context = aContext || null;\n\t var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\t\n\t var mappings;\n\t switch (order) {\n\t case SourceMapConsumer.GENERATED_ORDER:\n\t mappings = this._generatedMappings;\n\t break;\n\t case SourceMapConsumer.ORIGINAL_ORDER:\n\t mappings = this._originalMappings;\n\t break;\n\t default:\n\t throw new Error(\"Unknown order of iteration.\");\n\t }\n\t\n\t var sourceRoot = this.sourceRoot;\n\t mappings.map(function (mapping) {\n\t var source = mapping.source === null ? null : this._sources.at(mapping.source);\n\t source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n\t return {\n\t source: source,\n\t generatedLine: mapping.generatedLine,\n\t generatedColumn: mapping.generatedColumn,\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: mapping.name === null ? null : this._names.at(mapping.name)\n\t };\n\t }, this).forEach(aCallback, context);\n\t };\n\t\n\t/**\n\t * Returns all generated line and column information for the original source,\n\t * line, and column provided. If no column is provided, returns all mappings\n\t * corresponding to a either the line we are searching for or the next\n\t * closest line that has any mappings. Otherwise, returns all mappings\n\t * corresponding to the given line and either the column we are searching for\n\t * or the next closest column that has any offsets.\n\t *\n\t * The only argument is an object with the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number is 1-based.\n\t * - column: Optional. the column number in the original source.\n\t * The column number is 0-based.\n\t *\n\t * and an array of objects is returned, each with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tSourceMapConsumer.prototype.allGeneratedPositionsFor =\n\t function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n\t var line = util.getArg(aArgs, 'line');\n\t\n\t // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n\t // returns the index of the closest mapping less than the needle. By\n\t // setting needle.originalColumn to 0, we thus find the last mapping for\n\t // the given line, provided such a mapping exists.\n\t var needle = {\n\t source: util.getArg(aArgs, 'source'),\n\t originalLine: line,\n\t originalColumn: util.getArg(aArgs, 'column', 0)\n\t };\n\t\n\t needle.source = this._findSourceIndex(needle.source);\n\t if (needle.source < 0) {\n\t return [];\n\t }\n\t\n\t var mappings = [];\n\t\n\t var index = this._findMapping(needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t binarySearch.LEAST_UPPER_BOUND);\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (aArgs.column === undefined) {\n\t var originalLine = mapping.originalLine;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we found. Since\n\t // mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we found.\n\t while (mapping && mapping.originalLine === originalLine) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t } else {\n\t var originalColumn = mapping.originalColumn;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we were searching for.\n\t // Since mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we are searching for.\n\t while (mapping &&\n\t mapping.originalLine === line &&\n\t mapping.originalColumn == originalColumn) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t }\n\t }\n\t\n\t return mappings;\n\t };\n\t\n\texports.SourceMapConsumer = SourceMapConsumer;\n\t\n\t/**\n\t * A BasicSourceMapConsumer instance represents a parsed source map which we can\n\t * query for information about the original file positions by giving it a file\n\t * position in the generated source.\n\t *\n\t * The first parameter is the raw source map (either as a JSON string, or\n\t * already parsed to an object). According to the spec, source maps have the\n\t * following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - sources: An array of URLs to the original source files.\n\t * - names: An array of identifiers which can be referrenced by individual mappings.\n\t * - sourceRoot: Optional. The URL root from which all sources are relative.\n\t * - sourcesContent: Optional. An array of contents of the original source files.\n\t * - mappings: A string of base64 VLQs which contain the actual mappings.\n\t * - file: Optional. The generated file this source map is associated with.\n\t *\n\t * Here is an example source map, taken from the source map spec[0]:\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"out.js\",\n\t * sourceRoot : \"\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AA,AB;;ABCDE;\"\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n\t */\n\tfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sources = util.getArg(sourceMap, 'sources');\n\t // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n\t // requires the array) to play nice here.\n\t var names = util.getArg(sourceMap, 'names', []);\n\t var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n\t var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n\t var mappings = util.getArg(sourceMap, 'mappings');\n\t var file = util.getArg(sourceMap, 'file', null);\n\t\n\t // Once again, Sass deviates from the spec and supplies the version as a\n\t // string rather than a number, so we use loose equality checking here.\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t if (sourceRoot) {\n\t sourceRoot = util.normalize(sourceRoot);\n\t }\n\t\n\t sources = sources\n\t .map(String)\n\t // Some source maps produce relative source paths like \"./foo.js\" instead of\n\t // \"foo.js\". Normalize these first so that future comparisons will succeed.\n\t // See bugzil.la/1090768.\n\t .map(util.normalize)\n\t // Always ensure that absolute sources are internally stored relative to\n\t // the source root, if the source root is absolute. Not doing this would\n\t // be particularly problematic when the source root is a prefix of the\n\t // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n\t .map(function (source) {\n\t return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n\t ? util.relative(sourceRoot, source)\n\t : source;\n\t });\n\t\n\t // Pass `true` below to allow duplicate names and sources. While source maps\n\t // are intended to be compressed and deduplicated, the TypeScript compiler\n\t // sometimes generates source maps with duplicates in them. See Github issue\n\t // #72 and bugzil.la/889492.\n\t this._names = ArraySet.fromArray(names.map(String), true);\n\t this._sources = ArraySet.fromArray(sources, true);\n\t\n\t this._absoluteSources = this._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t this.sourceRoot = sourceRoot;\n\t this.sourcesContent = sourcesContent;\n\t this._mappings = mappings;\n\t this._sourceMapURL = aSourceMapURL;\n\t this.file = file;\n\t}\n\t\n\tBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\t\n\t/**\n\t * Utility function to find the index of a source. Returns -1 if not\n\t * found.\n\t */\n\tBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t if (this._sources.has(relativeSource)) {\n\t return this._sources.indexOf(relativeSource);\n\t }\n\t\n\t // Maybe aSource is an absolute URL as returned by |sources|. In\n\t // this case we can't simply undo the transform.\n\t var i;\n\t for (i = 0; i < this._absoluteSources.length; ++i) {\n\t if (this._absoluteSources[i] == aSource) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t};\n\t\n\t/**\n\t * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n\t *\n\t * @param SourceMapGenerator aSourceMap\n\t * The source map that will be consumed.\n\t * @param String aSourceMapURL\n\t * The URL at which the source map can be found (optional)\n\t * @returns BasicSourceMapConsumer\n\t */\n\tBasicSourceMapConsumer.fromSourceMap =\n\t function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n\t var smc = Object.create(BasicSourceMapConsumer.prototype);\n\t\n\t var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n\t var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n\t smc.sourceRoot = aSourceMap._sourceRoot;\n\t smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n\t smc.sourceRoot);\n\t smc.file = aSourceMap._file;\n\t smc._sourceMapURL = aSourceMapURL;\n\t smc._absoluteSources = smc._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t // Because we are modifying the entries (by converting string sources and\n\t // names to indices into the sources and names ArraySets), we have to make\n\t // a copy of the entry or else bad things happen. Shared mutable state\n\t // strikes again! See github issue #191.\n\t\n\t var generatedMappings = aSourceMap._mappings.toArray().slice();\n\t var destGeneratedMappings = smc.__generatedMappings = [];\n\t var destOriginalMappings = smc.__originalMappings = [];\n\t\n\t for (var i = 0, length = generatedMappings.length; i < length; i++) {\n\t var srcMapping = generatedMappings[i];\n\t var destMapping = new Mapping;\n\t destMapping.generatedLine = srcMapping.generatedLine;\n\t destMapping.generatedColumn = srcMapping.generatedColumn;\n\t\n\t if (srcMapping.source) {\n\t destMapping.source = sources.indexOf(srcMapping.source);\n\t destMapping.originalLine = srcMapping.originalLine;\n\t destMapping.originalColumn = srcMapping.originalColumn;\n\t\n\t if (srcMapping.name) {\n\t destMapping.name = names.indexOf(srcMapping.name);\n\t }\n\t\n\t destOriginalMappings.push(destMapping);\n\t }\n\t\n\t destGeneratedMappings.push(destMapping);\n\t }\n\t\n\t quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\t\n\t return smc;\n\t };\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tBasicSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t return this._absoluteSources.slice();\n\t }\n\t});\n\t\n\t/**\n\t * Provide the JIT with a nice shape / hidden class.\n\t */\n\tfunction Mapping() {\n\t this.generatedLine = 0;\n\t this.generatedColumn = 0;\n\t this.source = null;\n\t this.originalLine = null;\n\t this.originalColumn = null;\n\t this.name = null;\n\t}\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tBasicSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t var generatedLine = 1;\n\t var previousGeneratedColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousOriginalColumn = 0;\n\t var previousSource = 0;\n\t var previousName = 0;\n\t var length = aStr.length;\n\t var index = 0;\n\t var cachedSegments = {};\n\t var temp = {};\n\t var originalMappings = [];\n\t var generatedMappings = [];\n\t var mapping, str, segment, end, value;\n\t\n\t while (index < length) {\n\t if (aStr.charAt(index) === ';') {\n\t generatedLine++;\n\t index++;\n\t previousGeneratedColumn = 0;\n\t }\n\t else if (aStr.charAt(index) === ',') {\n\t index++;\n\t }\n\t else {\n\t mapping = new Mapping();\n\t mapping.generatedLine = generatedLine;\n\t\n\t // Because each offset is encoded relative to the previous one,\n\t // many segments often have the same encoding. We can exploit this\n\t // fact by caching the parsed variable length fields of each segment,\n\t // allowing us to avoid a second parse if we encounter the same\n\t // segment again.\n\t for (end = index; end < length; end++) {\n\t if (this._charIsMappingSeparator(aStr, end)) {\n\t break;\n\t }\n\t }\n\t str = aStr.slice(index, end);\n\t\n\t segment = cachedSegments[str];\n\t if (segment) {\n\t index += str.length;\n\t } else {\n\t segment = [];\n\t while (index < end) {\n\t base64VLQ.decode(aStr, index, temp);\n\t value = temp.value;\n\t index = temp.rest;\n\t segment.push(value);\n\t }\n\t\n\t if (segment.length === 2) {\n\t throw new Error('Found a source, but no line and column');\n\t }\n\t\n\t if (segment.length === 3) {\n\t throw new Error('Found a source and line, but no column');\n\t }\n\t\n\t cachedSegments[str] = segment;\n\t }\n\t\n\t // Generated column.\n\t mapping.generatedColumn = previousGeneratedColumn + segment[0];\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (segment.length > 1) {\n\t // Original source.\n\t mapping.source = previousSource + segment[1];\n\t previousSource += segment[1];\n\t\n\t // Original line.\n\t mapping.originalLine = previousOriginalLine + segment[2];\n\t previousOriginalLine = mapping.originalLine;\n\t // Lines are stored 0-based\n\t mapping.originalLine += 1;\n\t\n\t // Original column.\n\t mapping.originalColumn = previousOriginalColumn + segment[3];\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (segment.length > 4) {\n\t // Original name.\n\t mapping.name = previousName + segment[4];\n\t previousName += segment[4];\n\t }\n\t }\n\t\n\t generatedMappings.push(mapping);\n\t if (typeof mapping.originalLine === 'number') {\n\t originalMappings.push(mapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t this.__generatedMappings = generatedMappings;\n\t\n\t quickSort(originalMappings, util.compareByOriginalPositions);\n\t this.__originalMappings = originalMappings;\n\t };\n\t\n\t/**\n\t * Find the mapping that best matches the hypothetical \"needle\" mapping that\n\t * we are searching for in the given \"haystack\" of mappings.\n\t */\n\tBasicSourceMapConsumer.prototype._findMapping =\n\t function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n\t aColumnName, aComparator, aBias) {\n\t // To return the position we are searching for, we must first find the\n\t // mapping for the given position and then return the opposite position it\n\t // points to. Because the mappings are sorted, we can use binary search to\n\t // find the best mapping.\n\t\n\t if (aNeedle[aLineName] <= 0) {\n\t throw new TypeError('Line must be greater than or equal to 1, got '\n\t + aNeedle[aLineName]);\n\t }\n\t if (aNeedle[aColumnName] < 0) {\n\t throw new TypeError('Column must be greater than or equal to 0, got '\n\t + aNeedle[aColumnName]);\n\t }\n\t\n\t return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n\t };\n\t\n\t/**\n\t * Compute the last column for each generated mapping. The last column is\n\t * inclusive.\n\t */\n\tBasicSourceMapConsumer.prototype.computeColumnSpans =\n\t function SourceMapConsumer_computeColumnSpans() {\n\t for (var index = 0; index < this._generatedMappings.length; ++index) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t // Mappings do not contain a field for the last generated columnt. We\n\t // can come up with an optimistic estimate, however, by assuming that\n\t // mappings are contiguous (i.e. given two consecutive mappings, the\n\t // first mapping ends where the second one starts).\n\t if (index + 1 < this._generatedMappings.length) {\n\t var nextMapping = this._generatedMappings[index + 1];\n\t\n\t if (mapping.generatedLine === nextMapping.generatedLine) {\n\t mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n\t continue;\n\t }\n\t }\n\t\n\t // The last mapping for each line spans the entire line.\n\t mapping.lastGeneratedColumn = Infinity;\n\t }\n\t };\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tBasicSourceMapConsumer.prototype.originalPositionFor =\n\t function SourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._generatedMappings,\n\t \"generatedLine\",\n\t \"generatedColumn\",\n\t util.compareByGeneratedPositionsDeflated,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t if (mapping.generatedLine === needle.generatedLine) {\n\t var source = util.getArg(mapping, 'source', null);\n\t if (source !== null) {\n\t source = this._sources.at(source);\n\t source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n\t }\n\t var name = util.getArg(mapping, 'name', null);\n\t if (name !== null) {\n\t name = this._names.at(name);\n\t }\n\t return {\n\t source: source,\n\t line: util.getArg(mapping, 'originalLine', null),\n\t column: util.getArg(mapping, 'originalColumn', null),\n\t name: name\n\t };\n\t }\n\t }\n\t\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function BasicSourceMapConsumer_hasContentsOfAllSources() {\n\t if (!this.sourcesContent) {\n\t return false;\n\t }\n\t return this.sourcesContent.length >= this._sources.size() &&\n\t !this.sourcesContent.some(function (sc) { return sc == null; });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tBasicSourceMapConsumer.prototype.sourceContentFor =\n\t function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t if (!this.sourcesContent) {\n\t return null;\n\t }\n\t\n\t var index = this._findSourceIndex(aSource);\n\t if (index >= 0) {\n\t return this.sourcesContent[index];\n\t }\n\t\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t var url;\n\t if (this.sourceRoot != null\n\t && (url = util.urlParse(this.sourceRoot))) {\n\t // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n\t // many users. We can help them out when they expect file:// URIs to\n\t // behave like it would if they were running a local HTTP server. See\n\t // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n\t var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n\t if (url.scheme == \"file\"\n\t && this._sources.has(fileUriAbsPath)) {\n\t return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n\t }\n\t\n\t if ((!url.path || url.path == \"/\")\n\t && this._sources.has(\"/\" + relativeSource)) {\n\t return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n\t }\n\t }\n\t\n\t // This function is used recursively from\n\t // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n\t // don't want to throw if we can't find the source - we just want to\n\t // return null, so we provide a flag to exit gracefully.\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tBasicSourceMapConsumer.prototype.generatedPositionFor =\n\t function SourceMapConsumer_generatedPositionFor(aArgs) {\n\t var source = util.getArg(aArgs, 'source');\n\t source = this._findSourceIndex(source);\n\t if (source < 0) {\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t }\n\t\n\t var needle = {\n\t source: source,\n\t originalLine: util.getArg(aArgs, 'line'),\n\t originalColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (mapping.source === needle.source) {\n\t return {\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t };\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t };\n\t\n\texports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\t\n\t/**\n\t * An IndexedSourceMapConsumer instance represents a parsed source map which\n\t * we can query for information. It differs from BasicSourceMapConsumer in\n\t * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n\t * input.\n\t *\n\t * The first parameter is a raw source map (either as a JSON string, or already\n\t * parsed to an object). According to the spec for indexed source maps, they\n\t * have the following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - file: Optional. The generated file this source map is associated with.\n\t * - sections: A list of section definitions.\n\t *\n\t * Each value under the \"sections\" field has two fields:\n\t * - offset: The offset into the original specified at which this section\n\t * begins to apply, defined as an object with a \"line\" and \"column\"\n\t * field.\n\t * - map: A source map definition. This source map could also be indexed,\n\t * but doesn't have to be.\n\t *\n\t * Instead of the \"map\" field, it's also possible to have a \"url\" field\n\t * specifying a URL to retrieve a source map from, but that's currently\n\t * unsupported.\n\t *\n\t * Here's an example source map, taken from the source map spec[0], but\n\t * modified to omit a section which uses the \"url\" field.\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"app.js\",\n\t * sections: [{\n\t * offset: {line:100, column:10},\n\t * map: {\n\t * version : 3,\n\t * file: \"section.js\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AAAA,E;;ABCDE;\"\n\t * }\n\t * }],\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n\t */\n\tfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sections = util.getArg(sourceMap, 'sections');\n\t\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t this._sources = new ArraySet();\n\t this._names = new ArraySet();\n\t\n\t var lastOffset = {\n\t line: -1,\n\t column: 0\n\t };\n\t this._sections = sections.map(function (s) {\n\t if (s.url) {\n\t // The url field will require support for asynchronicity.\n\t // See https://github.com/mozilla/source-map/issues/16\n\t throw new Error('Support for url field in sections not implemented.');\n\t }\n\t var offset = util.getArg(s, 'offset');\n\t var offsetLine = util.getArg(offset, 'line');\n\t var offsetColumn = util.getArg(offset, 'column');\n\t\n\t if (offsetLine < lastOffset.line ||\n\t (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n\t throw new Error('Section offsets must be ordered and non-overlapping.');\n\t }\n\t lastOffset = offset;\n\t\n\t return {\n\t generatedOffset: {\n\t // The offset fields are 0-based, but we use 1-based indices when\n\t // encoding/decoding from VLQ.\n\t generatedLine: offsetLine + 1,\n\t generatedColumn: offsetColumn + 1\n\t },\n\t consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n\t }\n\t });\n\t}\n\t\n\tIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tIndexedSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t var sources = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n\t sources.push(this._sections[i].consumer.sources[j]);\n\t }\n\t }\n\t return sources;\n\t }\n\t});\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tIndexedSourceMapConsumer.prototype.originalPositionFor =\n\t function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t // Find the section containing the generated position we're trying to map\n\t // to an original position.\n\t var sectionIndex = binarySearch.search(needle, this._sections,\n\t function(needle, section) {\n\t var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n\t if (cmp) {\n\t return cmp;\n\t }\n\t\n\t return (needle.generatedColumn -\n\t section.generatedOffset.generatedColumn);\n\t });\n\t var section = this._sections[sectionIndex];\n\t\n\t if (!section) {\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t }\n\t\n\t return section.consumer.originalPositionFor({\n\t line: needle.generatedLine -\n\t (section.generatedOffset.generatedLine - 1),\n\t column: needle.generatedColumn -\n\t (section.generatedOffset.generatedLine === needle.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t bias: aArgs.bias\n\t });\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n\t return this._sections.every(function (s) {\n\t return s.consumer.hasContentsOfAllSources();\n\t });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tIndexedSourceMapConsumer.prototype.sourceContentFor =\n\t function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t var content = section.consumer.sourceContentFor(aSource, true);\n\t if (content) {\n\t return content;\n\t }\n\t }\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based. \n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tIndexedSourceMapConsumer.prototype.generatedPositionFor =\n\t function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t // Only consider this section if the requested source is in the list of\n\t // sources of the consumer.\n\t if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n\t continue;\n\t }\n\t var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n\t if (generatedPosition) {\n\t var ret = {\n\t line: generatedPosition.line +\n\t (section.generatedOffset.generatedLine - 1),\n\t column: generatedPosition.column +\n\t (section.generatedOffset.generatedLine === generatedPosition.line\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0)\n\t };\n\t return ret;\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null\n\t };\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tIndexedSourceMapConsumer.prototype._parseMappings =\n\t function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t this.__generatedMappings = [];\n\t this.__originalMappings = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t var sectionMappings = section.consumer._generatedMappings;\n\t for (var j = 0; j < sectionMappings.length; j++) {\n\t var mapping = sectionMappings[j];\n\t\n\t var source = section.consumer._sources.at(mapping.source);\n\t source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n\t this._sources.add(source);\n\t source = this._sources.indexOf(source);\n\t\n\t var name = null;\n\t if (mapping.name) {\n\t name = section.consumer._names.at(mapping.name);\n\t this._names.add(name);\n\t name = this._names.indexOf(name);\n\t }\n\t\n\t // The mappings coming from the consumer for the section have\n\t // generated positions relative to the start of the section, so we\n\t // need to offset them to be relative to the start of the concatenated\n\t // generated file.\n\t var adjustedMapping = {\n\t source: source,\n\t generatedLine: mapping.generatedLine +\n\t (section.generatedOffset.generatedLine - 1),\n\t generatedColumn: mapping.generatedColumn +\n\t (section.generatedOffset.generatedLine === mapping.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: name\n\t };\n\t\n\t this.__generatedMappings.push(adjustedMapping);\n\t if (typeof adjustedMapping.originalLine === 'number') {\n\t this.__originalMappings.push(adjustedMapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t quickSort(this.__originalMappings, util.compareByOriginalPositions);\n\t };\n\t\n\texports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\texports.GREATEST_LOWER_BOUND = 1;\n\texports.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Recursive implementation of binary search.\n\t *\n\t * @param aLow Indices here and lower do not contain the needle.\n\t * @param aHigh Indices here and higher do not contain the needle.\n\t * @param aNeedle The element being searched for.\n\t * @param aHaystack The non-empty array being searched.\n\t * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t */\n\tfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n\t // This function terminates when one of the following is true:\n\t //\n\t // 1. We find the exact element we are looking for.\n\t //\n\t // 2. We did not find the exact element, but we can return the index of\n\t // the next-closest element.\n\t //\n\t // 3. We did not find the exact element, and there is no next-closest\n\t // element than the one we are searching for, so we return -1.\n\t var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n\t var cmp = aCompare(aNeedle, aHaystack[mid], true);\n\t if (cmp === 0) {\n\t // Found the element we are looking for.\n\t return mid;\n\t }\n\t else if (cmp > 0) {\n\t // Our needle is greater than aHaystack[mid].\n\t if (aHigh - mid > 1) {\n\t // The element is in the upper half.\n\t return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // The exact needle element was not found in this haystack. Determine if\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return aHigh < aHaystack.length ? aHigh : -1;\n\t } else {\n\t return mid;\n\t }\n\t }\n\t else {\n\t // Our needle is less than aHaystack[mid].\n\t if (mid - aLow > 1) {\n\t // The element is in the lower half.\n\t return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return mid;\n\t } else {\n\t return aLow < 0 ? -1 : aLow;\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * This is an implementation of binary search which will always try and return\n\t * the index of the closest element if there is no exact hit. This is because\n\t * mappings between original and generated line/col pairs are single points,\n\t * and there is an implicit region between each of them, so a miss just means\n\t * that you aren't on the very start of a region.\n\t *\n\t * @param aNeedle The element you are looking for.\n\t * @param aHaystack The array that is being searched.\n\t * @param aCompare A function which takes the needle and an element in the\n\t * array and returns -1, 0, or 1 depending on whether the needle is less\n\t * than, equal to, or greater than the element, respectively.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n\t */\n\texports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n\t if (aHaystack.length === 0) {\n\t return -1;\n\t }\n\t\n\t var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n\t aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n\t if (index < 0) {\n\t return -1;\n\t }\n\t\n\t // We have found either the exact element, or the next-closest element than\n\t // the one we are searching for. However, there may be more than one such\n\t // element. Make sure we always return the smallest of these.\n\t while (index - 1 >= 0) {\n\t if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n\t break;\n\t }\n\t --index;\n\t }\n\t\n\t return index;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t// It turns out that some (most?) JavaScript engines don't self-host\n\t// `Array.prototype.sort`. This makes sense because C++ will likely remain\n\t// faster than JS when doing raw CPU-intensive sorting. However, when using a\n\t// custom comparator function, calling back and forth between the VM's C++ and\n\t// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n\t// worse generated code for the comparator function than would be optimal. In\n\t// fact, when sorting with a comparator, these costs outweigh the benefits of\n\t// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n\t// a ~3500ms mean speed-up in `bench/bench.html`.\n\t\n\t/**\n\t * Swap the elements indexed by `x` and `y` in the array `ary`.\n\t *\n\t * @param {Array} ary\n\t * The array.\n\t * @param {Number} x\n\t * The index of the first item.\n\t * @param {Number} y\n\t * The index of the second item.\n\t */\n\tfunction swap(ary, x, y) {\n\t var temp = ary[x];\n\t ary[x] = ary[y];\n\t ary[y] = temp;\n\t}\n\t\n\t/**\n\t * Returns a random integer within the range `low .. high` inclusive.\n\t *\n\t * @param {Number} low\n\t * The lower bound on the range.\n\t * @param {Number} high\n\t * The upper bound on the range.\n\t */\n\tfunction randomIntInRange(low, high) {\n\t return Math.round(low + (Math.random() * (high - low)));\n\t}\n\t\n\t/**\n\t * The Quick Sort algorithm.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t * @param {Number} p\n\t * Start index of the array\n\t * @param {Number} r\n\t * End index of the array\n\t */\n\tfunction doQuickSort(ary, comparator, p, r) {\n\t // If our lower bound is less than our upper bound, we (1) partition the\n\t // array into two pieces and (2) recurse on each half. If it is not, this is\n\t // the empty array and our base case.\n\t\n\t if (p < r) {\n\t // (1) Partitioning.\n\t //\n\t // The partitioning chooses a pivot between `p` and `r` and moves all\n\t // elements that are less than or equal to the pivot to the before it, and\n\t // all the elements that are greater than it after it. The effect is that\n\t // once partition is done, the pivot is in the exact place it will be when\n\t // the array is put in sorted order, and it will not need to be moved\n\t // again. This runs in O(n) time.\n\t\n\t // Always choose a random pivot so that an input array which is reverse\n\t // sorted does not cause O(n^2) running time.\n\t var pivotIndex = randomIntInRange(p, r);\n\t var i = p - 1;\n\t\n\t swap(ary, pivotIndex, r);\n\t var pivot = ary[r];\n\t\n\t // Immediately after `j` is incremented in this loop, the following hold\n\t // true:\n\t //\n\t // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n\t //\n\t // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n\t for (var j = p; j < r; j++) {\n\t if (comparator(ary[j], pivot) <= 0) {\n\t i += 1;\n\t swap(ary, i, j);\n\t }\n\t }\n\t\n\t swap(ary, i + 1, j);\n\t var q = i + 1;\n\t\n\t // (2) Recurse on each half.\n\t\n\t doQuickSort(ary, comparator, p, q - 1);\n\t doQuickSort(ary, comparator, q + 1, r);\n\t }\n\t}\n\t\n\t/**\n\t * Sort the given array in-place with the given comparator function.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t */\n\texports.quickSort = function (ary, comparator) {\n\t doQuickSort(ary, comparator, 0, ary.length - 1);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;\n\tvar util = __webpack_require__(4);\n\t\n\t// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n\t// operating systems these days (capturing the result).\n\tvar REGEX_NEWLINE = /(\\r?\\n)/;\n\t\n\t// Newline character code for charCodeAt() comparisons\n\tvar NEWLINE_CODE = 10;\n\t\n\t// Private symbol for identifying `SourceNode`s when multiple versions of\n\t// the source-map library are loaded. This MUST NOT CHANGE across\n\t// versions!\n\tvar isSourceNode = \"$$$isSourceNode$$$\";\n\t\n\t/**\n\t * SourceNodes provide a way to abstract over interpolating/concatenating\n\t * snippets of generated JavaScript source code while maintaining the line and\n\t * column information associated with the original source code.\n\t *\n\t * @param aLine The original line number.\n\t * @param aColumn The original column number.\n\t * @param aSource The original source's filename.\n\t * @param aChunks Optional. An array of strings which are snippets of\n\t * generated JS, or other SourceNodes.\n\t * @param aName The original identifier.\n\t */\n\tfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n\t this.children = [];\n\t this.sourceContents = {};\n\t this.line = aLine == null ? null : aLine;\n\t this.column = aColumn == null ? null : aColumn;\n\t this.source = aSource == null ? null : aSource;\n\t this.name = aName == null ? null : aName;\n\t this[isSourceNode] = true;\n\t if (aChunks != null) this.add(aChunks);\n\t}\n\t\n\t/**\n\t * Creates a SourceNode from generated code and a SourceMapConsumer.\n\t *\n\t * @param aGeneratedCode The generated code\n\t * @param aSourceMapConsumer The SourceMap for the generated code\n\t * @param aRelativePath Optional. The path that relative sources in the\n\t * SourceMapConsumer should be relative to.\n\t */\n\tSourceNode.fromStringWithSourceMap =\n\t function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n\t // The SourceNode we want to fill with the generated code\n\t // and the SourceMap\n\t var node = new SourceNode();\n\t\n\t // All even indices of this array are one line of the generated code,\n\t // while all odd indices are the newlines between two adjacent lines\n\t // (since `REGEX_NEWLINE` captures its match).\n\t // Processed fragments are accessed by calling `shiftNextLine`.\n\t var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n\t var remainingLinesIndex = 0;\n\t var shiftNextLine = function() {\n\t var lineContents = getNextLine();\n\t // The last line of a file might not have a newline.\n\t var newLine = getNextLine() || \"\";\n\t return lineContents + newLine;\n\t\n\t function getNextLine() {\n\t return remainingLinesIndex < remainingLines.length ?\n\t remainingLines[remainingLinesIndex++] : undefined;\n\t }\n\t };\n\t\n\t // We need to remember the position of \"remainingLines\"\n\t var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\t\n\t // The generate SourceNodes we need a code range.\n\t // To extract it current and last mapping is used.\n\t // Here we store the last mapping.\n\t var lastMapping = null;\n\t\n\t aSourceMapConsumer.eachMapping(function (mapping) {\n\t if (lastMapping !== null) {\n\t // We add the code from \"lastMapping\" to \"mapping\":\n\t // First check if there is a new line in between.\n\t if (lastGeneratedLine < mapping.generatedLine) {\n\t // Associate first line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t lastGeneratedLine++;\n\t lastGeneratedColumn = 0;\n\t // The remaining code is added without mapping\n\t } else {\n\t // There is no new line in between.\n\t // Associate the code between \"lastGeneratedColumn\" and\n\t // \"mapping.generatedColumn\" with \"lastMapping\"\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t var code = nextLine.substr(0, mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t addMappingWithCode(lastMapping, code);\n\t // No more remaining code, continue\n\t lastMapping = mapping;\n\t return;\n\t }\n\t }\n\t // We add the generated code until the first mapping\n\t // to the SourceNode without any mapping.\n\t // Each line is added as separate string.\n\t while (lastGeneratedLine < mapping.generatedLine) {\n\t node.add(shiftNextLine());\n\t lastGeneratedLine++;\n\t }\n\t if (lastGeneratedColumn < mapping.generatedColumn) {\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t node.add(nextLine.substr(0, mapping.generatedColumn));\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t }\n\t lastMapping = mapping;\n\t }, this);\n\t // We have processed all mappings.\n\t if (remainingLinesIndex < remainingLines.length) {\n\t if (lastMapping) {\n\t // Associate the remaining code in the current line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t }\n\t // and add the remaining lines without any mapping\n\t node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n\t }\n\t\n\t // Copy sourcesContent into SourceNode\n\t aSourceMapConsumer.sources.forEach(function (sourceFile) {\n\t var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\t if (content != null) {\n\t if (aRelativePath != null) {\n\t sourceFile = util.join(aRelativePath, sourceFile);\n\t }\n\t node.setSourceContent(sourceFile, content);\n\t }\n\t });\n\t\n\t return node;\n\t\n\t function addMappingWithCode(mapping, code) {\n\t if (mapping === null || mapping.source === undefined) {\n\t node.add(code);\n\t } else {\n\t var source = aRelativePath\n\t ? util.join(aRelativePath, mapping.source)\n\t : mapping.source;\n\t node.add(new SourceNode(mapping.originalLine,\n\t mapping.originalColumn,\n\t source,\n\t code,\n\t mapping.name));\n\t }\n\t }\n\t };\n\t\n\t/**\n\t * Add a chunk of generated JS to this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.add = function SourceNode_add(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t aChunk.forEach(function (chunk) {\n\t this.add(chunk);\n\t }, this);\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t if (aChunk) {\n\t this.children.push(aChunk);\n\t }\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a chunk of generated JS to the beginning of this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t for (var i = aChunk.length-1; i >= 0; i--) {\n\t this.prepend(aChunk[i]);\n\t }\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t this.children.unshift(aChunk);\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Walk over the tree of JS snippets in this node and its children. The\n\t * walking function is called once for each snippet of JS and is passed that\n\t * snippet and the its original associated source's line/column location.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n\t var chunk;\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t chunk = this.children[i];\n\t if (chunk[isSourceNode]) {\n\t chunk.walk(aFn);\n\t }\n\t else {\n\t if (chunk !== '') {\n\t aFn(chunk, { source: this.source,\n\t line: this.line,\n\t column: this.column,\n\t name: this.name });\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n\t * each of `this.children`.\n\t *\n\t * @param aSep The separator.\n\t */\n\tSourceNode.prototype.join = function SourceNode_join(aSep) {\n\t var newChildren;\n\t var i;\n\t var len = this.children.length;\n\t if (len > 0) {\n\t newChildren = [];\n\t for (i = 0; i < len-1; i++) {\n\t newChildren.push(this.children[i]);\n\t newChildren.push(aSep);\n\t }\n\t newChildren.push(this.children[i]);\n\t this.children = newChildren;\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Call String.prototype.replace on the very right-most source snippet. Useful\n\t * for trimming whitespace from the end of a source node, etc.\n\t *\n\t * @param aPattern The pattern to replace.\n\t * @param aReplacement The thing to replace the pattern with.\n\t */\n\tSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n\t var lastChild = this.children[this.children.length - 1];\n\t if (lastChild[isSourceNode]) {\n\t lastChild.replaceRight(aPattern, aReplacement);\n\t }\n\t else if (typeof lastChild === 'string') {\n\t this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n\t }\n\t else {\n\t this.children.push(''.replace(aPattern, aReplacement));\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Set the source content for a source file. This will be added to the SourceMapGenerator\n\t * in the sourcesContent field.\n\t *\n\t * @param aSourceFile The filename of the source file\n\t * @param aSourceContent The content of the source file\n\t */\n\tSourceNode.prototype.setSourceContent =\n\t function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n\t this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n\t };\n\t\n\t/**\n\t * Walk over the tree of SourceNodes. The walking function is called for each\n\t * source file content and is passed the filename and source content.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walkSourceContents =\n\t function SourceNode_walkSourceContents(aFn) {\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t if (this.children[i][isSourceNode]) {\n\t this.children[i].walkSourceContents(aFn);\n\t }\n\t }\n\t\n\t var sources = Object.keys(this.sourceContents);\n\t for (var i = 0, len = sources.length; i < len; i++) {\n\t aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n\t }\n\t };\n\t\n\t/**\n\t * Return the string representation of this source node. Walks over the tree\n\t * and concatenates all the various snippets together to one string.\n\t */\n\tSourceNode.prototype.toString = function SourceNode_toString() {\n\t var str = \"\";\n\t this.walk(function (chunk) {\n\t str += chunk;\n\t });\n\t return str;\n\t};\n\t\n\t/**\n\t * Returns the string representation of this source node along with a source\n\t * map.\n\t */\n\tSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n\t var generated = {\n\t code: \"\",\n\t line: 1,\n\t column: 0\n\t };\n\t var map = new SourceMapGenerator(aArgs);\n\t var sourceMappingActive = false;\n\t var lastOriginalSource = null;\n\t var lastOriginalLine = null;\n\t var lastOriginalColumn = null;\n\t var lastOriginalName = null;\n\t this.walk(function (chunk, original) {\n\t generated.code += chunk;\n\t if (original.source !== null\n\t && original.line !== null\n\t && original.column !== null) {\n\t if(lastOriginalSource !== original.source\n\t || lastOriginalLine !== original.line\n\t || lastOriginalColumn !== original.column\n\t || lastOriginalName !== original.name) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t lastOriginalSource = original.source;\n\t lastOriginalLine = original.line;\n\t lastOriginalColumn = original.column;\n\t lastOriginalName = original.name;\n\t sourceMappingActive = true;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t }\n\t });\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t }\n\t for (var idx = 0, length = chunk.length; idx < length; idx++) {\n\t if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n\t generated.line++;\n\t generated.column = 0;\n\t // Mappings end at eol\n\t if (idx + 1 === length) {\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t } else {\n\t generated.column++;\n\t }\n\t }\n\t });\n\t this.walkSourceContents(function (sourceFile, sourceContent) {\n\t map.setSourceContent(sourceFile, sourceContent);\n\t });\n\t\n\t return { code: generated.code, map: map };\n\t};\n\t\n\texports.SourceNode = SourceNode;\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// source-map.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0fd5815da764db5fb9fe","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./source-map.js\n// module id = 0\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-generator.js\n// module id = 1\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64-vlq.js\n// module id = 2\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64.js\n// module id = 3\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/util.js\n// module id = 4\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/array-set.js\n// module id = 5\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/mapping-list.js\n// module id = 6\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\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 Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\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 */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\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. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\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. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\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 */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\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. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\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. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\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. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\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 */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\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. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-consumer.js\n// module id = 7\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.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 */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.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 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/binary-search.js\n// module id = 8\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/quick-sort.js\n// module id = 9\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-node.js\n// module id = 10\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/tools/node_modules/terser/node_modules/source-map/lib/array-set.js b/tools/node_modules/terser/node_modules/source-map/lib/array-set.js deleted file mode 100644 index fbd5c81cae66..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/array-set.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var has = Object.prototype.hasOwnProperty; -var hasNativeMap = typeof Map !== "undefined"; - -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); -} - -/** - * Static method for creating ArraySet instances from an existing array. - */ -ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; -}; - -/** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ -ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; -}; - -/** - * Add the given string to this set. - * - * @param String aStr - */ -ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } -}; - -/** - * Is the given string a member of this set? - * - * @param String aStr - */ -ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } -}; - -/** - * What is the index of the given string in the array? - * - * @param String aStr - */ -ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); -}; - -/** - * What is the element at the given index? - * - * @param Number aIdx - */ -ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); -}; - -/** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ -ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); -}; - -exports.ArraySet = ArraySet; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/base64-vlq.js b/tools/node_modules/terser/node_modules/source-map/lib/base64-vlq.js deleted file mode 100644 index 612b404018ec..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/base64-vlq.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var base64 = require('./base64'); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -var VLQ_BASE_SHIFT = 5; - -// binary: 100000 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -var VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -var VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} - -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - -/** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; -}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/base64.js b/tools/node_modules/terser/node_modules/source-map/lib/base64.js deleted file mode 100644 index 8aa86b302643..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/base64.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - -/** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ -exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; -}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/binary-search.js b/tools/node_modules/terser/node_modules/source-map/lib/binary-search.js deleted file mode 100644 index 010ac941e156..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/binary-search.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/mapping-list.js b/tools/node_modules/terser/node_modules/source-map/lib/mapping-list.js deleted file mode 100644 index 06d1274a025a..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/mapping-list.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ -function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; -} - -/** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ -MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - -/** - * Add the given source mapping. - * - * @param Object aMapping - */ -MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } -}; - -/** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ -MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; -}; - -exports.MappingList = MappingList; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/quick-sort.js b/tools/node_modules/terser/node_modules/source-map/lib/quick-sort.js deleted file mode 100644 index 6a7caadbbdbe..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/quick-sort.js +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -// It turns out that some (most?) JavaScript engines don't self-host -// `Array.prototype.sort`. This makes sense because C++ will likely remain -// faster than JS when doing raw CPU-intensive sorting. However, when using a -// custom comparator function, calling back and forth between the VM's C++ and -// JIT'd JS is rather slow *and* loses JIT type information, resulting in -// worse generated code for the comparator function than would be optimal. In -// fact, when sorting with a comparator, these costs outweigh the benefits of -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get -// a ~3500ms mean speed-up in `bench/bench.html`. - -/** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ -function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; -} - -/** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ -function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); -} - -/** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ -function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } -} - -/** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ -exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); -}; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js b/tools/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js deleted file mode 100644 index 7b99d1da7fea..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js +++ /dev/null @@ -1,1145 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var binarySearch = require('./binary-search'); -var ArraySet = require('./array-set').ArraySet; -var base64VLQ = require('./base64-vlq'); -var quickSort = require('./quick-sort').quickSort; - -function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); -} - -SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; - -// `__generatedMappings` and `__originalMappings` are arrays that hold the -// parsed mapping coordinates from the source map's "mappings" attribute. They -// are lazily instantiated, accessed via the `_generatedMappings` and -// `_originalMappings` getters respectively, and we only parse the mappings -// and create these arrays once queried for a source location. We jump through -// these hoops because there can be many thousands of mappings, and parsing -// them is expensive, so we only want to do it if we must. -// -// Each object in the arrays is of the form: -// -// { -// generatedLine: The line number in the generated code, -// generatedColumn: The column number in the generated code, -// source: The path to the original source file that generated this -// chunk of code, -// originalLine: The line number in the original source that -// corresponds to this chunk of generated code, -// originalColumn: The column number in the original source that -// corresponds to this chunk of generated code, -// name: The name of the original symbol which generated this chunk of -// code. -// } -// -// All properties except for `generatedLine` and `generatedColumn` can be -// `null`. -// -// `_generatedMappings` is ordered by the generated positions. -// -// `_originalMappings` is ordered by the original positions. - -SourceMapConsumer.prototype.__generatedMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } -}); - -SourceMapConsumer.prototype.__originalMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } -}); - -SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -/** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ -SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - -/** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; -} - -BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - -/** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ -BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; -}; - -/** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ -BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - -/** - * The version of the source mapping spec that we are consuming. - */ -BasicSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } -}); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - -/** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ -BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - -/** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ -BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); -} - -IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - -/** - * The version of the source mapping spec that we are consuming. - */ -IndexedSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } -}); - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/source-map-generator.js b/tools/node_modules/terser/node_modules/source-map/lib/source-map-generator.js deleted file mode 100644 index 508bcfbbc936..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/source-map-generator.js +++ /dev/null @@ -1,425 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var base64VLQ = require('./base64-vlq'); -var util = require('./util'); -var ArraySet = require('./array-set').ArraySet; -var MappingList = require('./mapping-list').MappingList; - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; -} - -SourceMapGenerator.prototype._version = 3; - -/** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ -SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - -/** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ -SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - -/** - * Set the source content for a source file. - */ -SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - -/** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ -SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - -/** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ -SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - -/** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ -SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - -SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - -/** - * Externalize the source map. - */ -SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - -/** - * Render the source map being generated to a string. - */ -SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - -exports.SourceMapGenerator = SourceMapGenerator; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/source-node.js b/tools/node_modules/terser/node_modules/source-map/lib/source-node.js deleted file mode 100644 index 8bcdbe385d2c..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/source-node.js +++ /dev/null @@ -1,413 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; -var util = require('./util'); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -var REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -var NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -var isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); -} - -/** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ -SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - -/** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } -}; - -/** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ -SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; -}; - -/** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ -SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; -}; - -/** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ -SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - -/** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - -/** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ -SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; -}; - -/** - * Returns the string representation of this source node along with a source - * map. - */ -SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; -}; - -exports.SourceNode = SourceNode; diff --git a/tools/node_modules/terser/node_modules/source-map/lib/util.js b/tools/node_modules/terser/node_modules/source-map/lib/util.js deleted file mode 100644 index 3ca92e56f2a8..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/lib/util.js +++ /dev/null @@ -1,488 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } -} -exports.getArg = getArg; - -var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -var dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -} -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); -}()); - -function identity (s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); -} -exports.parseSourceMapInput = parseSourceMapInput; - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); -} -exports.computeSourceURL = computeSourceURL; diff --git a/tools/node_modules/terser/node_modules/source-map/package.json b/tools/node_modules/terser/node_modules/source-map/package.json deleted file mode 100644 index d02410f9109e..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/package.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "_from": "source-map@~0.6.1", - "_id": "source-map@0.6.1", - "_inBundle": false, - "_integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "_location": "/terser/source-map", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "source-map@~0.6.1", - "name": "source-map", - "escapedName": "source-map", - "rawSpec": "~0.6.1", - "saveSpec": null, - "fetchSpec": "~0.6.1" - }, - "_requiredBy": [ - "/terser" - ], - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "_shasum": "74722af32e9614e9c287a8d0bbde48b5e2f1a263", - "_spec": "source-map@~0.6.1", - "_where": "/usr/local/google/home/azakai/Dev/emscripten/tools/node_modules/terser", - "author": { - "name": "Nick Fitzgerald", - "email": "nfitzgerald@mozilla.com" - }, - "bugs": { - "url": "https://github.com/mozilla/source-map/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Tobias Koppers", - "email": "tobias.koppers@googlemail.com" - }, - { - "name": "Duncan Beevers", - "email": "duncan@dweebd.com" - }, - { - "name": "Stephen Crane", - "email": "scrane@mozilla.com" - }, - { - "name": "Ryan Seddon", - "email": "seddon.ryan@gmail.com" - }, - { - "name": "Miles Elam", - "email": "miles.elam@deem.com" - }, - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com" - }, - { - "name": "Michael Ficarra", - "email": "github.public.email@michael.ficarra.me" - }, - { - "name": "Todd Wolfson", - "email": "todd@twolfson.com" - }, - { - "name": "Alexander Solovyov", - "email": "alexander@solovyov.net" - }, - { - "name": "Felix Gnass", - "email": "fgnass@gmail.com" - }, - { - "name": "Conrad Irwin", - "email": "conrad.irwin@gmail.com" - }, - { - "name": "usrbincc", - "email": "usrbincc@yahoo.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Chase Douglas", - "email": "chase@newrelic.com" - }, - { - "name": "Evan Wallace", - "email": "evan.exe@gmail.com" - }, - { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Simon Lydell", - "email": "simon.lydell@gmail.com" - }, - { - "name": "Jmeas Smith", - "email": "jellyes2@gmail.com" - }, - { - "name": "Michael Z Goddard", - "email": "mzgoddard@gmail.com" - }, - { - "name": "azu", - "email": "azu@users.noreply.github.com" - }, - { - "name": "John Gozde", - "email": "john@gozde.ca" - }, - { - "name": "Adam Kirkton", - "email": "akirkton@truefitinnovation.com" - }, - { - "name": "Chris Montgomery", - "email": "christopher.montgomery@dowjones.com" - }, - { - "name": "J. Ryan Stinnett", - "email": "jryans@gmail.com" - }, - { - "name": "Jack Herrington", - "email": "jherrington@walmartlabs.com" - }, - { - "name": "Chris Truter", - "email": "jeffpalentine@gmail.com" - }, - { - "name": "Daniel Espeset", - "email": "daniel@danielespeset.com" - }, - { - "name": "Jamie Wong", - "email": "jamie.lf.wong@gmail.com" - }, - { - "name": "Eddy Bruël", - "email": "ejpbruel@mozilla.com" - }, - { - "name": "Hawken Rives", - "email": "hawkrives@gmail.com" - }, - { - "name": "Gilad Peleg", - "email": "giladp007@gmail.com" - }, - { - "name": "djchie", - "email": "djchie.dev@gmail.com" - }, - { - "name": "Gary Ye", - "email": "garysye@gmail.com" - }, - { - "name": "Nicolas Lalevée", - "email": "nicolas.lalevee@hibnet.org" - } - ], - "deprecated": false, - "description": "Generates and consumes source maps", - "devDependencies": { - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "source-map.js", - "source-map.d.ts", - "lib/", - "dist/source-map.debug.js", - "dist/source-map.js", - "dist/source-map.min.js", - "dist/source-map.min.js.map" - ], - "homepage": "https://github.com/mozilla/source-map", - "license": "BSD-3-Clause", - "main": "./source-map.js", - "name": "source-map", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/mozilla/source-map.git" - }, - "scripts": { - "build": "webpack --color", - "test": "npm run build && node test/run-tests.js", - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" - }, - "typings": "source-map", - "version": "0.6.1" -} diff --git a/tools/node_modules/terser/node_modules/source-map/source-map.d.ts b/tools/node_modules/terser/node_modules/source-map/source-map.d.ts deleted file mode 100644 index 8f972b0cfbf3..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/source-map.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -export interface StartOfSourceMap { - file?: string; - sourceRoot?: string; -} - -export interface RawSourceMap extends StartOfSourceMap { - version: string; - sources: string[]; - names: string[]; - sourcesContent?: string[]; - mappings: string; -} - -export interface Position { - line: number; - column: number; -} - -export interface LineRange extends Position { - lastColumn: number; -} - -export interface FindPosition extends Position { - // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND - bias?: number; -} - -export interface SourceFindPosition extends FindPosition { - source: string; -} - -export interface MappedPosition extends Position { - source: string; - name?: string; -} - -export interface MappingItem { - source: string; - generatedLine: number; - generatedColumn: number; - originalLine: number; - originalColumn: number; - name: string; -} - -export class SourceMapConsumer { - static GENERATED_ORDER: number; - static ORIGINAL_ORDER: number; - - static GREATEST_LOWER_BOUND: number; - static LEAST_UPPER_BOUND: number; - - constructor(rawSourceMap: RawSourceMap); - computeColumnSpans(): void; - originalPositionFor(generatedPosition: FindPosition): MappedPosition; - generatedPositionFor(originalPosition: SourceFindPosition): LineRange; - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; - hasContentsOfAllSources(): boolean; - sourceContentFor(source: string, returnNullOnMissing?: boolean): string; - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; -} - -export interface Mapping { - generated: Position; - original: Position; - source: string; - name?: string; -} - -export class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; - addMapping(mapping: Mapping): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - toString(): string; -} - -export interface CodeWithSourceMap { - code: string; - map: SourceMapGenerator; -} - -export class SourceNode { - constructor(); - constructor(line: number, column: number, source: string); - constructor(line: number, column: number, source: string, chunk?: string, name?: string); - static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; - add(chunk: string): void; - prepend(chunk: string): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - walk(fn: (chunk: string, mapping: MappedPosition) => void): void; - walkSourceContents(fn: (file: string, content: string) => void): void; - join(sep: string): SourceNode; - replaceRight(pattern: string, replacement: string): SourceNode; - toString(): string; - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; -} diff --git a/tools/node_modules/terser/node_modules/source-map/source-map.js b/tools/node_modules/terser/node_modules/source-map/source-map.js deleted file mode 100644 index bc88fe820c87..000000000000 --- a/tools/node_modules/terser/node_modules/source-map/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./lib/source-node').SourceNode; From 83d5872e7630a6e301f0480f54c1527f24c30e14 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 15:22:09 -0800 Subject: [PATCH 64/82] restore missing --- tools/node_modules/source-map/CHANGELOG.md | 301 +++++ tools/node_modules/source-map/LICENSE | 28 + tools/node_modules/source-map/README.md | 729 +++++++++++ .../node_modules/source-map/lib/array-set.js | 104 ++ .../node_modules/source-map/lib/base64-vlq.js | 140 +++ tools/node_modules/source-map/lib/base64.js | 67 + .../source-map/lib/binary-search.js | 111 ++ .../source-map/lib/mapping-list.js | 79 ++ .../node_modules/source-map/lib/quick-sort.js | 114 ++ .../source-map/lib/source-map-consumer.js | 1082 +++++++++++++++++ .../source-map/lib/source-map-generator.js | 404 ++++++ .../source-map/lib/source-node.js | 407 +++++++ tools/node_modules/source-map/lib/util.js | 417 +++++++ tools/node_modules/source-map/package.json | 71 ++ tools/node_modules/source-map/source-map.js | 8 + 15 files changed, 4062 insertions(+) create mode 100644 tools/node_modules/source-map/CHANGELOG.md create mode 100644 tools/node_modules/source-map/LICENSE create mode 100644 tools/node_modules/source-map/README.md create mode 100644 tools/node_modules/source-map/lib/array-set.js create mode 100644 tools/node_modules/source-map/lib/base64-vlq.js create mode 100644 tools/node_modules/source-map/lib/base64.js create mode 100644 tools/node_modules/source-map/lib/binary-search.js create mode 100644 tools/node_modules/source-map/lib/mapping-list.js create mode 100644 tools/node_modules/source-map/lib/quick-sort.js create mode 100644 tools/node_modules/source-map/lib/source-map-consumer.js create mode 100644 tools/node_modules/source-map/lib/source-map-generator.js create mode 100644 tools/node_modules/source-map/lib/source-node.js create mode 100644 tools/node_modules/source-map/lib/util.js create mode 100644 tools/node_modules/source-map/package.json create mode 100644 tools/node_modules/source-map/source-map.js diff --git a/tools/node_modules/source-map/CHANGELOG.md b/tools/node_modules/source-map/CHANGELOG.md new file mode 100644 index 000000000000..3a8c066c66b1 --- /dev/null +++ b/tools/node_modules/source-map/CHANGELOG.md @@ -0,0 +1,301 @@ +# Change Log + +## 0.5.6 + +* Fix for regression when people were using numbers as names in source maps. See + #236. + +## 0.5.5 + +* Fix "regression" of unsupported, implementation behavior that half the world + happens to have come to depend on. See #235. + +* Fix regression involving function hoisting in SpiderMonkey. See #233. + +## 0.5.4 + +* Large performance improvements to source-map serialization. See #228 and #229. + +## 0.5.3 + +* Do not include unnecessary distribution files. See + commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. + +## 0.5.2 + +* Include browser distributions of the library in package.json's `files`. See + issue #212. + +## 0.5.1 + +* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See + ff05274becc9e6e1295ed60f3ea090d31d843379. + +## 0.5.0 + +* Node 0.8 is no longer supported. + +* Use webpack instead of dryice for bundling. + +* Big speedups serializing source maps. See pull request #203. + +* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that + explicitly start with the source root. See issue #199. + +## 0.4.4 + +* Fix an issue where using a `SourceMapGenerator` after having created a + `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See + issue #191. + +* Fix an issue with where `SourceMapGenerator` would mistakenly consider + different mappings as duplicates of each other and avoid generating them. See + issue #192. + +## 0.4.3 + +* A very large number of performance improvements, particularly when parsing + source maps. Collectively about 75% of time shaved off of the source map + parsing benchmark! + +* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy + searching in the presence of a column option. See issue #177. + +* Fix a bug with joining a source and its source root when the source is above + the root. See issue #182. + +* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to + determine when all sources' contents are inlined into the source map. See + issue #190. + +## 0.4.2 + +* Add an `.npmignore` file so that the benchmarks aren't pulled down by + dependent projects. Issue #169. + +* Add an optional `column` argument to + `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines + with no mappings. Issues #172 and #173. + +## 0.4.1 + +* Fix accidentally defining a global variable. #170. + +## 0.4.0 + +* The default direction for fuzzy searching was changed back to its original + direction. See #164. + +* There is now a `bias` option you can supply to `SourceMapConsumer` to control + the fuzzy searching direction. See #167. + +* About an 8% speed up in parsing source maps. See #159. + +* Added a benchmark for parsing and generating source maps. + +## 0.3.0 + +* Change the default direction that searching for positions fuzzes when there is + not an exact match. See #154. + +* Support for environments using json2.js for JSON serialization. See #156. + +## 0.2.0 + +* Support for consuming "indexed" source maps which do not have any remote + sections. See pull request #127. This introduces a minor backwards + incompatibility if you are monkey patching `SourceMapConsumer.prototype` + methods. + +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + +## 0.1.40 + +* Performance improvements for parsing source maps in SourceMapConsumer. + +## 0.1.39 + +* Fix a bug where setting a source's contents to null before any source content + had been set before threw a TypeError. See issue #131. + +## 0.1.38 + +* Fix a bug where finding relative paths from an empty path were creating + absolute paths. See issue #129. + +## 0.1.37 + +* Fix a bug where if the source root was an empty string, relative source paths + would turn into absolute source paths. Issue #124. + +## 0.1.36 + +* Allow the `names` mapping property to be an empty string. Issue #121. + +## 0.1.35 + +* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` + to specify a path that relative sources in the second parameter should be + relative to. Issue #105. + +* If no file property is given to a `SourceMapGenerator`, then the resulting + source map will no longer have a `null` file property. The property will + simply not exist. Issue #104. + +* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. + Issue #116. + +## 0.1.34 + +* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. + +* Fix bug involving source contents and the + `SourceMapGenerator.prototype.applySourceMap`. Issue #100. + +## 0.1.33 + +* Fix some edge cases surrounding path joining and URL resolution. + +* Add a third parameter for relative path to + `SourceMapGenerator.prototype.applySourceMap`. + +* Fix issues with mappings and EOLs. + +## 0.1.32 + +* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns + (issue 92). + +* Fixed test runner to actually report number of failed tests as its process + exit code. + +* Fixed a typo when reporting bad mappings (issue 87). + +## 0.1.31 + +* Delay parsing the mappings in SourceMapConsumer until queried for a source + location. + +* Support Sass source maps (which at the time of writing deviate from the spec + in small ways) in SourceMapConsumer. + +## 0.1.30 + +* Do not join source root with a source, when the source is a data URI. + +* Extend the test runner to allow running single specific test files at a time. + +* Performance improvements in `SourceNode.prototype.walk` and + `SourceMapConsumer.prototype.eachMapping`. + +* Source map browser builds will now work inside Workers. + +* Better error messages when attempting to add an invalid mapping to a + `SourceMapGenerator`. + +## 0.1.29 + +* Allow duplicate entries in the `names` and `sources` arrays of source maps + (usually from TypeScript) we are parsing. Fixes github issue 72. + +## 0.1.28 + +* Skip duplicate mappings when creating source maps from SourceNode; github + issue 75. + +## 0.1.27 + +* Don't throw an error when the `file` property is missing in SourceMapConsumer, + we don't use it anyway. + +## 0.1.26 + +* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. + +## 0.1.25 + +* Make compatible with browserify + +## 0.1.24 + +* Fix issue with absolute paths and `file://` URIs. See + https://bugzilla.mozilla.org/show_bug.cgi?id=885597 + +## 0.1.23 + +* Fix issue with absolute paths and sourcesContent, github issue 64. + +## 0.1.22 + +* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. + +## 0.1.21 + +* Fixed handling of sources that start with a slash so that they are relative to + the source root's host. + +## 0.1.20 + +* Fixed github issue #43: absolute URLs aren't joined with the source root + anymore. + +## 0.1.19 + +* Using Travis CI to run tests. + +## 0.1.18 + +* Fixed a bug in the handling of sourceRoot. + +## 0.1.17 + +* Added SourceNode.fromStringWithSourceMap. + +## 0.1.16 + +* Added missing documentation. + +* Fixed the generating of empty mappings in SourceNode. + +## 0.1.15 + +* Added SourceMapGenerator.applySourceMap. + +## 0.1.14 + +* The sourceRoot is now handled consistently. + +## 0.1.13 + +* Added SourceMapGenerator.fromSourceMap. + +## 0.1.12 + +* SourceNode now generates empty mappings too. + +## 0.1.11 + +* Added name support to SourceNode. + +## 0.1.10 + +* Added sourcesContent support to the customer and generator. diff --git a/tools/node_modules/source-map/LICENSE b/tools/node_modules/source-map/LICENSE new file mode 100644 index 000000000000..ed1b7cf27e97 --- /dev/null +++ b/tools/node_modules/source-map/LICENSE @@ -0,0 +1,28 @@ + +Copyright (c) 2009-2011, Mozilla Foundation and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the names of the Mozilla Foundation nor the names of project + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/source-map/README.md b/tools/node_modules/source-map/README.md new file mode 100644 index 000000000000..99d38618dfac --- /dev/null +++ b/tools/node_modules/source-map/README.md @@ -0,0 +1,729 @@ +# Source Map + +[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) + +[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) + +This is a library to generate and consume the source map format +[described here][format]. + +[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit + +## Use with Node + + $ npm install source-map + +## Use on the Web + + + +-------------------------------------------------------------------------------- + + + + + +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + + + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. + +* `column`: The column number in the generated source. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. + +* `column`: The column number in the original source, or null or null if this + information is not available. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. + +* `column`: The column number in the original source. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. + +* `column`: The column number in the generated source, or null. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. + +* `column`: Optional. The column number in the original source. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. + +* `column`: The column number in the generated source, or null. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/tools/node_modules/source-map/lib/array-set.js b/tools/node_modules/source-map/lib/array-set.js new file mode 100644 index 000000000000..51dffeb59dbd --- /dev/null +++ b/tools/node_modules/source-map/lib/array-set.js @@ -0,0 +1,104 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = util.toSetString(aStr); + var isDuplicate = has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + this._set[sStr] = idx; + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/tools/node_modules/source-map/lib/base64-vlq.js b/tools/node_modules/source-map/lib/base64-vlq.js new file mode 100644 index 000000000000..612b404018ec --- /dev/null +++ b/tools/node_modules/source-map/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/tools/node_modules/source-map/lib/base64.js b/tools/node_modules/source-map/lib/base64.js new file mode 100644 index 000000000000..8aa86b302643 --- /dev/null +++ b/tools/node_modules/source-map/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/tools/node_modules/source-map/lib/binary-search.js b/tools/node_modules/source-map/lib/binary-search.js new file mode 100644 index 000000000000..010ac941e156 --- /dev/null +++ b/tools/node_modules/source-map/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/tools/node_modules/source-map/lib/mapping-list.js b/tools/node_modules/source-map/lib/mapping-list.js new file mode 100644 index 000000000000..06d1274a025a --- /dev/null +++ b/tools/node_modules/source-map/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/tools/node_modules/source-map/lib/quick-sort.js b/tools/node_modules/source-map/lib/quick-sort.js new file mode 100644 index 000000000000..6a7caadbbdbe --- /dev/null +++ b/tools/node_modules/source-map/lib/quick-sort.js @@ -0,0 +1,114 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ +exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); +}; diff --git a/tools/node_modules/source-map/lib/source-map-consumer.js b/tools/node_modules/source-map/lib/source-map-consumer.js new file mode 100644 index 000000000000..cdf8356f8234 --- /dev/null +++ b/tools/node_modules/source-map/lib/source-map-consumer.js @@ -0,0 +1,1082 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap) + : new BasicSourceMapConsumer(sourceMap); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + if (source != null && sourceRoot != null) { + source = util.join(sourceRoot, source); + } + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: Optional. the column number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + if (!this._sources.has(needle.source)) { + return []; + } + needle.source = this._sources.indexOf(needle.source); + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The only parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See GitHub issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._sources.toArray().map(function (s) { + return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; + }, this); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + if (this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + if (this.sourceRoot != null) { + aSource = util.relative(this.sourceRoot, aSource); + } + + if (this._sources.has(aSource)) { + return this.sourcesContent[this._sources.indexOf(aSource)]; + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + aSource)) { + return this.sourcesContent[this._sources.indexOf("/" + aSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + if (this.sourceRoot != null) { + source = util.relative(this.sourceRoot, source); + } + if (!this._sources.has(source)) { + return { + line: null, + column: null, + lastColumn: null + }; + } + source = this._sources.indexOf(source); + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The only parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map')) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if (section.consumer.sourceRoot !== null) { + source = util.join(section.consumer.sourceRoot, source); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/tools/node_modules/source-map/lib/source-map-generator.js b/tools/node_modules/source-map/lib/source-map-generator.js new file mode 100644 index 000000000000..8fbb8e8b79d7 --- /dev/null +++ b/tools/node_modules/source-map/lib/source-map-generator.js @@ -0,0 +1,404 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/tools/node_modules/source-map/lib/source-node.js b/tools/node_modules/source-map/lib/source-node.js new file mode 100644 index 000000000000..e927f6663ef0 --- /dev/null +++ b/tools/node_modules/source-map/lib/source-node.js @@ -0,0 +1,407 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are removed from this array, by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var shiftNextLine = function() { + var lineContents = remainingLines.shift(); + // The last line of a file might not have a newline. + var newLine = remainingLines.shift() || ""; + return lineContents + newLine; + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[0]; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[0] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[0]; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[0] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLines.length > 0) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/tools/node_modules/source-map/lib/util.js b/tools/node_modules/source-map/lib/util.js new file mode 100644 index 000000000000..44e0e4520523 --- /dev/null +++ b/tools/node_modules/source-map/lib/util.js @@ -0,0 +1,417 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +} +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; diff --git a/tools/node_modules/source-map/package.json b/tools/node_modules/source-map/package.json new file mode 100644 index 000000000000..5f793ffb15e2 --- /dev/null +++ b/tools/node_modules/source-map/package.json @@ -0,0 +1,71 @@ +{ + "name": "source-map", + "description": "Generates and consumes source maps", + "version": "0.5.6", + "homepage": "https://github.com/mozilla/source-map", + "author": "Nick Fitzgerald ", + "contributors": [ + "Tobias Koppers ", + "Duncan Beevers ", + "Stephen Crane ", + "Ryan Seddon ", + "Miles Elam ", + "Mihai Bazon ", + "Michael Ficarra ", + "Todd Wolfson ", + "Alexander Solovyov ", + "Felix Gnass ", + "Conrad Irwin ", + "usrbincc ", + "David Glasser ", + "Chase Douglas ", + "Evan Wallace ", + "Heather Arthur ", + "Hugh Kennedy ", + "David Glasser ", + "Simon Lydell ", + "Jmeas Smith ", + "Michael Z Goddard ", + "azu ", + "John Gozde ", + "Adam Kirkton ", + "Chris Montgomery ", + "J. Ryan Stinnett ", + "Jack Herrington ", + "Chris Truter ", + "Daniel Espeset ", + "Jamie Wong ", + "Eddy Bruël ", + "Hawken Rives ", + "Gilad Peleg ", + "djchie ", + "Gary Ye ", + "Nicolas Lalevée " + ], + "repository": { + "type": "git", + "url": "http://github.com/mozilla/source-map.git" + }, + "main": "./source-map.js", + "files": [ + "source-map.js", + "lib/", + "dist/source-map.debug.js", + "dist/source-map.js", + "dist/source-map.min.js", + "dist/source-map.min.js.map" + ], + "engines": { + "node": ">=0.10.0" + }, + "license": "BSD-3-Clause", + "scripts": { + "test": "npm run build && node test/run-tests.js", + "build": "webpack --color", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "devDependencies": { + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + } +} diff --git a/tools/node_modules/source-map/source-map.js b/tools/node_modules/source-map/source-map.js new file mode 100644 index 000000000000..bc88fe820c87 --- /dev/null +++ b/tools/node_modules/source-map/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; From 90f07ee59a98ef467e17e93c799d5d89b38a1565 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 15:32:36 -0800 Subject: [PATCH 65/82] wip --- tests/test_other.py | 76 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/tests/test_other.py b/tests/test_other.py index eda3dce17e5f..921136984523 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2104,11 +2104,81 @@ def test_save_bc(self): def test_js_optimizer(self): ACORN_PASSES = ['JSDCE', 'AJSDCE', 'applyImportAndExportNameChanges', 'emitDCEGraph', 'applyDCEGraphRemovals'] for input, expected, passes in [ + + (path_from_root('tests', 'optimizer', 'eliminateDeadGlobals.js'), open(path_from_root('tests', 'optimizer', 'eliminateDeadGlobals-output.js')).read(), + ['eliminateDeadGlobals']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-output.js')).read(), + ['hoistMultiples', 'removeAssignsToUndefined', 'simplifyExpressions']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-output.js')).read(), + ['asm', 'simplifyExpressions']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-si.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-si-output.js')).read(), + ['simplifyIfs']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-regs.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-regs-output.js')).read(), + ['registerize']), + (path_from_root('tests', 'optimizer', 'eliminator-test.js'), open(path_from_root('tests', 'optimizer', 'eliminator-test-output.js')).read(), + ['eliminate']), + (path_from_root('tests', 'optimizer', 'safe-eliminator-test.js'), open(path_from_root('tests', 'optimizer', 'safe-eliminator-test-output.js')).read(), + ['eliminateMemSafe']), + (path_from_root('tests', 'optimizer', 'asm-eliminator-test.js'), open(path_from_root('tests', 'optimizer', 'asm-eliminator-test-output.js')).read(), + ['asm', 'eliminate']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs-output.js')).read(), + ['asm', 'registerize']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs-harder.js'), [open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs-harder-output.js')).read(), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs-harder-output2.js')).read(), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs-harder-output3.js')).read()], + ['asm', 'registerizeHarder']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs-min.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-regs-min-output.js')).read(), + ['asm', 'registerize', 'minifyLocals']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-pre.js'), [open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-pre-output.js')).read(), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-pre-output2.js')).read()], + ['asm', 'simplifyExpressions']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-pre-f32.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-pre-output-f32.js')).read(), + ['asm', 'asmPreciseF32', 'simplifyExpressions', 'optimizeFrounds']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-pre-f32.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-pre-output-f32-nosimp.js')).read(), + ['asm', 'asmPreciseF32', 'optimizeFrounds']), + (path_from_root('tests', 'optimizer', 'test-reduce-dead-float-return.js'), open(path_from_root('tests', 'optimizer', 'test-reduce-dead-float-return-output.js')).read(), + ['asm', 'optimizeFrounds', 'registerizeHarder']), + (path_from_root('tests', 'optimizer', 'test-no-reduce-dead-float-return-to-nothing.js'), open(path_from_root('tests', 'optimizer', 'test-no-reduce-dead-float-return-to-nothing-output.js')).read(), + ['asm', 'registerizeHarder']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-last.js'), [open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-lastOpts-output.js')).read(), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-lastOpts-output2.js')).read(), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-lastOpts-output3.js')).read()], + ['asm', 'asmLastOpts']), + (path_from_root('tests', 'optimizer', 'asmLastOpts.js'), open(path_from_root('tests', 'optimizer', 'asmLastOpts-output.js')).read(), + ['asm', 'asmLastOpts']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-last.js'), [open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-last-output.js')).read(), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-last-output2.js')).read(), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-last-output3.js')).read()], + ['asm', 'asmLastOpts', 'last']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-relocate.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-relocate-output.js')).read(), + ['asm', 'relocate']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline1.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline1-output.js')).read(), + ['asm', 'outline']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline2.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline2-output.js')).read(), + ['asm', 'outline']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline3.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline3-output.js')).read(), + ['asm', 'outline']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline4.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-outline4-output.js')).read(), + ['asm', 'outline']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-minlast.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-asm-minlast-output.js')).read(), + ['asm', 'minifyWhitespace', 'asmLastOpts', 'last']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-shiftsAggressive.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-shiftsAggressive-output.js')).read(), + ['asm', 'aggressiveVariableElimination']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-localCSE.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-localCSE-output.js')).read(), + ['asm', 'localCSE']), + (path_from_root('tests', 'optimizer', 'test-js-optimizer-ensureLabelSet.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-ensureLabelSet-output.js')).read(), + ['asm', 'ensureLabelSet']), + (path_from_root('tests', 'optimizer', '3154.js'), open(path_from_root('tests', 'optimizer', '3154-output.js')).read(), + ['asm', 'eliminate', 'registerize', 'asmLastOpts', 'last']), + (path_from_root('tests', 'optimizer', 'simd.js'), open(path_from_root('tests', 'optimizer', 'simd-output.js')).read(), + ['asm', 'eliminate']), # eliminate, just enough to trigger asm normalization/denormalization + (path_from_root('tests', 'optimizer', 'simd.js'), open(path_from_root('tests', 'optimizer', 'simd-output-memSafe.js')).read(), + ['asm', 'eliminateMemSafe']), + (path_from_root('tests', 'optimizer', 'safeLabelSetting.js'), open(path_from_root('tests', 'optimizer', 'safeLabelSetting-output.js')).read(), + ['asm', 'safeLabelSetting']), # eliminate, just enough to trigger asm normalization/denormalization + (path_from_root('tests', 'optimizer', 'null_if.js'), [open(path_from_root('tests', 'optimizer', 'null_if-output.js')).read(), open(path_from_root('tests', 'optimizer', 'null_if-output2.js')).read()], + ['asm', 'registerizeHarder', 'asmLastOpts', 'minifyWhitespace']), # issue 3520 + (path_from_root('tests', 'optimizer', 'null_else.js'), [open(path_from_root('tests', 'optimizer', 'null_else-output.js')).read(), open(path_from_root('tests', 'optimizer', 'null_else-output2.js')).read()], + ['asm', 'registerizeHarder', 'asmLastOpts', 'minifyWhitespace']), # issue 3549 + (path_from_root('tests', 'optimizer', 'test-js-optimizer-splitMemory.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-splitMemory-output.js')).read(), + ['splitMemory']), (path_from_root('tests', 'optimizer', 'JSDCE.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-output.js')).read(), ['JSDCE']), - # XXX this test cannot pass with astring as our code emitter - # (path_from_root('tests', 'optimizer', 'JSDCE-uglifyjsNodeTypes.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-uglifyjsNodeTypes-output.js')).read(), - # ['JSDCE']), + (path_from_root('tests', 'optimizer', 'JSDCE-uglifyjsNodeTypes.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-uglifyjsNodeTypes-output.js')).read(), + ['JSDCE']), (path_from_root('tests', 'optimizer', 'JSDCE-hasOwnProperty.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-hasOwnProperty-output.js')).read(), ['JSDCE']), (path_from_root('tests', 'optimizer', 'JSDCE-fors.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-fors-output.js')).read(), From 2d5309ceb841dd7d7373ba6f00828126ee5cc9ca Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 15:42:59 -0800 Subject: [PATCH 66/82] cleanup --- .../JSDCE-uglifyjsNodeTypes-output.js | 54 - tests/optimizer/JSDCE-uglifyjsNodeTypes.js | 47 - tests/test_other.py | 2 - tools/acorn-optimizer.js | 4 +- tools/node_modules/terser/README.md | 9 + tools/node_modules/terser/bin/uglifyjs | 476 -- .../node_modules/terser/bin/uglifyjsnobundle | 3 - tools/node_modules/terser/dist/.gitkeep | 0 tools/node_modules/terser/dist/bundle.js | 45 - tools/node_modules/terser/dist/bundle.js.map | 1 - tools/node_modules/terser/package.json | 1 - .../terser/tools/colorless-console.js | 11 - tools/node_modules/terser/tools/domprops.js | 5601 ----------------- tools/node_modules/terser/tools/exit.js | 15 - tools/node_modules/terser/tools/exports.js | 14 - tools/node_modules/terser/tools/node.js | 55 - tools/node_modules/terser/tools/props.html | 61 - tools/node_modules/terser/tools/terser.d.ts | 790 --- 18 files changed, 11 insertions(+), 7178 deletions(-) delete mode 100644 tests/optimizer/JSDCE-uglifyjsNodeTypes-output.js delete mode 100644 tests/optimizer/JSDCE-uglifyjsNodeTypes.js delete mode 100755 tools/node_modules/terser/bin/uglifyjs delete mode 100755 tools/node_modules/terser/bin/uglifyjsnobundle delete mode 100644 tools/node_modules/terser/dist/.gitkeep delete mode 100644 tools/node_modules/terser/dist/bundle.js delete mode 100644 tools/node_modules/terser/dist/bundle.js.map delete mode 100644 tools/node_modules/terser/tools/colorless-console.js delete mode 100644 tools/node_modules/terser/tools/domprops.js delete mode 100644 tools/node_modules/terser/tools/exit.js delete mode 100644 tools/node_modules/terser/tools/exports.js delete mode 100644 tools/node_modules/terser/tools/node.js delete mode 100644 tools/node_modules/terser/tools/props.html delete mode 100644 tools/node_modules/terser/tools/terser.d.ts diff --git a/tests/optimizer/JSDCE-uglifyjsNodeTypes-output.js b/tests/optimizer/JSDCE-uglifyjsNodeTypes-output.js deleted file mode 100644 index 1bf7cd9eca86..000000000000 --- a/tests/optimizer/JSDCE-uglifyjsNodeTypes-output.js +++ /dev/null @@ -1,54 +0,0 @@ -var defun = (function() { -})(); -var name = (function() { -})(); -var object = (function() { -})(); -var non_reserved = (function() { -})(); -function func_1() { -} -function func_2() { -} -function func_3() { -} -function func_4() { -} -function func_5() { -} -function func_6() { -} -function func_7() { -} -function func_8() { -} -function func_9() { -} -function func_10() { -} -var quotedObject = { - "var": func_1, - "defun": func_2, - "function": func_3, - "name": func_4, - "non_reserved": func_5 -}; -var unquotedObject = { - "var": func_6, - defun: func_7, - "function": func_8, - name: func_9, - non_reserved: func_10 -}; -var recursiveObject = { - object: { - func: (function() { - }), - object: { - func: (function() { - }) - } - } -}; -quotedObject || unquotedObject || recursiveObject; - diff --git a/tests/optimizer/JSDCE-uglifyjsNodeTypes.js b/tests/optimizer/JSDCE-uglifyjsNodeTypes.js deleted file mode 100644 index 75af73152df6..000000000000 --- a/tests/optimizer/JSDCE-uglifyjsNodeTypes.js +++ /dev/null @@ -1,47 +0,0 @@ -var defun = (function () { var a = 1; })(); -var name = (function () { var a = 1; })(); -var object = (function () { var a = 1; })(); -var non_reserved = (function () { var a = 1; })(); - -function func_1() { var a = 1; } -function func_2() { var a = 1; } -function func_3() { var a = 1; } -function func_4() { var a = 1; } -function func_5() { var a = 1; } -function func_6() { var a = 1; } -function func_7() { var a = 1; } -function func_8() { var a = 1; } -function func_9() { var a = 1; } -function func_10() { var a = 1; } -function func_deleted() { var a = 1; } - -var quotedObject = { - "var": func_1, - "defun": func_2, - "function": func_3, - "name": func_4, - "non_reserved": func_5 -}; - -var unquotedObject = { - var: func_6, - defun: func_7, - function: func_8, - name: func_9, - non_reserved: func_10 -}; - -var recursiveObject = { - object: { - func: function () { - var a = 1; - }, - object: { - func: function () { - var b = 1; - } - } - } -}; - -quotedObject || unquotedObject || recursiveObject; // fake uses diff --git a/tests/test_other.py b/tests/test_other.py index 921136984523..f16af4ae002d 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2177,8 +2177,6 @@ def test_js_optimizer(self): ['splitMemory']), (path_from_root('tests', 'optimizer', 'JSDCE.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-output.js')).read(), ['JSDCE']), - (path_from_root('tests', 'optimizer', 'JSDCE-uglifyjsNodeTypes.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-uglifyjsNodeTypes-output.js')).read(), - ['JSDCE']), (path_from_root('tests', 'optimizer', 'JSDCE-hasOwnProperty.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-hasOwnProperty-output.js')).read(), ['JSDCE']), (path_from_root('tests', 'optimizer', 'JSDCE-fors.js'), open(path_from_root('tests', 'optimizer', 'JSDCE-fors-output.js')).read(), diff --git a/tools/acorn-optimizer.js b/tools/acorn-optimizer.js index fdb73a34180a..aebc7a7d3668 100644 --- a/tools/acorn-optimizer.js +++ b/tools/acorn-optimizer.js @@ -1,5 +1,5 @@ var acorn = require('acorn'); -var Terser = require("terser"); +var terser = require("terser"); var fs = require('fs'); var path = require('path'); @@ -767,7 +767,7 @@ passes.forEach(function(pass) { }); if (!noPrint) { - var terserAst = Terser.AST_Node.from_mozilla_ast(ast); + var terserAst = terser.AST_Node.from_mozilla_ast(ast); var output = terserAst.print_to_string({ beautify: !minifyWhitespace, indent_level: minifyWhitespace ? 0 : 1, diff --git a/tools/node_modules/terser/README.md b/tools/node_modules/terser/README.md index 1b98cb77517f..2437f86db60c 100644 --- a/tools/node_modules/terser/README.md +++ b/tools/node_modules/terser/README.md @@ -1268,3 +1268,12 @@ In the terser CLI we use [source-map-support](https://npmjs.com/source-map-suppo * CKEditor ![CKEditor](https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/15452278/f8548dcf48d740619071e8d614459280/1?token-time=2145916800&token-hash=SIQ54PhIPHv3M7CVz9LxS8_8v4sOw4H304HaXsXj8MM%3D) +# @LOCALMOD XXX EMSCRIPTEN + +This is a stripped-down version of terser, containing just the code to convert estree to uglify, and output it +It was created with basically + +```bash +cat lib/utils.js lib/ast.js lib/parse.js lib/scope.js lib/output.js lib/mozilla-ast.js > terser.js +``` + diff --git a/tools/node_modules/terser/bin/uglifyjs b/tools/node_modules/terser/bin/uglifyjs deleted file mode 100755 index 48e830266fad..000000000000 --- a/tools/node_modules/terser/bin/uglifyjs +++ /dev/null @@ -1,476 +0,0 @@ -#!/usr/bin/env node -// -*- js -*- - -"use strict"; - -require("../tools/exit.js"); - -var fs = require("fs"); -var info = require("../package.json"); -var path = require("path"); -var program = require("commander"); - -var bundle_path = __dirname + "/../dist/bundle.js"; -if (!process.env.TERSER_NO_BUNDLE && fs.existsSync(bundle_path)) { - var UglifyJS = require(bundle_path) - try { - require("source-map-support").install(); - } catch (err) {} -} else { - var UglifyJS = require("../tools/node.js"); -} - -var skip_keys = [ "cname", "inlined", "parent_scope", "scope", "uses_eval", "uses_with" ]; -var files = {}; -var options = { - compress: false, - mangle: false -}; -program.version(info.name + " " + info.version); -program.parseArgv = program.parse; -program.parse = undefined; -if (process.argv.indexOf("ast") >= 0) program.helpInformation = describe_ast; -else if (process.argv.indexOf("options") >= 0) program.helpInformation = function() { - var text = []; - var options = UglifyJS.default_options(); - for (var option in options) { - text.push("--" + (option == "output" ? "beautify" : option == "sourceMap" ? "source-map" : option) + " options:"); - text.push(format_object(options[option])); - text.push(""); - } - return text.join("\n"); -}; -program.option("-p, --parse ", "Specify parser options.", parse_js()); -program.option("-c, --compress [options]", "Enable compressor/specify compressor options.", parse_js()); -program.option("-m, --mangle [options]", "Mangle names/specify mangler options.", parse_js()); -program.option("--mangle-props [options]", "Mangle properties/specify mangler options.", parse_js()); -program.option("-b, --beautify [options]", "Beautify output/specify output options.", parse_js()); -program.option("-o, --output ", "Output file (default STDOUT)."); -program.option("--comments [filter]", "Preserve copyright comments in the output."); -program.option("--config-file ", "Read minify() options from JSON file."); -program.option("-d, --define [=value]", "Global definitions.", parse_js("define")); -program.option("--ecma ", "Specify ECMAScript release: 5, 6, 7 or 8."); -program.option("-e, --enclose [arg[,...][:value[,...]]]", "Embed output in a big function with configurable arguments and values."); -program.option("--ie8", "Support non-standard Internet Explorer 8."); -program.option("--keep-classnames", "Do not mangle/drop class names."); -program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name."); -program.option("--module", "Input is an ES6 module"); -program.option("--name-cache ", "File to hold mangled name mappings."); -program.option("--rename", "Force symbol expansion."); -program.option("--no-rename", "Disable symbol expansion."); -program.option("--safari10", "Support non-standard Safari 10."); -program.option("--source-map [options]", "Enable source map/specify source map options.", parse_source_map()); -program.option("--timings", "Display operations run time on STDERR."); -program.option("--toplevel", "Compress and/or mangle variables in toplevel scope."); -program.option("--verbose", "Print diagnostic messages."); -program.option("--warn", "Print warning messages."); -program.option("--wrap ", "Embed everything as a function with “exports” corresponding to “name” globally."); -program.arguments("[files...]").parseArgv(process.argv); -if (program.configFile) { - options = JSON.parse(read_file(program.configFile)); -} -if (!program.output && program.sourceMap && program.sourceMap.url != "inline") { - fatal("ERROR: cannot write source map to STDOUT"); -} -[ - "compress", - "enclose", - "ie8", - "mangle", - "module", - "safari10", - "sourceMap", - "toplevel", - "wrap" -].forEach(function(name) { - if (name in program) { - options[name] = program[name]; - } -}); -if ("ecma" in program) { - if (program.ecma != (program.ecma | 0)) fatal("ERROR: ecma must be an integer"); - options.ecma = program.ecma | 0; -} -if (program.beautify) { - options.output = typeof program.beautify == "object" ? program.beautify : {}; - if (!("beautify" in options.output)) { - options.output.beautify = true; - } -} -if (program.comments) { - if (typeof options.output != "object") options.output = {}; - options.output.comments = typeof program.comments == "string" ? program.comments : "some"; -} -if (program.define) { - if (typeof options.compress != "object") options.compress = {}; - if (typeof options.compress.global_defs != "object") options.compress.global_defs = {}; - for (var expr in program.define) { - options.compress.global_defs[expr] = program.define[expr]; - } -} -if (program.keepClassnames) { - options.keep_classnames = true; -} -if (program.keepFnames) { - options.keep_fnames = true; -} -if (program.mangleProps) { - if (program.mangleProps.domprops) { - delete program.mangleProps.domprops; - } else { - if (typeof program.mangleProps != "object") program.mangleProps = {}; - if (!Array.isArray(program.mangleProps.reserved)) program.mangleProps.reserved = []; - } - if (typeof options.mangle != "object") options.mangle = {}; - options.mangle.properties = program.mangleProps; -} -if (program.nameCache) { - options.nameCache = JSON.parse(read_file(program.nameCache, "{}")); -} -if (program.output == "ast") { - options.output = { - ast: true, - code: false - }; -} -if (program.parse) { - if (!program.parse.acorn && !program.parse.spidermonkey) { - options.parse = program.parse; - } else if (program.sourceMap && program.sourceMap.content == "inline") { - fatal("ERROR: inline source map only works with built-in parser"); - } -} -if (~program.rawArgs.indexOf("--rename")) { - options.rename = true; -} else if (!program.rename) { - options.rename = false; -} -var convert_path = function(name) { - return name; -}; -if (typeof program.sourceMap == "object" && "base" in program.sourceMap) { - convert_path = function() { - var base = program.sourceMap.base; - delete options.sourceMap.base; - return function(name) { - return path.relative(base, name); - }; - }(); -} -if (program.verbose) { - options.warnings = "verbose"; -} else if (program.warn) { - options.warnings = true; -} -if (program.args.length) { - simple_glob(program.args).forEach(function(name) { - files[convert_path(name)] = read_file(name); - }); - run(); -} else { - var chunks = []; - process.stdin.setEncoding("utf8"); - process.stdin.on("data", function(chunk) { - chunks.push(chunk); - }).on("end", function() { - files = [ chunks.join("") ]; - run(); - }); - process.stdin.resume(); -} - -function convert_ast(fn) { - return UglifyJS.AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null)); -} - -function run() { - UglifyJS.AST_Node.warn_function = function(msg) { - print_error("WARN: " + msg); - }; - if (program.timings) options.timings = true; - try { - if (program.parse) { - if (program.parse.acorn) { - files = convert_ast(function(toplevel, name) { - return require("acorn").parse(files[name], { - ecmaVersion: 2018, - locations: true, - program: toplevel, - sourceFile: name, - sourceType: options.module || program.parse.module ? "module" : "script" - }); - }); - } else if (program.parse.spidermonkey) { - files = convert_ast(function(toplevel, name) { - var obj = JSON.parse(files[name]); - if (!toplevel) return obj; - toplevel.body = toplevel.body.concat(obj.body); - return toplevel; - }); - } - } - } catch (ex) { - fatal(ex); - } - var result = UglifyJS.minify(files, options); - if (result.error) { - var ex = result.error; - if (ex.name == "SyntaxError") { - print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col); - var col = ex.col; - var lines = files[ex.filename].split(/\r?\n/); - var line = lines[ex.line - 1]; - if (!line && !col) { - line = lines[ex.line - 2]; - col = line.length; - } - if (line) { - var limit = 70; - if (col > limit) { - line = line.slice(col - limit); - col = limit; - } - print_error(line.slice(0, 80)); - print_error(line.slice(0, col).replace(/\S/g, " ") + "^"); - } - } - if (ex.defs) { - print_error("Supported options:"); - print_error(format_object(ex.defs)); - } - fatal(ex); - } else if (program.output == "ast") { - if (!options.compress && !options.mangle) { - result.ast.figure_out_scope({}); - } - print(JSON.stringify(result.ast, function(key, value) { - if (value) switch (key) { - case "thedef": - return symdef(value); - case "enclosed": - return value.length ? value.map(symdef) : undefined; - case "variables": - case "functions": - case "globals": - return value.size() ? value.map(symdef) : undefined; - } - if (skip_key(key)) return; - if (value instanceof UglifyJS.AST_Token) return; - if (value instanceof UglifyJS.Dictionary) return; - if (value instanceof UglifyJS.AST_Node) { - var result = { - _class: "AST_" + value.TYPE - }; - if (value.block_scope) { - result.variables = value.block_scope.variables; - result.functions = value.block_scope.functions; - result.enclosed = value.block_scope.enclosed; - } - value.CTOR.PROPS.forEach(function(prop) { - result[prop] = value[prop]; - }); - return result; - } - return value; - }, 2)); - } else if (program.output == "spidermonkey") { - print(JSON.stringify(UglifyJS.minify(result.code, { - compress: false, - mangle: false, - output: { - ast: true, - code: false - } - }).ast.to_mozilla_ast(), null, 2)); - } else if (program.output) { - fs.writeFileSync(program.output, result.code); - if (result.map) { - fs.writeFileSync(program.output + ".map", result.map); - } - } else { - print(result.code); - } - if (program.nameCache) { - fs.writeFileSync(program.nameCache, JSON.stringify(options.nameCache)); - } - if (result.timings) for (var phase in result.timings) { - print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s"); - } -} - -function fatal(message) { - if (message instanceof Error) message = message.stack.replace(/^\S*?Error:/, "ERROR:") - print_error(message); - process.exit(1); -} - -// A file glob function that only supports "*" and "?" wildcards in the basename. -// Example: "foo/bar/*baz??.*.js" -// Argument `glob` may be a string or an array of strings. -// Returns an array of strings. Garbage in, garbage out. -function simple_glob(glob) { - if (Array.isArray(glob)) { - return [].concat.apply([], glob.map(simple_glob)); - } - if (glob && glob.match(/\*|\?/)) { - var dir = path.dirname(glob); - try { - var entries = fs.readdirSync(dir); - } catch (ex) {} - if (entries) { - var pattern = "^" + path.basename(glob) - .replace(/[.+^$[\]\\(){}]/g, "\\$&") - .replace(/\*/g, "[^/\\\\]*") - .replace(/\?/g, "[^/\\\\]") + "$"; - var mod = process.platform === "win32" ? "i" : ""; - var rx = new RegExp(pattern, mod); - var results = entries.filter(function(name) { - return rx.test(name); - }).map(function(name) { - return path.join(dir, name); - }); - if (results.length) return results; - } - } - return [ glob ]; -} - -function read_file(path, default_value) { - try { - return fs.readFileSync(path, "utf8"); - } catch (ex) { - if ((ex.code == "ENOENT" || ex.code == "ENAMETOOLONG") && default_value != null) return default_value; - fatal(ex); - } -} - -function parse_js(flag) { - return function(value, options) { - options = options || {}; - try { - UglifyJS.minify(value, { - parse: { - expression: true - }, - compress: false, - mangle: false, - output: { - ast: true, - code: false - } - }).ast.walk(new UglifyJS.TreeWalker(function(node) { - if (node instanceof UglifyJS.AST_Assign) { - var name = node.left.print_to_string(); - var value = node.right; - if (flag) { - options[name] = value; - } else if (value instanceof UglifyJS.AST_Array) { - options[name] = value.elements.map(to_string); - } else { - options[name] = to_string(value); - } - return true; - } - if (node instanceof UglifyJS.AST_Symbol || node instanceof UglifyJS.AST_PropAccess) { - var name = node.print_to_string(); - options[name] = true; - return true; - } - if (!(node instanceof UglifyJS.AST_Sequence)) throw node; - - function to_string(value) { - return value instanceof UglifyJS.AST_Constant ? value.getValue() : value.print_to_string({ - quote_keys: true - }); - } - })); - } catch(ex) { - if (flag) { - fatal("Error parsing arguments for '" + flag + "': " + value); - } else { - options[value] = null; - } - } - return options; - } -} - -function parse_source_map() { - var parse = parse_js(); - return function(value, options) { - var hasContent = options && "content" in options; - var settings = parse(value, options); - if (!hasContent && settings.content && settings.content != "inline") { - print_error("INFO: Using input source map: " + settings.content); - settings.content = read_file(settings.content, settings.content); - } - return settings; - } -} - -function skip_key(key) { - return skip_keys.indexOf(key) >= 0; -} - -function symdef(def) { - var ret = (1e6 + def.id) + " " + def.name; - if (def.mangled_name) ret += " " + def.mangled_name; - return ret; -} - -function format_object(obj) { - var lines = []; - var padding = ""; - Object.keys(obj).map(function(name) { - if (padding.length < name.length) padding = Array(name.length + 1).join(" "); - return [ name, JSON.stringify(obj[name]) ]; - }).forEach(function(tokens) { - lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]); - }); - return lines.join("\n"); -} - -function print_error(msg) { - process.stderr.write(msg); - process.stderr.write("\n"); -} - -function print(txt) { - process.stdout.write(txt); - process.stdout.write("\n"); -} - -function describe_ast() { - var out = UglifyJS.OutputStream({ beautify: true }); - function doitem(ctor) { - out.print("AST_" + ctor.TYPE); - var props = ctor.SELF_PROPS.filter(function(prop){ - return !/^\$/.test(prop); - }); - if (props.length > 0) { - out.space(); - out.with_parens(function(){ - props.forEach(function(prop, i){ - if (i) out.space(); - out.print(prop); - }); - }); - } - if (ctor.documentation) { - out.space(); - out.print_string(ctor.documentation); - } - if (ctor.SUBCLASSES.length > 0) { - out.space(); - out.with_block(function(){ - ctor.SUBCLASSES.forEach(function(ctor, i){ - out.indent(); - doitem(ctor); - out.newline(); - }); - }); - } - }; - doitem(UglifyJS.AST_Node); - return out + "\n"; -} diff --git a/tools/node_modules/terser/bin/uglifyjsnobundle b/tools/node_modules/terser/bin/uglifyjsnobundle deleted file mode 100755 index cee0841ea146..000000000000 --- a/tools/node_modules/terser/bin/uglifyjsnobundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -process.env.TERSER_NO_BUNDLE = '1' -require('./uglifyjs') diff --git a/tools/node_modules/terser/dist/.gitkeep b/tools/node_modules/terser/dist/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/tools/node_modules/terser/dist/bundle.js b/tools/node_modules/terser/dist/bundle.js deleted file mode 100644 index f8904a01e074..000000000000 --- a/tools/node_modules/terser/dist/bundle.js +++ /dev/null @@ -1,45 +0,0 @@ -!function(e){var t=["$&","$'","$*","$+","$1","$2","$3","$4","$5","$6","$7","$8","$9","$_","$`","$input","@@iterator","ABORT_ERR","ACTIVE","ACTIVE_ATTRIBUTES","ACTIVE_TEXTURE","ACTIVE_UNIFORMS","ADDITION","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","ALLOW_KEYBOARD_INPUT","ALLPASS","ALPHA","ALPHA_BITS","ALT_MASK","ALWAYS","ANY_TYPE","ANY_UNORDERED_NODE_TYPE","ARRAY_BUFFER","ARRAY_BUFFER_BINDING","ATTACHED_SHADERS","ATTRIBUTE_NODE","AT_TARGET","AddSearchProvider","AnalyserNode","AnimationEvent","AnonXMLHttpRequest","ApplicationCache","ApplicationCacheErrorEvent","Array","ArrayBuffer","Attr","Audio","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioListener","AudioNode","AudioParam","AudioProcessingEvent","AudioStreamTrack","AutocompleteErrorEvent","BACK","BAD_BOUNDARYPOINTS_ERR","BANDPASS","BLEND","BLEND_COLOR","BLEND_DST_ALPHA","BLEND_DST_RGB","BLEND_EQUATION","BLEND_EQUATION_ALPHA","BLEND_EQUATION_RGB","BLEND_SRC_ALPHA","BLEND_SRC_RGB","BLUE_BITS","BLUR","BOOL","BOOLEAN_TYPE","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","BOTH","BROWSER_DEFAULT_WEBGL","BUBBLING_PHASE","BUFFER_SIZE","BUFFER_USAGE","BYTE","BYTES_PER_ELEMENT","BarProp","BaseHref","BatteryManager","BeforeLoadEvent","BeforeUnloadEvent","BiquadFilterNode","Blob","BlobEvent","Boolean","CAPTURING_PHASE","CCW","CDATASection","CDATA_SECTION_NODE","CHANGE","CHARSET_RULE","CHECKING","CLAMP_TO_EDGE","CLICK","CLOSED","CLOSING","COLOR_ATTACHMENT0","COLOR_BUFFER_BIT","COLOR_CLEAR_VALUE","COLOR_WRITEMASK","COMMENT_NODE","COMPILE_STATUS","COMPRESSED_RGBA_S3TC_DXT1_EXT","COMPRESSED_RGBA_S3TC_DXT3_EXT","COMPRESSED_RGBA_S3TC_DXT5_EXT","COMPRESSED_RGB_S3TC_DXT1_EXT","COMPRESSED_TEXTURE_FORMATS","CONNECTING","CONSTANT_ALPHA","CONSTANT_COLOR","CONSTRAINT_ERR","CONTEXT_LOST_WEBGL","CONTROL_MASK","COUNTER_STYLE_RULE","CSS","CSS2Properties","CSSCharsetRule","CSSConditionRule","CSSCounterStyleRule","CSSFontFaceRule","CSSFontFeatureValuesRule","CSSGroupingRule","CSSImportRule","CSSKeyframeRule","CSSKeyframesRule","CSSMediaRule","CSSMozDocumentRule","CSSNameSpaceRule","CSSPageRule","CSSPrimitiveValue","CSSRule","CSSRuleList","CSSStyleDeclaration","CSSStyleRule","CSSStyleSheet","CSSSupportsRule","CSSUnknownRule","CSSValue","CSSValueList","CSSVariablesDeclaration","CSSVariablesRule","CSSViewportRule","CSS_ATTR","CSS_CM","CSS_COUNTER","CSS_CUSTOM","CSS_DEG","CSS_DIMENSION","CSS_EMS","CSS_EXS","CSS_FILTER_BLUR","CSS_FILTER_BRIGHTNESS","CSS_FILTER_CONTRAST","CSS_FILTER_CUSTOM","CSS_FILTER_DROP_SHADOW","CSS_FILTER_GRAYSCALE","CSS_FILTER_HUE_ROTATE","CSS_FILTER_INVERT","CSS_FILTER_OPACITY","CSS_FILTER_REFERENCE","CSS_FILTER_SATURATE","CSS_FILTER_SEPIA","CSS_GRAD","CSS_HZ","CSS_IDENT","CSS_IN","CSS_INHERIT","CSS_KHZ","CSS_MATRIX","CSS_MATRIX3D","CSS_MM","CSS_MS","CSS_NUMBER","CSS_PC","CSS_PERCENTAGE","CSS_PERSPECTIVE","CSS_PRIMITIVE_VALUE","CSS_PT","CSS_PX","CSS_RAD","CSS_RECT","CSS_RGBCOLOR","CSS_ROTATE","CSS_ROTATE3D","CSS_ROTATEX","CSS_ROTATEY","CSS_ROTATEZ","CSS_S","CSS_SCALE","CSS_SCALE3D","CSS_SCALEX","CSS_SCALEY","CSS_SCALEZ","CSS_SKEW","CSS_SKEWX","CSS_SKEWY","CSS_STRING","CSS_TRANSLATE","CSS_TRANSLATE3D","CSS_TRANSLATEX","CSS_TRANSLATEY","CSS_TRANSLATEZ","CSS_UNKNOWN","CSS_URI","CSS_VALUE_LIST","CSS_VH","CSS_VMAX","CSS_VMIN","CSS_VW","CULL_FACE","CULL_FACE_MODE","CURRENT_PROGRAM","CURRENT_VERTEX_ATTRIB","CUSTOM","CW","CanvasGradient","CanvasPattern","CanvasRenderingContext2D","CaretPosition","ChannelMergerNode","ChannelSplitterNode","CharacterData","ClientRect","ClientRectList","Clipboard","ClipboardEvent","CloseEvent","Collator","CommandEvent","Comment","CompositionEvent","Console","Controllers","ConvolverNode","Counter","Crypto","CryptoKey","CustomEvent","DATABASE_ERR","DATA_CLONE_ERR","DATA_ERR","DBLCLICK","DECR","DECR_WRAP","DELETE_STATUS","DEPTH_ATTACHMENT","DEPTH_BITS","DEPTH_BUFFER_BIT","DEPTH_CLEAR_VALUE","DEPTH_COMPONENT","DEPTH_COMPONENT16","DEPTH_FUNC","DEPTH_RANGE","DEPTH_STENCIL","DEPTH_STENCIL_ATTACHMENT","DEPTH_TEST","DEPTH_WRITEMASK","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DISABLED","DISPATCH_REQUEST_ERR","DITHER","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC","DOCUMENT_POSITION_PRECEDING","DOCUMENT_TYPE_NODE","DOMCursor","DOMError","DOMException","DOMImplementation","DOMImplementationLS","DOMMatrix","DOMMatrixReadOnly","DOMParser","DOMPoint","DOMPointReadOnly","DOMQuad","DOMRect","DOMRectList","DOMRectReadOnly","DOMRequest","DOMSTRING_SIZE_ERR","DOMSettableTokenList","DOMStringList","DOMStringMap","DOMTokenList","DOMTransactionEvent","DOM_DELTA_LINE","DOM_DELTA_PAGE","DOM_DELTA_PIXEL","DOM_INPUT_METHOD_DROP","DOM_INPUT_METHOD_HANDWRITING","DOM_INPUT_METHOD_IME","DOM_INPUT_METHOD_KEYBOARD","DOM_INPUT_METHOD_MULTIMODAL","DOM_INPUT_METHOD_OPTION","DOM_INPUT_METHOD_PASTE","DOM_INPUT_METHOD_SCRIPT","DOM_INPUT_METHOD_UNKNOWN","DOM_INPUT_METHOD_VOICE","DOM_KEY_LOCATION_JOYSTICK","DOM_KEY_LOCATION_LEFT","DOM_KEY_LOCATION_MOBILE","DOM_KEY_LOCATION_NUMPAD","DOM_KEY_LOCATION_RIGHT","DOM_KEY_LOCATION_STANDARD","DOM_VK_0","DOM_VK_1","DOM_VK_2","DOM_VK_3","DOM_VK_4","DOM_VK_5","DOM_VK_6","DOM_VK_7","DOM_VK_8","DOM_VK_9","DOM_VK_A","DOM_VK_ACCEPT","DOM_VK_ADD","DOM_VK_ALT","DOM_VK_ALTGR","DOM_VK_AMPERSAND","DOM_VK_ASTERISK","DOM_VK_AT","DOM_VK_ATTN","DOM_VK_B","DOM_VK_BACKSPACE","DOM_VK_BACK_QUOTE","DOM_VK_BACK_SLASH","DOM_VK_BACK_SPACE","DOM_VK_C","DOM_VK_CANCEL","DOM_VK_CAPS_LOCK","DOM_VK_CIRCUMFLEX","DOM_VK_CLEAR","DOM_VK_CLOSE_BRACKET","DOM_VK_CLOSE_CURLY_BRACKET","DOM_VK_CLOSE_PAREN","DOM_VK_COLON","DOM_VK_COMMA","DOM_VK_CONTEXT_MENU","DOM_VK_CONTROL","DOM_VK_CONVERT","DOM_VK_CRSEL","DOM_VK_CTRL","DOM_VK_D","DOM_VK_DECIMAL","DOM_VK_DELETE","DOM_VK_DIVIDE","DOM_VK_DOLLAR","DOM_VK_DOUBLE_QUOTE","DOM_VK_DOWN","DOM_VK_E","DOM_VK_EISU","DOM_VK_END","DOM_VK_ENTER","DOM_VK_EQUALS","DOM_VK_EREOF","DOM_VK_ESCAPE","DOM_VK_EXCLAMATION","DOM_VK_EXECUTE","DOM_VK_EXSEL","DOM_VK_F","DOM_VK_F1","DOM_VK_F10","DOM_VK_F11","DOM_VK_F12","DOM_VK_F13","DOM_VK_F14","DOM_VK_F15","DOM_VK_F16","DOM_VK_F17","DOM_VK_F18","DOM_VK_F19","DOM_VK_F2","DOM_VK_F20","DOM_VK_F21","DOM_VK_F22","DOM_VK_F23","DOM_VK_F24","DOM_VK_F25","DOM_VK_F26","DOM_VK_F27","DOM_VK_F28","DOM_VK_F29","DOM_VK_F3","DOM_VK_F30","DOM_VK_F31","DOM_VK_F32","DOM_VK_F33","DOM_VK_F34","DOM_VK_F35","DOM_VK_F36","DOM_VK_F4","DOM_VK_F5","DOM_VK_F6","DOM_VK_F7","DOM_VK_F8","DOM_VK_F9","DOM_VK_FINAL","DOM_VK_FRONT","DOM_VK_G","DOM_VK_GREATER_THAN","DOM_VK_H","DOM_VK_HANGUL","DOM_VK_HANJA","DOM_VK_HASH","DOM_VK_HELP","DOM_VK_HK_TOGGLE","DOM_VK_HOME","DOM_VK_HYPHEN_MINUS","DOM_VK_I","DOM_VK_INSERT","DOM_VK_J","DOM_VK_JUNJA","DOM_VK_K","DOM_VK_KANA","DOM_VK_KANJI","DOM_VK_L","DOM_VK_LEFT","DOM_VK_LEFT_TAB","DOM_VK_LESS_THAN","DOM_VK_M","DOM_VK_META","DOM_VK_MODECHANGE","DOM_VK_MULTIPLY","DOM_VK_N","DOM_VK_NONCONVERT","DOM_VK_NUMPAD0","DOM_VK_NUMPAD1","DOM_VK_NUMPAD2","DOM_VK_NUMPAD3","DOM_VK_NUMPAD4","DOM_VK_NUMPAD5","DOM_VK_NUMPAD6","DOM_VK_NUMPAD7","DOM_VK_NUMPAD8","DOM_VK_NUMPAD9","DOM_VK_NUM_LOCK","DOM_VK_O","DOM_VK_OEM_1","DOM_VK_OEM_102","DOM_VK_OEM_2","DOM_VK_OEM_3","DOM_VK_OEM_4","DOM_VK_OEM_5","DOM_VK_OEM_6","DOM_VK_OEM_7","DOM_VK_OEM_8","DOM_VK_OEM_COMMA","DOM_VK_OEM_MINUS","DOM_VK_OEM_PERIOD","DOM_VK_OEM_PLUS","DOM_VK_OPEN_BRACKET","DOM_VK_OPEN_CURLY_BRACKET","DOM_VK_OPEN_PAREN","DOM_VK_P","DOM_VK_PA1","DOM_VK_PAGEDOWN","DOM_VK_PAGEUP","DOM_VK_PAGE_DOWN","DOM_VK_PAGE_UP","DOM_VK_PAUSE","DOM_VK_PERCENT","DOM_VK_PERIOD","DOM_VK_PIPE","DOM_VK_PLAY","DOM_VK_PLUS","DOM_VK_PRINT","DOM_VK_PRINTSCREEN","DOM_VK_PROCESSKEY","DOM_VK_PROPERITES","DOM_VK_Q","DOM_VK_QUESTION_MARK","DOM_VK_QUOTE","DOM_VK_R","DOM_VK_REDO","DOM_VK_RETURN","DOM_VK_RIGHT","DOM_VK_S","DOM_VK_SCROLL_LOCK","DOM_VK_SELECT","DOM_VK_SEMICOLON","DOM_VK_SEPARATOR","DOM_VK_SHIFT","DOM_VK_SLASH","DOM_VK_SLEEP","DOM_VK_SPACE","DOM_VK_SUBTRACT","DOM_VK_T","DOM_VK_TAB","DOM_VK_TILDE","DOM_VK_U","DOM_VK_UNDERSCORE","DOM_VK_UNDO","DOM_VK_UNICODE","DOM_VK_UP","DOM_VK_V","DOM_VK_VOLUME_DOWN","DOM_VK_VOLUME_MUTE","DOM_VK_VOLUME_UP","DOM_VK_W","DOM_VK_WIN","DOM_VK_WINDOW","DOM_VK_WIN_ICO_00","DOM_VK_WIN_ICO_CLEAR","DOM_VK_WIN_ICO_HELP","DOM_VK_WIN_OEM_ATTN","DOM_VK_WIN_OEM_AUTO","DOM_VK_WIN_OEM_BACKTAB","DOM_VK_WIN_OEM_CLEAR","DOM_VK_WIN_OEM_COPY","DOM_VK_WIN_OEM_CUSEL","DOM_VK_WIN_OEM_ENLW","DOM_VK_WIN_OEM_FINISH","DOM_VK_WIN_OEM_FJ_JISHO","DOM_VK_WIN_OEM_FJ_LOYA","DOM_VK_WIN_OEM_FJ_MASSHOU","DOM_VK_WIN_OEM_FJ_ROYA","DOM_VK_WIN_OEM_FJ_TOUROKU","DOM_VK_WIN_OEM_JUMP","DOM_VK_WIN_OEM_PA1","DOM_VK_WIN_OEM_PA2","DOM_VK_WIN_OEM_PA3","DOM_VK_WIN_OEM_RESET","DOM_VK_WIN_OEM_WSCTRL","DOM_VK_X","DOM_VK_XF86XK_ADD_FAVORITE","DOM_VK_XF86XK_APPLICATION_LEFT","DOM_VK_XF86XK_APPLICATION_RIGHT","DOM_VK_XF86XK_AUDIO_CYCLE_TRACK","DOM_VK_XF86XK_AUDIO_FORWARD","DOM_VK_XF86XK_AUDIO_LOWER_VOLUME","DOM_VK_XF86XK_AUDIO_MEDIA","DOM_VK_XF86XK_AUDIO_MUTE","DOM_VK_XF86XK_AUDIO_NEXT","DOM_VK_XF86XK_AUDIO_PAUSE","DOM_VK_XF86XK_AUDIO_PLAY","DOM_VK_XF86XK_AUDIO_PREV","DOM_VK_XF86XK_AUDIO_RAISE_VOLUME","DOM_VK_XF86XK_AUDIO_RANDOM_PLAY","DOM_VK_XF86XK_AUDIO_RECORD","DOM_VK_XF86XK_AUDIO_REPEAT","DOM_VK_XF86XK_AUDIO_REWIND","DOM_VK_XF86XK_AUDIO_STOP","DOM_VK_XF86XK_AWAY","DOM_VK_XF86XK_BACK","DOM_VK_XF86XK_BACK_FORWARD","DOM_VK_XF86XK_BATTERY","DOM_VK_XF86XK_BLUE","DOM_VK_XF86XK_BLUETOOTH","DOM_VK_XF86XK_BOOK","DOM_VK_XF86XK_BRIGHTNESS_ADJUST","DOM_VK_XF86XK_CALCULATOR","DOM_VK_XF86XK_CALENDAR","DOM_VK_XF86XK_CD","DOM_VK_XF86XK_CLOSE","DOM_VK_XF86XK_COMMUNITY","DOM_VK_XF86XK_CONTRAST_ADJUST","DOM_VK_XF86XK_COPY","DOM_VK_XF86XK_CUT","DOM_VK_XF86XK_CYCLE_ANGLE","DOM_VK_XF86XK_DISPLAY","DOM_VK_XF86XK_DOCUMENTS","DOM_VK_XF86XK_DOS","DOM_VK_XF86XK_EJECT","DOM_VK_XF86XK_EXCEL","DOM_VK_XF86XK_EXPLORER","DOM_VK_XF86XK_FAVORITES","DOM_VK_XF86XK_FINANCE","DOM_VK_XF86XK_FORWARD","DOM_VK_XF86XK_FRAME_BACK","DOM_VK_XF86XK_FRAME_FORWARD","DOM_VK_XF86XK_GAME","DOM_VK_XF86XK_GO","DOM_VK_XF86XK_GREEN","DOM_VK_XF86XK_HIBERNATE","DOM_VK_XF86XK_HISTORY","DOM_VK_XF86XK_HOME_PAGE","DOM_VK_XF86XK_HOT_LINKS","DOM_VK_XF86XK_I_TOUCH","DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN","DOM_VK_XF86XK_KBD_BRIGHTNESS_UP","DOM_VK_XF86XK_KBD_LIGHT_ON_OFF","DOM_VK_XF86XK_LAUNCH0","DOM_VK_XF86XK_LAUNCH1","DOM_VK_XF86XK_LAUNCH2","DOM_VK_XF86XK_LAUNCH3","DOM_VK_XF86XK_LAUNCH4","DOM_VK_XF86XK_LAUNCH5","DOM_VK_XF86XK_LAUNCH6","DOM_VK_XF86XK_LAUNCH7","DOM_VK_XF86XK_LAUNCH8","DOM_VK_XF86XK_LAUNCH9","DOM_VK_XF86XK_LAUNCH_A","DOM_VK_XF86XK_LAUNCH_B","DOM_VK_XF86XK_LAUNCH_C","DOM_VK_XF86XK_LAUNCH_D","DOM_VK_XF86XK_LAUNCH_E","DOM_VK_XF86XK_LAUNCH_F","DOM_VK_XF86XK_LIGHT_BULB","DOM_VK_XF86XK_LOG_OFF","DOM_VK_XF86XK_MAIL","DOM_VK_XF86XK_MAIL_FORWARD","DOM_VK_XF86XK_MARKET","DOM_VK_XF86XK_MEETING","DOM_VK_XF86XK_MEMO","DOM_VK_XF86XK_MENU_KB","DOM_VK_XF86XK_MENU_PB","DOM_VK_XF86XK_MESSENGER","DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN","DOM_VK_XF86XK_MON_BRIGHTNESS_UP","DOM_VK_XF86XK_MUSIC","DOM_VK_XF86XK_MY_COMPUTER","DOM_VK_XF86XK_MY_SITES","DOM_VK_XF86XK_NEW","DOM_VK_XF86XK_NEWS","DOM_VK_XF86XK_OFFICE_HOME","DOM_VK_XF86XK_OPEN","DOM_VK_XF86XK_OPEN_URL","DOM_VK_XF86XK_OPTION","DOM_VK_XF86XK_PASTE","DOM_VK_XF86XK_PHONE","DOM_VK_XF86XK_PICTURES","DOM_VK_XF86XK_POWER_DOWN","DOM_VK_XF86XK_POWER_OFF","DOM_VK_XF86XK_RED","DOM_VK_XF86XK_REFRESH","DOM_VK_XF86XK_RELOAD","DOM_VK_XF86XK_REPLY","DOM_VK_XF86XK_ROCKER_DOWN","DOM_VK_XF86XK_ROCKER_ENTER","DOM_VK_XF86XK_ROCKER_UP","DOM_VK_XF86XK_ROTATE_WINDOWS","DOM_VK_XF86XK_ROTATION_KB","DOM_VK_XF86XK_ROTATION_PB","DOM_VK_XF86XK_SAVE","DOM_VK_XF86XK_SCREEN_SAVER","DOM_VK_XF86XK_SCROLL_CLICK","DOM_VK_XF86XK_SCROLL_DOWN","DOM_VK_XF86XK_SCROLL_UP","DOM_VK_XF86XK_SEARCH","DOM_VK_XF86XK_SEND","DOM_VK_XF86XK_SHOP","DOM_VK_XF86XK_SPELL","DOM_VK_XF86XK_SPLIT_SCREEN","DOM_VK_XF86XK_STANDBY","DOM_VK_XF86XK_START","DOM_VK_XF86XK_STOP","DOM_VK_XF86XK_SUBTITLE","DOM_VK_XF86XK_SUPPORT","DOM_VK_XF86XK_SUSPEND","DOM_VK_XF86XK_TASK_PANE","DOM_VK_XF86XK_TERMINAL","DOM_VK_XF86XK_TIME","DOM_VK_XF86XK_TOOLS","DOM_VK_XF86XK_TOP_MENU","DOM_VK_XF86XK_TO_DO_LIST","DOM_VK_XF86XK_TRAVEL","DOM_VK_XF86XK_USER1KB","DOM_VK_XF86XK_USER2KB","DOM_VK_XF86XK_USER_PB","DOM_VK_XF86XK_UWB","DOM_VK_XF86XK_VENDOR_HOME","DOM_VK_XF86XK_VIDEO","DOM_VK_XF86XK_VIEW","DOM_VK_XF86XK_WAKE_UP","DOM_VK_XF86XK_WEB_CAM","DOM_VK_XF86XK_WHEEL_BUTTON","DOM_VK_XF86XK_WLAN","DOM_VK_XF86XK_WORD","DOM_VK_XF86XK_WWW","DOM_VK_XF86XK_XFER","DOM_VK_XF86XK_YELLOW","DOM_VK_XF86XK_ZOOM_IN","DOM_VK_XF86XK_ZOOM_OUT","DOM_VK_Y","DOM_VK_Z","DOM_VK_ZOOM","DONE","DONT_CARE","DOWNLOADING","DRAGDROP","DST_ALPHA","DST_COLOR","DYNAMIC_DRAW","DataChannel","DataTransfer","DataTransferItem","DataTransferItemList","DataView","Date","DateTimeFormat","DelayNode","DesktopNotification","DesktopNotificationCenter","DeviceLightEvent","DeviceMotionEvent","DeviceOrientationEvent","DeviceProximityEvent","DeviceStorage","DeviceStorageChangeEvent","Document","DocumentFragment","DocumentType","DragEvent","DynamicsCompressorNode","E","ELEMENT_ARRAY_BUFFER","ELEMENT_ARRAY_BUFFER_BINDING","ELEMENT_NODE","EMPTY","ENCODING_ERR","ENDED","END_TO_END","END_TO_START","ENTITY_NODE","ENTITY_REFERENCE_NODE","EPSILON","EQUAL","EQUALPOWER","ERROR","EXPONENTIAL_DISTANCE","Element","ElementQuery","Entity","EntityReference","Error","ErrorEvent","EvalError","Event","EventException","EventSource","EventTarget","External","FASTEST","FIDOSDK","FILTER_ACCEPT","FILTER_INTERRUPT","FILTER_REJECT","FILTER_SKIP","FINISHED_STATE","FIRST_ORDERED_NODE_TYPE","FLOAT","FLOAT_MAT2","FLOAT_MAT3","FLOAT_MAT4","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","FOCUS","FONT_FACE_RULE","FONT_FEATURE_VALUES_RULE","FRAGMENT_SHADER","FRAGMENT_SHADER_DERIVATIVE_HINT_OES","FRAMEBUFFER","FRAMEBUFFER_ATTACHMENT_OBJECT_NAME","FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE","FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE","FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL","FRAMEBUFFER_BINDING","FRAMEBUFFER_COMPLETE","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_UNSUPPORTED","FRONT","FRONT_AND_BACK","FRONT_FACE","FUNC_ADD","FUNC_REVERSE_SUBTRACT","FUNC_SUBTRACT","Feed","FeedEntry","File","FileError","FileList","FileReader","FindInPage","Float32Array","Float64Array","FocusEvent","FontFace","FormData","Function","GENERATE_MIPMAP_HINT","GEQUAL","GREATER","GREEN_BITS","GainNode","Gamepad","GamepadButton","GamepadEvent","GestureEvent","HAVE_CURRENT_DATA","HAVE_ENOUGH_DATA","HAVE_FUTURE_DATA","HAVE_METADATA","HAVE_NOTHING","HEADERS_RECEIVED","HIDDEN","HIERARCHY_REQUEST_ERR","HIGHPASS","HIGHSHELF","HIGH_FLOAT","HIGH_INT","HORIZONTAL","HORIZONTAL_AXIS","HRTF","HTMLAllCollection","HTMLAnchorElement","HTMLAppletElement","HTMLAreaElement","HTMLAudioElement","HTMLBRElement","HTMLBaseElement","HTMLBaseFontElement","HTMLBlockquoteElement","HTMLBodyElement","HTMLButtonElement","HTMLCanvasElement","HTMLCollection","HTMLCommandElement","HTMLContentElement","HTMLDListElement","HTMLDataElement","HTMLDataListElement","HTMLDetailsElement","HTMLDialogElement","HTMLDirectoryElement","HTMLDivElement","HTMLDocument","HTMLElement","HTMLEmbedElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormControlsCollection","HTMLFormElement","HTMLFrameElement","HTMLFrameSetElement","HTMLHRElement","HTMLHeadElement","HTMLHeadingElement","HTMLHtmlElement","HTMLIFrameElement","HTMLImageElement","HTMLInputElement","HTMLIsIndexElement","HTMLKeygenElement","HTMLLIElement","HTMLLabelElement","HTMLLegendElement","HTMLLinkElement","HTMLMapElement","HTMLMarqueeElement","HTMLMediaElement","HTMLMenuElement","HTMLMenuItemElement","HTMLMetaElement","HTMLMeterElement","HTMLModElement","HTMLOListElement","HTMLObjectElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOptionsCollection","HTMLOutputElement","HTMLParagraphElement","HTMLParamElement","HTMLPictureElement","HTMLPreElement","HTMLProgressElement","HTMLPropertiesCollection","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLShadowElement","HTMLSourceElement","HTMLSpanElement","HTMLStyleElement","HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTableRowElement","HTMLTableSectionElement","HTMLTemplateElement","HTMLTextAreaElement","HTMLTimeElement","HTMLTitleElement","HTMLTrackElement","HTMLUListElement","HTMLUnknownElement","HTMLVideoElement","HashChangeEvent","Headers","History","ICE_CHECKING","ICE_CLOSED","ICE_COMPLETED","ICE_CONNECTED","ICE_FAILED","ICE_GATHERING","ICE_WAITING","IDBCursor","IDBCursorWithValue","IDBDatabase","IDBDatabaseException","IDBFactory","IDBFileHandle","IDBFileRequest","IDBIndex","IDBKeyRange","IDBMutableFile","IDBObjectStore","IDBOpenDBRequest","IDBRequest","IDBTransaction","IDBVersionChangeEvent","IDLE","IMPLEMENTATION_COLOR_READ_FORMAT","IMPLEMENTATION_COLOR_READ_TYPE","IMPORT_RULE","INCR","INCR_WRAP","INDEX_SIZE_ERR","INT","INT_VEC2","INT_VEC3","INT_VEC4","INUSE_ATTRIBUTE_ERR","INVALID_ACCESS_ERR","INVALID_CHARACTER_ERR","INVALID_ENUM","INVALID_EXPRESSION_ERR","INVALID_FRAMEBUFFER_OPERATION","INVALID_MODIFICATION_ERR","INVALID_NODE_TYPE_ERR","INVALID_OPERATION","INVALID_STATE_ERR","INVALID_VALUE","INVERSE_DISTANCE","INVERT","IceCandidate","Image","ImageBitmap","ImageData","Infinity","InputEvent","InputMethodContext","InstallTrigger","Int16Array","Int32Array","Int8Array","Intent","InternalError","Intl","IsSearchProviderInstalled","Iterator","JSON","KEEP","KEYDOWN","KEYFRAMES_RULE","KEYFRAME_RULE","KEYPRESS","KEYUP","KeyEvent","KeyboardEvent","LENGTHADJUST_SPACING","LENGTHADJUST_SPACINGANDGLYPHS","LENGTHADJUST_UNKNOWN","LEQUAL","LESS","LINEAR","LINEAR_DISTANCE","LINEAR_MIPMAP_LINEAR","LINEAR_MIPMAP_NEAREST","LINES","LINE_LOOP","LINE_STRIP","LINE_WIDTH","LINK_STATUS","LIVE","LN10","LN2","LOADED","LOADING","LOG10E","LOG2E","LOWPASS","LOWSHELF","LOW_FLOAT","LOW_INT","LSException","LSParserFilter","LUMINANCE","LUMINANCE_ALPHA","LocalMediaStream","Location","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_RENDERBUFFER_SIZE","MAX_SAFE_INTEGER","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_MAX_ANISOTROPY_EXT","MAX_TEXTURE_SIZE","MAX_VALUE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","MAX_VIEWPORT_DIMS","MEDIA_ERR_ABORTED","MEDIA_ERR_DECODE","MEDIA_ERR_ENCRYPTED","MEDIA_ERR_NETWORK","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_KEYERR_CLIENT","MEDIA_KEYERR_DOMAIN","MEDIA_KEYERR_HARDWARECHANGE","MEDIA_KEYERR_OUTPUT","MEDIA_KEYERR_SERVICE","MEDIA_KEYERR_UNKNOWN","MEDIA_RULE","MEDIUM_FLOAT","MEDIUM_INT","META_MASK","MIN_SAFE_INTEGER","MIN_VALUE","MIRRORED_REPEAT","MODE_ASYNCHRONOUS","MODE_SYNCHRONOUS","MODIFICATION","MOUSEDOWN","MOUSEDRAG","MOUSEMOVE","MOUSEOUT","MOUSEOVER","MOUSEUP","MOZ_KEYFRAMES_RULE","MOZ_KEYFRAME_RULE","MOZ_SOURCE_CURSOR","MOZ_SOURCE_ERASER","MOZ_SOURCE_KEYBOARD","MOZ_SOURCE_MOUSE","MOZ_SOURCE_PEN","MOZ_SOURCE_TOUCH","MOZ_SOURCE_UNKNOWN","MSGESTURE_FLAG_BEGIN","MSGESTURE_FLAG_CANCEL","MSGESTURE_FLAG_END","MSGESTURE_FLAG_INERTIA","MSGESTURE_FLAG_NONE","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_PEN","MSPOINTER_TYPE_TOUCH","MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE","MS_ASYNC_CALLBACK_STATUS_CANCEL","MS_ASYNC_CALLBACK_STATUS_CHOOSEANY","MS_ASYNC_CALLBACK_STATUS_ERROR","MS_ASYNC_CALLBACK_STATUS_JOIN","MS_ASYNC_OP_STATUS_CANCELED","MS_ASYNC_OP_STATUS_ERROR","MS_ASYNC_OP_STATUS_SUCCESS","MS_MANIPULATION_STATE_ACTIVE","MS_MANIPULATION_STATE_CANCELLED","MS_MANIPULATION_STATE_COMMITTED","MS_MANIPULATION_STATE_DRAGGING","MS_MANIPULATION_STATE_INERTIA","MS_MANIPULATION_STATE_PRESELECT","MS_MANIPULATION_STATE_SELECTING","MS_MANIPULATION_STATE_STOPPED","MS_MEDIA_ERR_ENCRYPTED","MS_MEDIA_KEYERR_CLIENT","MS_MEDIA_KEYERR_DOMAIN","MS_MEDIA_KEYERR_HARDWARECHANGE","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_SERVICE","MS_MEDIA_KEYERR_UNKNOWN","Map","Math","MediaController","MediaDevices","MediaElementAudioSourceNode","MediaEncryptedEvent","MediaError","MediaKeyError","MediaKeyEvent","MediaKeyMessageEvent","MediaKeyNeededEvent","MediaKeySession","MediaKeyStatusMap","MediaKeySystemAccess","MediaKeys","MediaList","MediaQueryList","MediaQueryListEvent","MediaRecorder","MediaSource","MediaStream","MediaStreamAudioDestinationNode","MediaStreamAudioSourceNode","MediaStreamEvent","MediaStreamTrack","MediaStreamTrackEvent","MessageChannel","MessageEvent","MessagePort","Methods","MimeType","MimeTypeArray","MouseEvent","MouseScrollEvent","MozAnimation","MozAnimationDelay","MozAnimationDirection","MozAnimationDuration","MozAnimationFillMode","MozAnimationIterationCount","MozAnimationName","MozAnimationPlayState","MozAnimationTimingFunction","MozAppearance","MozBackfaceVisibility","MozBinding","MozBorderBottomColors","MozBorderEnd","MozBorderEndColor","MozBorderEndStyle","MozBorderEndWidth","MozBorderImage","MozBorderLeftColors","MozBorderRightColors","MozBorderStart","MozBorderStartColor","MozBorderStartStyle","MozBorderStartWidth","MozBorderTopColors","MozBoxAlign","MozBoxDirection","MozBoxFlex","MozBoxOrdinalGroup","MozBoxOrient","MozBoxPack","MozBoxSizing","MozCSSKeyframeRule","MozCSSKeyframesRule","MozColumnCount","MozColumnFill","MozColumnGap","MozColumnRule","MozColumnRuleColor","MozColumnRuleStyle","MozColumnRuleWidth","MozColumnWidth","MozColumns","MozContactChangeEvent","MozFloatEdge","MozFontFeatureSettings","MozFontLanguageOverride","MozForceBrokenImageIcon","MozHyphens","MozImageRegion","MozMarginEnd","MozMarginStart","MozMmsEvent","MozMmsMessage","MozMobileMessageThread","MozOSXFontSmoothing","MozOrient","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright","MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozPaddingEnd","MozPaddingStart","MozPerspective","MozPerspectiveOrigin","MozPowerManager","MozSettingsEvent","MozSmsEvent","MozSmsMessage","MozStackSizing","MozTabSize","MozTextAlignLast","MozTextDecorationColor","MozTextDecorationLine","MozTextDecorationStyle","MozTextSizeAdjust","MozTransform","MozTransformOrigin","MozTransformStyle","MozTransition","MozTransitionDelay","MozTransitionDuration","MozTransitionProperty","MozTransitionTimingFunction","MozUserFocus","MozUserInput","MozUserModify","MozUserSelect","MozWindowDragging","MozWindowShadow","MutationEvent","MutationObserver","MutationRecord","NAMESPACE_ERR","NAMESPACE_RULE","NEAREST","NEAREST_MIPMAP_LINEAR","NEAREST_MIPMAP_NEAREST","NEGATIVE_INFINITY","NETWORK_EMPTY","NETWORK_ERR","NETWORK_IDLE","NETWORK_LOADED","NETWORK_LOADING","NETWORK_NO_SOURCE","NEVER","NEW","NEXT","NEXT_NO_DUPLICATE","NICEST","NODE_AFTER","NODE_BEFORE","NODE_BEFORE_AND_AFTER","NODE_INSIDE","NONE","NON_TRANSIENT_ERR","NOTATION_NODE","NOTCH","NOTEQUAL","NOT_ALLOWED_ERR","NOT_FOUND_ERR","NOT_READABLE_ERR","NOT_SUPPORTED_ERR","NO_DATA_ALLOWED_ERR","NO_ERR","NO_ERROR","NO_MODIFICATION_ALLOWED_ERR","NUMBER_TYPE","NUM_COMPRESSED_TEXTURE_FORMATS","NaN","NamedNodeMap","Navigator","NearbyLinks","NetworkInformation","Node","NodeFilter","NodeIterator","NodeList","Notation","Notification","NotifyPaintEvent","Number","NumberFormat","OBSOLETE","ONE","ONE_MINUS_CONSTANT_ALPHA","ONE_MINUS_CONSTANT_COLOR","ONE_MINUS_DST_ALPHA","ONE_MINUS_DST_COLOR","ONE_MINUS_SRC_ALPHA","ONE_MINUS_SRC_COLOR","OPEN","OPENED","OPENING","ORDERED_NODE_ITERATOR_TYPE","ORDERED_NODE_SNAPSHOT_TYPE","OUT_OF_MEMORY","Object","OfflineAudioCompletionEvent","OfflineAudioContext","OfflineResourceList","Option","OscillatorNode","OverflowEvent","PACK_ALIGNMENT","PAGE_RULE","PARSE_ERR","PATHSEG_ARC_ABS","PATHSEG_ARC_REL","PATHSEG_CLOSEPATH","PATHSEG_CURVETO_CUBIC_ABS","PATHSEG_CURVETO_CUBIC_REL","PATHSEG_CURVETO_CUBIC_SMOOTH_ABS","PATHSEG_CURVETO_CUBIC_SMOOTH_REL","PATHSEG_CURVETO_QUADRATIC_ABS","PATHSEG_CURVETO_QUADRATIC_REL","PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS","PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL","PATHSEG_LINETO_ABS","PATHSEG_LINETO_HORIZONTAL_ABS","PATHSEG_LINETO_HORIZONTAL_REL","PATHSEG_LINETO_REL","PATHSEG_LINETO_VERTICAL_ABS","PATHSEG_LINETO_VERTICAL_REL","PATHSEG_MOVETO_ABS","PATHSEG_MOVETO_REL","PATHSEG_UNKNOWN","PATH_EXISTS_ERR","PEAKING","PERMISSION_DENIED","PERSISTENT","PI","PLAYING_STATE","POINTS","POLYGON_OFFSET_FACTOR","POLYGON_OFFSET_FILL","POLYGON_OFFSET_UNITS","POSITION_UNAVAILABLE","POSITIVE_INFINITY","PREV","PREV_NO_DUPLICATE","PROCESSING_INSTRUCTION_NODE","PageChangeEvent","PageTransitionEvent","PaintRequest","PaintRequestList","PannerNode","Path2D","Performance","PerformanceEntry","PerformanceMark","PerformanceMeasure","PerformanceNavigation","PerformanceResourceTiming","PerformanceTiming","PeriodicWave","Plugin","PluginArray","PopStateEvent","PopupBlockedEvent","ProcessingInstruction","ProgressEvent","Promise","PropertyNodeList","Proxy","PushManager","PushSubscription","Q","QUOTA_ERR","QUOTA_EXCEEDED_ERR","QueryInterface","READ_ONLY","READ_ONLY_ERR","READ_WRITE","RED_BITS","REMOVAL","RENDERBUFFER","RENDERBUFFER_ALPHA_SIZE","RENDERBUFFER_BINDING","RENDERBUFFER_BLUE_SIZE","RENDERBUFFER_DEPTH_SIZE","RENDERBUFFER_GREEN_SIZE","RENDERBUFFER_HEIGHT","RENDERBUFFER_INTERNAL_FORMAT","RENDERBUFFER_RED_SIZE","RENDERBUFFER_STENCIL_SIZE","RENDERBUFFER_WIDTH","RENDERER","RENDERING_INTENT_ABSOLUTE_COLORIMETRIC","RENDERING_INTENT_AUTO","RENDERING_INTENT_PERCEPTUAL","RENDERING_INTENT_RELATIVE_COLORIMETRIC","RENDERING_INTENT_SATURATION","RENDERING_INTENT_UNKNOWN","REPEAT","REPLACE","RGB","RGB565","RGB5_A1","RGBA","RGBA4","RGBColor","ROTATION_CLOCKWISE","ROTATION_COUNTERCLOCKWISE","RTCDataChannelEvent","RTCIceCandidate","RTCPeerConnectionIceEvent","RTCRtpReceiver","RTCRtpSender","RTCSessionDescription","RTCStatsReport","RadioNodeList","Range","RangeError","RangeException","RecordErrorEvent","Rect","ReferenceError","RegExp","Request","Response","SAMPLER_2D","SAMPLER_CUBE","SAMPLES","SAMPLE_ALPHA_TO_COVERAGE","SAMPLE_BUFFERS","SAMPLE_COVERAGE","SAMPLE_COVERAGE_INVERT","SAMPLE_COVERAGE_VALUE","SAWTOOTH","SCHEDULED_STATE","SCISSOR_BOX","SCISSOR_TEST","SCROLL_PAGE_DOWN","SCROLL_PAGE_UP","SDP_ANSWER","SDP_OFFER","SDP_PRANSWER","SECURITY_ERR","SELECT","SERIALIZE_ERR","SEVERITY_ERROR","SEVERITY_FATAL_ERROR","SEVERITY_WARNING","SHADER_COMPILER","SHADER_TYPE","SHADING_LANGUAGE_VERSION","SHIFT_MASK","SHORT","SHOWING","SHOW_ALL","SHOW_ATTRIBUTE","SHOW_CDATA_SECTION","SHOW_COMMENT","SHOW_DOCUMENT","SHOW_DOCUMENT_FRAGMENT","SHOW_DOCUMENT_TYPE","SHOW_ELEMENT","SHOW_ENTITY","SHOW_ENTITY_REFERENCE","SHOW_NOTATION","SHOW_PROCESSING_INSTRUCTION","SHOW_TEXT","SINE","SOUNDFIELD","SQLException","SQRT1_2","SQRT2","SQUARE","SRC_ALPHA","SRC_ALPHA_SATURATE","SRC_COLOR","START_TO_END","START_TO_START","STATIC_DRAW","STENCIL_ATTACHMENT","STENCIL_BACK_FAIL","STENCIL_BACK_FUNC","STENCIL_BACK_PASS_DEPTH_FAIL","STENCIL_BACK_PASS_DEPTH_PASS","STENCIL_BACK_REF","STENCIL_BACK_VALUE_MASK","STENCIL_BACK_WRITEMASK","STENCIL_BITS","STENCIL_BUFFER_BIT","STENCIL_CLEAR_VALUE","STENCIL_FAIL","STENCIL_FUNC","STENCIL_INDEX","STENCIL_INDEX8","STENCIL_PASS_DEPTH_FAIL","STENCIL_PASS_DEPTH_PASS","STENCIL_REF","STENCIL_TEST","STENCIL_VALUE_MASK","STENCIL_WRITEMASK","STREAM_DRAW","STRING_TYPE","STYLE_RULE","SUBPIXEL_BITS","SUPPORTS_RULE","SVGAElement","SVGAltGlyphDefElement","SVGAltGlyphElement","SVGAltGlyphItemElement","SVGAngle","SVGAnimateColorElement","SVGAnimateElement","SVGAnimateMotionElement","SVGAnimateTransformElement","SVGAnimatedAngle","SVGAnimatedBoolean","SVGAnimatedEnumeration","SVGAnimatedInteger","SVGAnimatedLength","SVGAnimatedLengthList","SVGAnimatedNumber","SVGAnimatedNumberList","SVGAnimatedPreserveAspectRatio","SVGAnimatedRect","SVGAnimatedString","SVGAnimatedTransformList","SVGAnimationElement","SVGCircleElement","SVGClipPathElement","SVGColor","SVGComponentTransferFunctionElement","SVGCursorElement","SVGDefsElement","SVGDescElement","SVGDiscardElement","SVGDocument","SVGElement","SVGElementInstance","SVGElementInstanceList","SVGEllipseElement","SVGException","SVGFEBlendElement","SVGFEColorMatrixElement","SVGFEComponentTransferElement","SVGFECompositeElement","SVGFEConvolveMatrixElement","SVGFEDiffuseLightingElement","SVGFEDisplacementMapElement","SVGFEDistantLightElement","SVGFEDropShadowElement","SVGFEFloodElement","SVGFEFuncAElement","SVGFEFuncBElement","SVGFEFuncGElement","SVGFEFuncRElement","SVGFEGaussianBlurElement","SVGFEImageElement","SVGFEMergeElement","SVGFEMergeNodeElement","SVGFEMorphologyElement","SVGFEOffsetElement","SVGFEPointLightElement","SVGFESpecularLightingElement","SVGFESpotLightElement","SVGFETileElement","SVGFETurbulenceElement","SVGFilterElement","SVGFontElement","SVGFontFaceElement","SVGFontFaceFormatElement","SVGFontFaceNameElement","SVGFontFaceSrcElement","SVGFontFaceUriElement","SVGForeignObjectElement","SVGGElement","SVGGeometryElement","SVGGlyphElement","SVGGlyphRefElement","SVGGradientElement","SVGGraphicsElement","SVGHKernElement","SVGImageElement","SVGLength","SVGLengthList","SVGLineElement","SVGLinearGradientElement","SVGMPathElement","SVGMarkerElement","SVGMaskElement","SVGMatrix","SVGMetadataElement","SVGMissingGlyphElement","SVGNumber","SVGNumberList","SVGPaint","SVGPathElement","SVGPathSeg","SVGPathSegArcAbs","SVGPathSegArcRel","SVGPathSegClosePath","SVGPathSegCurvetoCubicAbs","SVGPathSegCurvetoCubicRel","SVGPathSegCurvetoCubicSmoothAbs","SVGPathSegCurvetoCubicSmoothRel","SVGPathSegCurvetoQuadraticAbs","SVGPathSegCurvetoQuadraticRel","SVGPathSegCurvetoQuadraticSmoothAbs","SVGPathSegCurvetoQuadraticSmoothRel","SVGPathSegLinetoAbs","SVGPathSegLinetoHorizontalAbs","SVGPathSegLinetoHorizontalRel","SVGPathSegLinetoRel","SVGPathSegLinetoVerticalAbs","SVGPathSegLinetoVerticalRel","SVGPathSegList","SVGPathSegMovetoAbs","SVGPathSegMovetoRel","SVGPatternElement","SVGPoint","SVGPointList","SVGPolygonElement","SVGPolylineElement","SVGPreserveAspectRatio","SVGRadialGradientElement","SVGRect","SVGRectElement","SVGRenderingIntent","SVGSVGElement","SVGScriptElement","SVGSetElement","SVGStopElement","SVGStringList","SVGStyleElement","SVGSwitchElement","SVGSymbolElement","SVGTRefElement","SVGTSpanElement","SVGTextContentElement","SVGTextElement","SVGTextPathElement","SVGTextPositioningElement","SVGTitleElement","SVGTransform","SVGTransformList","SVGUnitTypes","SVGUseElement","SVGVKernElement","SVGViewElement","SVGViewSpec","SVGZoomAndPan","SVGZoomEvent","SVG_ANGLETYPE_DEG","SVG_ANGLETYPE_GRAD","SVG_ANGLETYPE_RAD","SVG_ANGLETYPE_UNKNOWN","SVG_ANGLETYPE_UNSPECIFIED","SVG_CHANNEL_A","SVG_CHANNEL_B","SVG_CHANNEL_G","SVG_CHANNEL_R","SVG_CHANNEL_UNKNOWN","SVG_COLORTYPE_CURRENTCOLOR","SVG_COLORTYPE_RGBCOLOR","SVG_COLORTYPE_RGBCOLOR_ICCCOLOR","SVG_COLORTYPE_UNKNOWN","SVG_EDGEMODE_DUPLICATE","SVG_EDGEMODE_NONE","SVG_EDGEMODE_UNKNOWN","SVG_EDGEMODE_WRAP","SVG_FEBLEND_MODE_COLOR","SVG_FEBLEND_MODE_COLOR_BURN","SVG_FEBLEND_MODE_COLOR_DODGE","SVG_FEBLEND_MODE_DARKEN","SVG_FEBLEND_MODE_DIFFERENCE","SVG_FEBLEND_MODE_EXCLUSION","SVG_FEBLEND_MODE_HARD_LIGHT","SVG_FEBLEND_MODE_HUE","SVG_FEBLEND_MODE_LIGHTEN","SVG_FEBLEND_MODE_LUMINOSITY","SVG_FEBLEND_MODE_MULTIPLY","SVG_FEBLEND_MODE_NORMAL","SVG_FEBLEND_MODE_OVERLAY","SVG_FEBLEND_MODE_SATURATION","SVG_FEBLEND_MODE_SCREEN","SVG_FEBLEND_MODE_SOFT_LIGHT","SVG_FEBLEND_MODE_UNKNOWN","SVG_FECOLORMATRIX_TYPE_HUEROTATE","SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA","SVG_FECOLORMATRIX_TYPE_MATRIX","SVG_FECOLORMATRIX_TYPE_SATURATE","SVG_FECOLORMATRIX_TYPE_UNKNOWN","SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE","SVG_FECOMPONENTTRANSFER_TYPE_GAMMA","SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY","SVG_FECOMPONENTTRANSFER_TYPE_LINEAR","SVG_FECOMPONENTTRANSFER_TYPE_TABLE","SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_ARITHMETIC","SVG_FECOMPOSITE_OPERATOR_ATOP","SVG_FECOMPOSITE_OPERATOR_IN","SVG_FECOMPOSITE_OPERATOR_OUT","SVG_FECOMPOSITE_OPERATOR_OVER","SVG_FECOMPOSITE_OPERATOR_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_XOR","SVG_INVALID_VALUE_ERR","SVG_LENGTHTYPE_CM","SVG_LENGTHTYPE_EMS","SVG_LENGTHTYPE_EXS","SVG_LENGTHTYPE_IN","SVG_LENGTHTYPE_MM","SVG_LENGTHTYPE_NUMBER","SVG_LENGTHTYPE_PC","SVG_LENGTHTYPE_PERCENTAGE","SVG_LENGTHTYPE_PT","SVG_LENGTHTYPE_PX","SVG_LENGTHTYPE_UNKNOWN","SVG_MARKERUNITS_STROKEWIDTH","SVG_MARKERUNITS_UNKNOWN","SVG_MARKERUNITS_USERSPACEONUSE","SVG_MARKER_ORIENT_ANGLE","SVG_MARKER_ORIENT_AUTO","SVG_MARKER_ORIENT_UNKNOWN","SVG_MASKTYPE_ALPHA","SVG_MASKTYPE_LUMINANCE","SVG_MATRIX_NOT_INVERTABLE","SVG_MEETORSLICE_MEET","SVG_MEETORSLICE_SLICE","SVG_MEETORSLICE_UNKNOWN","SVG_MORPHOLOGY_OPERATOR_DILATE","SVG_MORPHOLOGY_OPERATOR_ERODE","SVG_MORPHOLOGY_OPERATOR_UNKNOWN","SVG_PAINTTYPE_CURRENTCOLOR","SVG_PAINTTYPE_NONE","SVG_PAINTTYPE_RGBCOLOR","SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR","SVG_PAINTTYPE_UNKNOWN","SVG_PAINTTYPE_URI","SVG_PAINTTYPE_URI_CURRENTCOLOR","SVG_PAINTTYPE_URI_NONE","SVG_PAINTTYPE_URI_RGBCOLOR","SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR","SVG_PRESERVEASPECTRATIO_NONE","SVG_PRESERVEASPECTRATIO_UNKNOWN","SVG_PRESERVEASPECTRATIO_XMAXYMAX","SVG_PRESERVEASPECTRATIO_XMAXYMID","SVG_PRESERVEASPECTRATIO_XMAXYMIN","SVG_PRESERVEASPECTRATIO_XMIDYMAX","SVG_PRESERVEASPECTRATIO_XMIDYMID","SVG_PRESERVEASPECTRATIO_XMIDYMIN","SVG_PRESERVEASPECTRATIO_XMINYMAX","SVG_PRESERVEASPECTRATIO_XMINYMID","SVG_PRESERVEASPECTRATIO_XMINYMIN","SVG_SPREADMETHOD_PAD","SVG_SPREADMETHOD_REFLECT","SVG_SPREADMETHOD_REPEAT","SVG_SPREADMETHOD_UNKNOWN","SVG_STITCHTYPE_NOSTITCH","SVG_STITCHTYPE_STITCH","SVG_STITCHTYPE_UNKNOWN","SVG_TRANSFORM_MATRIX","SVG_TRANSFORM_ROTATE","SVG_TRANSFORM_SCALE","SVG_TRANSFORM_SKEWX","SVG_TRANSFORM_SKEWY","SVG_TRANSFORM_TRANSLATE","SVG_TRANSFORM_UNKNOWN","SVG_TURBULENCE_TYPE_FRACTALNOISE","SVG_TURBULENCE_TYPE_TURBULENCE","SVG_TURBULENCE_TYPE_UNKNOWN","SVG_UNIT_TYPE_OBJECTBOUNDINGBOX","SVG_UNIT_TYPE_UNKNOWN","SVG_UNIT_TYPE_USERSPACEONUSE","SVG_WRONG_TYPE_ERR","SVG_ZOOMANDPAN_DISABLE","SVG_ZOOMANDPAN_MAGNIFY","SVG_ZOOMANDPAN_UNKNOWN","SYNTAX_ERR","SavedPages","Screen","ScreenOrientation","Script","ScriptProcessorNode","ScrollAreaEvent","SecurityPolicyViolationEvent","Selection","ServiceWorker","ServiceWorkerContainer","ServiceWorkerRegistration","SessionDescription","Set","ShadowRoot","SharedWorker","SimpleGestureEvent","SpeechSynthesisEvent","SpeechSynthesisUtterance","StopIteration","Storage","StorageEvent","String","StyleSheet","StyleSheetList","SubtleCrypto","Symbol","SyntaxError","TEMPORARY","TEXTPATH_METHODTYPE_ALIGN","TEXTPATH_METHODTYPE_STRETCH","TEXTPATH_METHODTYPE_UNKNOWN","TEXTPATH_SPACINGTYPE_AUTO","TEXTPATH_SPACINGTYPE_EXACT","TEXTPATH_SPACINGTYPE_UNKNOWN","TEXTURE","TEXTURE0","TEXTURE1","TEXTURE10","TEXTURE11","TEXTURE12","TEXTURE13","TEXTURE14","TEXTURE15","TEXTURE16","TEXTURE17","TEXTURE18","TEXTURE19","TEXTURE2","TEXTURE20","TEXTURE21","TEXTURE22","TEXTURE23","TEXTURE24","TEXTURE25","TEXTURE26","TEXTURE27","TEXTURE28","TEXTURE29","TEXTURE3","TEXTURE30","TEXTURE31","TEXTURE4","TEXTURE5","TEXTURE6","TEXTURE7","TEXTURE8","TEXTURE9","TEXTURE_2D","TEXTURE_BINDING_2D","TEXTURE_BINDING_CUBE_MAP","TEXTURE_CUBE_MAP","TEXTURE_CUBE_MAP_NEGATIVE_X","TEXTURE_CUBE_MAP_NEGATIVE_Y","TEXTURE_CUBE_MAP_NEGATIVE_Z","TEXTURE_CUBE_MAP_POSITIVE_X","TEXTURE_CUBE_MAP_POSITIVE_Y","TEXTURE_CUBE_MAP_POSITIVE_Z","TEXTURE_MAG_FILTER","TEXTURE_MAX_ANISOTROPY_EXT","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","TEXTURE_WRAP_T","TEXT_NODE","TIMEOUT","TIMEOUT_ERR","TOO_LARGE_ERR","TRANSACTION_INACTIVE_ERR","TRIANGLE","TRIANGLES","TRIANGLE_FAN","TRIANGLE_STRIP","TYPE_BACK_FORWARD","TYPE_ERR","TYPE_MISMATCH_ERR","TYPE_NAVIGATE","TYPE_RELOAD","TYPE_RESERVED","Text","TextDecoder","TextEncoder","TextEvent","TextMetrics","TextTrack","TextTrackCue","TextTrackCueList","TextTrackList","TimeEvent","TimeRanges","Touch","TouchEvent","TouchList","TrackEvent","TransitionEvent","TreeWalker","TypeError","UIEvent","UNCACHED","UNKNOWN_ERR","UNKNOWN_RULE","UNMASKED_RENDERER_WEBGL","UNMASKED_VENDOR_WEBGL","UNORDERED_NODE_ITERATOR_TYPE","UNORDERED_NODE_SNAPSHOT_TYPE","UNPACK_ALIGNMENT","UNPACK_COLORSPACE_CONVERSION_WEBGL","UNPACK_FLIP_Y_WEBGL","UNPACK_PREMULTIPLY_ALPHA_WEBGL","UNSCHEDULED_STATE","UNSENT","UNSIGNED_BYTE","UNSIGNED_INT","UNSIGNED_SHORT","UNSIGNED_SHORT_4_4_4_4","UNSIGNED_SHORT_5_5_5_1","UNSIGNED_SHORT_5_6_5","UNSPECIFIED_EVENT_TYPE_ERR","UPDATEREADY","URIError","URL","URLSearchParams","URLUnencoded","URL_MISMATCH_ERR","UTC","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","UserMessageHandler","UserMessageHandlersNamespace","UserProximityEvent","VALIDATE_STATUS","VALIDATION_ERR","VARIABLES_RULE","VENDOR","VERSION","VERSION_CHANGE","VERSION_ERR","VERTEX_ATTRIB_ARRAY_BUFFER_BINDING","VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE","VERTEX_ATTRIB_ARRAY_ENABLED","VERTEX_ATTRIB_ARRAY_NORMALIZED","VERTEX_ATTRIB_ARRAY_POINTER","VERTEX_ATTRIB_ARRAY_SIZE","VERTEX_ATTRIB_ARRAY_STRIDE","VERTEX_ATTRIB_ARRAY_TYPE","VERTEX_SHADER","VERTICAL","VERTICAL_AXIS","VER_ERR","VIEWPORT","VIEWPORT_RULE","VTTCue","VTTRegion","ValidityState","VideoStreamTrack","WEBKIT_FILTER_RULE","WEBKIT_KEYFRAMES_RULE","WEBKIT_KEYFRAME_RULE","WEBKIT_REGION_RULE","WRONG_DOCUMENT_ERR","WaveShaperNode","WeakMap","WeakSet","WebGLActiveInfo","WebGLBuffer","WebGLContextEvent","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLRenderingContext","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArray","WebKitAnimationEvent","WebKitBlobBuilder","WebKitCSSFilterRule","WebKitCSSFilterValue","WebKitCSSKeyframeRule","WebKitCSSKeyframesRule","WebKitCSSMatrix","WebKitCSSRegionRule","WebKitCSSTransformValue","WebKitDataCue","WebKitGamepad","WebKitMediaKeyError","WebKitMediaKeyMessageEvent","WebKitMediaKeySession","WebKitMediaKeys","WebKitMediaSource","WebKitMutationObserver","WebKitNamespace","WebKitPlaybackTargetAvailabilityEvent","WebKitPoint","WebKitShadowRoot","WebKitSourceBuffer","WebKitSourceBufferList","WebKitTransitionEvent","WebSocket","WheelEvent","Window","Worker","XMLDocument","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestException","XMLHttpRequestProgressEvent","XMLHttpRequestUpload","XMLSerializer","XMLStylesheetProcessingInstruction","XPathEvaluator","XPathException","XPathExpression","XPathNSResolver","XPathResult","XSLTProcessor","ZERO","_XD0M_","_YD0M_","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__opera","__proto__","_browserjsran","a","aLink","abbr","abort","abs","absolute","acceleration","accelerationIncludingGravity","accelerator","accept","acceptCharset","acceptNode","accessKey","accessKeyLabel","accuracy","acos","acosh","action","actionURL","active","activeCues","activeElement","activeSourceBuffers","activeSourceCount","activeTexture","add","addBehavior","addCandidate","addColorStop","addCue","addElement","addEventListener","addFilter","addFromString","addFromUri","addIceCandidate","addImport","addListener","addNamed","addPageRule","addPath","addPointer","addRange","addRegion","addRule","addSearchEngine","addSourceBuffer","addStream","addTextTrack","addTrack","addWakeLockListener","addedNodes","additionalName","additiveSymbols","addons","adoptNode","adr","advance","alert","algorithm","align","align-content","align-items","align-self","alignContent","alignItems","alignSelf","alignmentBaseline","alinkColor","all","allowFullscreen","allowedDirections","alpha","alt","altGraphKey","altHtml","altKey","altLeft","altitude","altitudeAccuracy","amplitude","ancestorOrigins","anchor","anchorNode","anchorOffset","anchors","angle","animVal","animate","animatedInstanceRoot","animatedNormalizedPathSegList","animatedPathSegList","animatedPoints","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationStartTime","animationTimingFunction","animationsPaused","anniversary","app","appCodeName","appMinorVersion","appName","appNotifications","appVersion","append","appendBuffer","appendChild","appendData","appendItem","appendMedium","appendNamed","appendRule","appendStream","appendWindowEnd","appendWindowStart","applets","applicationCache","apply","applyElement","arc","arcTo","archive","areas","arguments","arrayBuffer","asin","asinh","assert","assign","async","atEnd","atan","atan2","atanh","atob","attachEvent","attachShader","attachments","attack","attrChange","attrName","attributeName","attributeNamespace","attributes","audioTracks","autoIncrement","autobuffer","autocapitalize","autocomplete","autocorrect","autofocus","autoplay","availHeight","availLeft","availTop","availWidth","availability","available","aversion","axes","axis","azimuth","b","back","backface-visibility","backfaceVisibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","badInput","balance","baseFrequencyX","baseFrequencyY","baseNode","baseOffset","baseURI","baseVal","baselineShift","battery","bday","beginElement","beginElementAt","beginPath","behavior","behaviorCookie","behaviorPart","behaviorUrns","beta","bezierCurveTo","bgColor","bgProperties","bias","big","binaryType","bind","bindAttribLocation","bindBuffer","bindFramebuffer","bindRenderbuffer","bindTexture","blendColor","blendEquation","blendEquationSeparate","blendFunc","blendFuncSeparate","blink","blob","blockDirection","blue","blur","body","bodyUsed","bold","bookmarks","booleanValue","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderColorDark","borderColorLight","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","bottomMargin","bound","boundElements","boundingClientRect","boundingHeight","boundingLeft","boundingTop","boundingWidth","bounds","box-decoration-break","box-shadow","box-sizing","boxDecorationBreak","boxShadow","boxSizing","breakAfter","breakBefore","breakInside","browserLanguage","btoa","bubbles","buffer","bufferData","bufferDepth","bufferSize","bufferSubData","buffered","bufferedAmount","buildID","buildNumber","button","buttonID","buttons","byteLength","byteOffset","c","call","caller","canBeFormatted","canBeMounted","canBeShared","canHaveChildren","canHaveHTML","canPlayType","cancel","cancelAnimationFrame","cancelBubble","cancelScheduledValues","cancelable","candidate","canvas","caption","caption-side","captionSide","captureEvents","captureStackTrace","caretPositionFromPoint","caretRangeFromPoint","cast","catch","category","cbrt","cd","ceil","cellIndex","cellPadding","cellSpacing","cells","ch","chOff","chain","challenge","changedTouches","channel","channelCount","channelCountMode","channelInterpretation","char","charAt","charCode","charCodeAt","charIndex","characterSet","charging","chargingTime","charset","checkEnclosure","checkFramebufferStatus","checkIntersection","checkValidity","checked","childElementCount","childNodes","children","chrome","ciphertext","cite","classList","className","classid","clear","clearAttributes","clearColor","clearData","clearDepth","clearImmediate","clearInterval","clearMarks","clearMeasures","clearParameters","clearRect","clearResourceTimings","clearShadow","clearStencil","clearTimeout","clearWatch","click","clickCount","clientHeight","clientInformation","clientLeft","clientRect","clientRects","clientTop","clientWidth","clientX","clientY","clip","clip-path","clip-rule","clipBottom","clipLeft","clipPath","clipPathUnits","clipRight","clipRule","clipTop","clipboardData","clone","cloneContents","cloneNode","cloneRange","close","closePath","closed","closest","clz","clz32","cmp","code","codeBase","codePointAt","codeType","colSpan","collapse","collapseToEnd","collapseToStart","collapsed","collect","colno","color","color-interpolation","color-interpolation-filters","colorDepth","colorInterpolation","colorInterpolationFilters","colorMask","colorType","cols","columnCount","columnFill","columnGap","columnNumber","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","command","commitPreferences","commonAncestorContainer","compact","compareBoundaryPoints","compareDocumentPosition","compareEndPoints","compareNode","comparePoint","compatMode","compatible","compile","compileShader","complete","componentFromPoint","compositionEndOffset","compositionStartOffset","compressedTexImage2D","compressedTexSubImage2D","concat","conditionText","coneInnerAngle","coneOuterAngle","coneOuterGain","confirm","confirmComposition","confirmSiteSpecificTrackingException","confirmWebWideTrackingException","connect","connectEnd","connectStart","connected","connection","connectionSpeed","console","consolidate","constrictionActive","constructor","contactID","contains","containsNode","content","contentDocument","contentEditable","contentOverflow","contentScriptType","contentStyleType","contentType","contentWindow","context","contextMenu","contextmenu","continue","continuous","control","controller","controls","convertToSpecifiedUnits","cookie","cookieEnabled","coords","copyFromChannel","copyTexImage2D","copyTexSubImage2D","copyToChannel","copyWithin","correspondingElement","correspondingUseElement","cos","cosh","count","counter-increment","counter-reset","counterIncrement","counterReset","cpuClass","cpuSleepAllowed","create","createAnalyser","createAnswer","createAttribute","createAttributeNS","createBiquadFilter","createBuffer","createBufferSource","createCDATASection","createCSSStyleSheet","createCaption","createChannelMerger","createChannelSplitter","createComment","createContextualFragment","createControlRange","createConvolver","createDTMFSender","createDataChannel","createDelay","createDelayNode","createDocument","createDocumentFragment","createDocumentType","createDynamicsCompressor","createElement","createElementNS","createEntityReference","createEvent","createEventObject","createExpression","createFramebuffer","createFunction","createGain","createGainNode","createHTMLDocument","createImageBitmap","createImageData","createIndex","createJavaScriptNode","createLinearGradient","createMediaElementSource","createMediaKeys","createMediaStreamDestination","createMediaStreamSource","createMutableFile","createNSResolver","createNodeIterator","createNotification","createObjectStore","createObjectURL","createOffer","createOscillator","createPanner","createPattern","createPeriodicWave","createPopup","createProcessingInstruction","createProgram","createRadialGradient","createRange","createRangeCollection","createRenderbuffer","createSVGAngle","createSVGLength","createSVGMatrix","createSVGNumber","createSVGPathSegArcAbs","createSVGPathSegArcRel","createSVGPathSegClosePath","createSVGPathSegCurvetoCubicAbs","createSVGPathSegCurvetoCubicRel","createSVGPathSegCurvetoCubicSmoothAbs","createSVGPathSegCurvetoCubicSmoothRel","createSVGPathSegCurvetoQuadraticAbs","createSVGPathSegCurvetoQuadraticRel","createSVGPathSegCurvetoQuadraticSmoothAbs","createSVGPathSegCurvetoQuadraticSmoothRel","createSVGPathSegLinetoAbs","createSVGPathSegLinetoHorizontalAbs","createSVGPathSegLinetoHorizontalRel","createSVGPathSegLinetoRel","createSVGPathSegLinetoVerticalAbs","createSVGPathSegLinetoVerticalRel","createSVGPathSegMovetoAbs","createSVGPathSegMovetoRel","createSVGPoint","createSVGRect","createSVGTransform","createSVGTransformFromMatrix","createScriptProcessor","createSession","createShader","createShadowRoot","createStereoPanner","createStyleSheet","createTBody","createTFoot","createTHead","createTextNode","createTextRange","createTexture","createTouch","createTouchList","createTreeWalker","createWaveShaper","creationTime","crossOrigin","crypto","csi","cssFloat","cssRules","cssText","cssValueType","ctrlKey","ctrlLeft","cues","cullFace","currentNode","currentPage","currentScale","currentScript","currentSrc","currentState","currentStyle","currentTarget","currentTime","currentTranslate","currentView","cursor","curve","customError","cx","cy","d","data","dataFld","dataFormatAs","dataPageSize","dataSrc","dataTransfer","database","dataset","dateTime","db","debug","debuggerEnabled","declare","decode","decodeAudioData","decodeURI","decodeURIComponent","decrypt","default","defaultCharset","defaultChecked","defaultMuted","defaultPlaybackRate","defaultPrevented","defaultSelected","defaultStatus","defaultURL","defaultValue","defaultView","defaultstatus","defer","defineMagicFunction","defineMagicVariable","defineProperties","defineProperty","delayTime","delete","deleteBuffer","deleteCaption","deleteCell","deleteContents","deleteData","deleteDatabase","deleteFramebuffer","deleteFromDocument","deleteIndex","deleteMedium","deleteObjectStore","deleteProgram","deleteRenderbuffer","deleteRow","deleteRule","deleteShader","deleteTFoot","deleteTHead","deleteTexture","deliverChangeRecords","delivery","deliveryInfo","deliveryStatus","deliveryTimestamp","delta","deltaMode","deltaX","deltaY","deltaZ","depthFunc","depthMask","depthRange","deriveBits","deriveKey","description","deselectAll","designMode","destination","destinationURL","detach","detachEvent","detachShader","detail","detune","devicePixelRatio","deviceXDPI","deviceYDPI","diffuseConstant","digest","dimensions","dir","dirName","direction","dirxml","disable","disableVertexAttribArray","disabled","dischargingTime","disconnect","dispatchEvent","display","distanceModel","divisor","djsapi","djsproxy","doImport","doNotTrack","doScroll","doctype","document","documentElement","documentMode","documentURI","dolphin","dolphinGameCenter","dolphininfo","dolphinmeta","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domain","domainLookupEnd","domainLookupStart","dominant-baseline","dominantBaseline","done","dopplerFactor","download","dragDrop","draggable","drawArrays","drawArraysInstancedANGLE","drawCustomFocusRing","drawElements","drawElementsInstancedANGLE","drawFocusIfNeeded","drawImage","drawImageFromRect","drawSystemFocusRing","drawingBufferHeight","drawingBufferWidth","dropEffect","droppedVideoFrames","dropzone","dump","duplicate","duration","dvname","dvnum","dx","dy","dynsrc","e","edgeMode","effectAllowed","elapsedTime","elementFromPoint","elements","elevation","ellipse","email","embeds","empty","empty-cells","emptyCells","enable","enableBackground","enableStyleSheetsForSet","enableVertexAttribArray","enabled","enabledPlugin","encode","encodeURI","encodeURIComponent","encoding","encrypt","enctype","end","endContainer","endElement","endElementAt","endOfStream","endOffset","endTime","ended","endsWith","entities","entries","entryType","enumerate","enumerateEditable","error","errorCode","escape","eval","evaluate","event","eventPhase","every","exception","exec","execCommand","execCommandShowHelp","execScript","exitFullscreen","exitPointerLock","exp","expand","expandEntityReferences","expando","expansion","expiryDate","explicitOriginalTarget","expm1","exponent","exponentialRampToValueAtTime","exportKey","extend","extensions","extentNode","extentOffset","external","externalResourcesRequired","extractContents","extractable","f","face","factoryReset","fallback","familyName","farthestViewportElement","fastSeek","fatal","fetch","fetchStart","fftSize","fgColor","fileCreatedDate","fileHandle","fileModifiedDate","fileName","fileSize","fileUpdatedDate","filename","files","fill","fill-opacity","fill-rule","fillOpacity","fillRect","fillRule","fillStyle","fillText","filter","filterResX","filterResY","filterUnits","filters","find","findIndex","findRule","findText","finish","fireEvent","firstChild","firstElementChild","firstPage","fixed","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","flipX","flipY","float","flood-color","flood-opacity","floodColor","floodOpacity","floor","flush","focus","focusNode","focusOffset","font","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontSize","fontSizeAdjust","fontSmoothingEnabled","fontStretch","fontStyle","fontSynthesis","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontWeight","fontcolor","fonts","fontsize","for","forEach","forceRedraw","form","formAction","formEnctype","formMethod","formNoValidate","formTarget","format","forms","forward","fr","frame","frameBorder","frameElement","frameSpacing","framebufferRenderbuffer","framebufferTexture2D","frames","freeSpace","freeze","frequency","frequencyBinCount","from","fromCharCode","fromCodePoint","fromElement","frontFace","fround","fullScreen","fullscreenElement","fullscreenEnabled","fx","fy","gain","gamepad","gamma","genderIdentity","generateKey","generateMipmap","generateRequest","geolocation","gestureObject","get","getActiveAttrib","getActiveUniform","getAdjacentText","getAll","getAllResponseHeaders","getAsFile","getAsString","getAttachedShaders","getAttribLocation","getAttribute","getAttributeNS","getAttributeNode","getAttributeNodeNS","getAudioTracks","getBBox","getBattery","getBlob","getBookmark","getBoundingClientRect","getBufferParameter","getByteFrequencyData","getByteTimeDomainData","getCSSCanvasContext","getCTM","getCandidateWindowClientRect","getChannelData","getCharNumAtPosition","getClientRect","getClientRects","getCompositionAlternatives","getComputedStyle","getComputedTextLength","getConfiguration","getContext","getContextAttributes","getCounterValue","getCueAsHTML","getCueById","getCurrentPosition","getCurrentTime","getData","getDatabaseNames","getDate","getDay","getDefaultComputedStyle","getDestinationInsertionPoints","getDistributedNodes","getEditable","getElementById","getElementsByClassName","getElementsByName","getElementsByTagName","getElementsByTagNameNS","getEnclosureList","getEndPositionOfChar","getEntries","getEntriesByName","getEntriesByType","getError","getExtension","getExtentOfChar","getFeature","getFile","getFloat32","getFloat64","getFloatFrequencyData","getFloatTimeDomainData","getFloatValue","getFramebufferAttachmentParameter","getFrequencyResponse","getFullYear","getGamepads","getHours","getImageData","getInt16","getInt32","getInt8","getIntersectionList","getItem","getItems","getKey","getLineDash","getLocalStreams","getMarks","getMatchedCSSRules","getMeasures","getMetadata","getMilliseconds","getMinutes","getModifierState","getMonth","getNamedItem","getNamedItemNS","getNotifier","getNumberOfChars","getOverrideHistoryNavigationMode","getOverrideStyle","getOwnPropertyDescriptor","getOwnPropertyNames","getOwnPropertySymbols","getParameter","getPathSegAtLength","getPointAtLength","getPreference","getPreferenceDefault","getPresentationAttribute","getPreventDefault","getProgramInfoLog","getProgramParameter","getPropertyCSSValue","getPropertyPriority","getPropertyShorthand","getPropertyValue","getPrototypeOf","getRGBColorValue","getRandomValues","getRangeAt","getReceivers","getRectValue","getRegistration","getRemoteStreams","getRenderbufferParameter","getResponseHeader","getRoot","getRotationOfChar","getSVGDocument","getScreenCTM","getSeconds","getSelection","getSenders","getShaderInfoLog","getShaderParameter","getShaderPrecisionFormat","getShaderSource","getSimpleDuration","getSiteIcons","getSources","getSpeculativeParserUrls","getStartPositionOfChar","getStartTime","getStats","getStorageUpdates","getStreamById","getStringValue","getSubStringLength","getSubscription","getSupportedExtensions","getTexParameter","getTime","getTimezoneOffset","getTotalLength","getTrackById","getTracks","getTransformToElement","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getUint16","getUint32","getUint8","getUniform","getUniformLocation","getUserMedia","getValues","getVarDate","getVariableValue","getVertexAttrib","getVertexAttribOffset","getVideoPlaybackQuality","getVideoTracks","getWakeLockState","getYear","givenName","global","globalAlpha","globalCompositeOperation","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","go","gradientTransform","gradientUnits","grammars","green","group","groupCollapsed","groupEnd","hardwareConcurrency","has","hasAttribute","hasAttributeNS","hasAttributes","hasChildNodes","hasComposition","hasExtension","hasFeature","hasFocus","hasLayout","hasOwnProperty","hash","head","headers","heading","height","hidden","hide","hideFocus","high","hint","history","honorificPrefix","honorificSuffix","horizontalOverflow","host","hostname","href","hreflang","hspace","html5TagCheckInerface","htmlFor","htmlText","httpEquiv","hwTimestamp","hypot","iccId","iceConnectionState","iceGatheringState","icon","id","identifier","identity","ignoreBOM","ignoreCase","image-orientation","image-rendering","imageOrientation","imageRendering","images","ime-mode","imeMode","implementation","importKey","importNode","importStylesheet","imports","impp","imul","in1","in2","inBandMetadataTrackDispatchType","inRange","includes","incremental","indeterminate","index","indexNames","indexOf","indexedDB","inertiaDestinationX","inertiaDestinationY","info","init","initAnimationEvent","initBeforeLoadEvent","initClipboardEvent","initCloseEvent","initCommandEvent","initCompositionEvent","initCustomEvent","initData","initDeviceMotionEvent","initDeviceOrientationEvent","initDragEvent","initErrorEvent","initEvent","initFocusEvent","initGestureEvent","initHashChangeEvent","initKeyEvent","initKeyboardEvent","initMSManipulationEvent","initMessageEvent","initMouseEvent","initMouseScrollEvent","initMouseWheelEvent","initMutationEvent","initNSMouseEvent","initOverflowEvent","initPageEvent","initPageTransitionEvent","initPointerEvent","initPopStateEvent","initProgressEvent","initScrollAreaEvent","initSimpleGestureEvent","initStorageEvent","initTextEvent","initTimeEvent","initTouchEvent","initTransitionEvent","initUIEvent","initWebKitAnimationEvent","initWebKitTransitionEvent","initWebKitWheelEvent","initWheelEvent","initialTime","initialize","initiatorType","inner","innerHTML","innerHeight","innerText","innerWidth","input","inputBuffer","inputEncoding","inputMethod","insertAdjacentElement","insertAdjacentHTML","insertAdjacentText","insertBefore","insertCell","insertData","insertItemBefore","insertNode","insertRow","insertRule","instanceRoot","intercept","interimResults","internalSubset","intersectsNode","interval","invalidIteratorState","inverse","invertSelf","is","is2D","isAlternate","isArray","isBingCurrentSearchDefault","isBuffer","isCandidateWindowVisible","isChar","isCollapsed","isComposing","isContentEditable","isContentHandlerRegistered","isContextLost","isDefaultNamespace","isDisabled","isEnabled","isEqual","isEqualNode","isExtensible","isFinite","isFramebuffer","isFrozen","isGenerator","isId","isInjected","isInteger","isMap","isMultiLine","isNaN","isOpen","isPointInFill","isPointInPath","isPointInRange","isPointInStroke","isPrefAlternate","isPrimary","isProgram","isPropertyImplicit","isProtocolHandlerRegistered","isPrototypeOf","isRenderbuffer","isSafeInteger","isSameNode","isSealed","isShader","isSupported","isTextEdit","isTexture","isTrusted","isTypeSupported","isView","isolation","italics","item","itemId","itemProp","itemRef","itemScope","itemType","itemValue","iterateNext","iterator","javaEnabled","jobTitle","join","json","justify-content","justifyContent","k1","k2","k3","k4","kernelMatrix","kernelUnitLengthX","kernelUnitLengthY","kerning","key","keyCode","keyFor","keyIdentifier","keyLightEnabled","keyLocation","keyPath","keySystem","keyText","keyUsage","keys","keytype","kind","knee","label","labels","lang","language","languages","largeArcFlag","lastChild","lastElementChild","lastEventId","lastIndex","lastIndexOf","lastMatch","lastMessageSubject","lastMessageType","lastModified","lastModifiedDate","lastPage","lastParen","lastState","lastStyleSheetSet","latitude","layerX","layerY","layoutFlow","layoutGrid","layoutGridChar","layoutGridLine","layoutGridMode","layoutGridType","lbound","left","leftContext","leftMargin","length","lengthAdjust","lengthComputable","letter-spacing","letterSpacing","level","lighting-color","lightingColor","limitingConeAngle","line","line-height","lineAlign","lineBreak","lineCap","lineDashOffset","lineHeight","lineJoin","lineNumber","lineTo","lineWidth","linearRampToValueAtTime","lineno","link","linkColor","linkProgram","links","list","list-style","list-style-image","list-style-position","list-style-type","listStyle","listStyleImage","listStylePosition","listStyleType","listener","load","loadEventEnd","loadEventStart","loadTimes","loaded","localDescription","localName","localStorage","locale","localeCompare","location","locationbar","lock","lockedFile","log","log10","log1p","log2","logicalXDPI","logicalYDPI","longDesc","longitude","lookupNamespaceURI","lookupPrefix","loop","loopEnd","loopStart","looping","low","lower","lowerBound","lowerOpen","lowsrc","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","manifest","map","mapping","margin","margin-bottom","margin-left","margin-right","margin-top","marginBottom","marginHeight","marginLeft","marginRight","marginTop","marginWidth","mark","marker","marker-end","marker-mid","marker-offset","marker-start","markerEnd","markerHeight","markerMid","markerOffset","markerStart","markerUnits","markerWidth","marks","mask","mask-type","maskContentUnits","maskType","maskUnits","match","matchMedia","matchMedium","matches","matrix","matrixTransform","max","max-height","max-width","maxAlternatives","maxChannelCount","maxConnectionsPerServer","maxDecibels","maxDistance","maxHeight","maxLength","maxTouchPoints","maxValue","maxWidth","measure","measureText","media","mediaDevices","mediaElement","mediaGroup","mediaKeys","mediaText","meetOrSlice","memory","menubar","mergeAttributes","message","messageClass","messageHandlers","metaKey","method","mimeType","mimeTypes","min","min-height","min-width","minDecibels","minHeight","minValue","minWidth","miterLimit","mix-blend-mode","mixBlendMode","mode","modify","mount","move","moveBy","moveEnd","moveFirst","moveFocusDown","moveFocusLeft","moveFocusRight","moveFocusUp","moveNext","moveRow","moveStart","moveTo","moveToBookmark","moveToElementText","moveToPoint","mozAdd","mozAnimationStartTime","mozAnon","mozApps","mozAudioCaptured","mozAudioChannelType","mozAutoplayEnabled","mozCancelAnimationFrame","mozCancelFullScreen","mozCancelRequestAnimationFrame","mozCaptureStream","mozCaptureStreamUntilEnded","mozClearDataAt","mozContact","mozContacts","mozCreateFileHandle","mozCurrentTransform","mozCurrentTransformInverse","mozCursor","mozDash","mozDashOffset","mozDecodedFrames","mozExitPointerLock","mozFillRule","mozFragmentEnd","mozFrameDelay","mozFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozGetAll","mozGetAllKeys","mozGetAsFile","mozGetDataAt","mozGetMetadata","mozGetUserMedia","mozHasAudio","mozHasItem","mozHidden","mozImageSmoothingEnabled","mozIndexedDB","mozInnerScreenX","mozInnerScreenY","mozInputSource","mozIsTextField","mozItem","mozItemCount","mozItems","mozLength","mozLockOrientation","mozMatchesSelector","mozMovementX","mozMovementY","mozOpaque","mozOrientation","mozPaintCount","mozPaintedFrames","mozParsedFrames","mozPay","mozPointerLockElement","mozPresentedFrames","mozPreservesPitch","mozPressure","mozPrintCallback","mozRTCIceCandidate","mozRTCPeerConnection","mozRTCSessionDescription","mozRemove","mozRequestAnimationFrame","mozRequestFullScreen","mozRequestPointerLock","mozSetDataAt","mozSetImageElement","mozSourceNode","mozSrcObject","mozSystem","mozTCPSocket","mozTextStyle","mozTypesAt","mozUnlockOrientation","mozUserCancelled","mozVisibilityState","msAnimation","msAnimationDelay","msAnimationDirection","msAnimationDuration","msAnimationFillMode","msAnimationIterationCount","msAnimationName","msAnimationPlayState","msAnimationStartTime","msAnimationTimingFunction","msBackfaceVisibility","msBlockProgression","msCSSOMElementFloatMetrics","msCaching","msCachingEnabled","msCancelRequestAnimationFrame","msCapsLockWarningOff","msClearImmediate","msClose","msContentZoomChaining","msContentZoomFactor","msContentZoomLimit","msContentZoomLimitMax","msContentZoomLimitMin","msContentZoomSnap","msContentZoomSnapPoints","msContentZoomSnapType","msContentZooming","msConvertURL","msCrypto","msDoNotTrack","msElementsFromPoint","msElementsFromRect","msExitFullscreen","msExtendedCode","msFillRule","msFirstPaint","msFlex","msFlexAlign","msFlexDirection","msFlexFlow","msFlexItemAlign","msFlexLinePack","msFlexNegative","msFlexOrder","msFlexPack","msFlexPositive","msFlexPreferredSize","msFlexWrap","msFlowFrom","msFlowInto","msFontFeatureSettings","msFullscreenElement","msFullscreenEnabled","msGetInputContext","msGetRegionContent","msGetUntransformedBounds","msGraphicsTrustStatus","msGridColumn","msGridColumnAlign","msGridColumnSpan","msGridColumns","msGridRow","msGridRowAlign","msGridRowSpan","msGridRows","msHidden","msHighContrastAdjust","msHyphenateLimitChars","msHyphenateLimitLines","msHyphenateLimitZone","msHyphens","msImageSmoothingEnabled","msImeAlign","msIndexedDB","msInterpolationMode","msIsStaticHTML","msKeySystem","msKeys","msLaunchUri","msLockOrientation","msManipulationViewsEnabled","msMatchMedia","msMatchesSelector","msMaxTouchPoints","msOrientation","msOverflowStyle","msPerspective","msPerspectiveOrigin","msPlayToDisabled","msPlayToPreferredSourceUri","msPlayToPrimary","msPointerEnabled","msRegionOverflow","msReleasePointerCapture","msRequestAnimationFrame","msRequestFullscreen","msSaveBlob","msSaveOrOpenBlob","msScrollChaining","msScrollLimit","msScrollLimitXMax","msScrollLimitXMin","msScrollLimitYMax","msScrollLimitYMin","msScrollRails","msScrollSnapPointsX","msScrollSnapPointsY","msScrollSnapType","msScrollSnapX","msScrollSnapY","msScrollTranslation","msSetImmediate","msSetMediaKeys","msSetPointerCapture","msTextCombineHorizontal","msTextSizeAdjust","msToBlob","msTouchAction","msTouchSelect","msTraceAsyncCallbackCompleted","msTraceAsyncCallbackStarting","msTraceAsyncOperationCompleted","msTraceAsyncOperationStarting","msTransform","msTransformOrigin","msTransformStyle","msTransition","msTransitionDelay","msTransitionDuration","msTransitionProperty","msTransitionTimingFunction","msUnlockOrientation","msUpdateAsyncCallbackRelation","msUserSelect","msVisibilityState","msWrapFlow","msWrapMargin","msWrapThrough","msWriteProfilerMark","msZoom","msZoomTo","mt","multiEntry","multiSelectionObj","multiline","multiple","multiply","multiplySelf","mutableFile","muted","n","name","nameProp","namedItem","namedRecordset","names","namespaceURI","namespaces","naturalHeight","naturalWidth","navigate","navigation","navigationMode","navigationStart","navigator","near","nearestViewportElement","negative","netscape","networkState","newScale","newTranslate","newURL","newValue","newValueSpecifiedUnits","newVersion","newhome","next","nextElementSibling","nextNode","nextPage","nextSibling","nickname","noHref","noResize","noShade","noValidate","noWrap","nodeName","nodeType","nodeValue","normalize","normalizedPathSegList","notationName","notations","note","noteGrainOn","noteOff","noteOn","now","numOctaves","number","numberOfChannels","numberOfInputs","numberOfItems","numberOfOutputs","numberValue","oMatchesSelector","object","object-fit","object-position","objectFit","objectPosition","objectStore","objectStoreNames","observe","of","offscreenBuffering","offset","offsetHeight","offsetLeft","offsetNode","offsetParent","offsetTop","offsetWidth","offsetX","offsetY","ok","oldURL","oldValue","oldVersion","olderShadowRoot","onLine","onabort","onactivate","onactive","onaddstream","onaddtrack","onafterprint","onafterscriptexecute","onafterupdate","onaudioend","onaudioprocess","onaudiostart","onautocomplete","onautocompleteerror","onbeforeactivate","onbeforecopy","onbeforecut","onbeforedeactivate","onbeforeeditfocus","onbeforepaste","onbeforeprint","onbeforescriptexecute","onbeforeunload","onbeforeupdate","onblocked","onblur","onbounce","onboundary","oncached","oncancel","oncandidatewindowhide","oncandidatewindowshow","oncandidatewindowupdate","oncanplay","oncanplaythrough","oncellchange","onchange","onchargingchange","onchargingtimechange","onchecking","onclick","onclose","oncompassneedscalibration","oncomplete","oncontextmenu","oncontrolselect","oncopy","oncuechange","oncut","ondataavailable","ondatachannel","ondatasetchanged","ondatasetcomplete","ondblclick","ondeactivate","ondevicelight","ondevicemotion","ondeviceorientation","ondeviceproximity","ondischargingtimechange","ondisplay","ondownloading","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onencrypted","onend","onended","onenter","onerror","onerrorupdate","onexit","onfilterchange","onfinish","onfocus","onfocusin","onfocusout","onfullscreenchange","onfullscreenerror","ongesturechange","ongestureend","ongesturestart","ongotpointercapture","onhashchange","onhelp","onicecandidate","oniceconnectionstatechange","oninactive","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onlayoutcomplete","onlevelchange","onload","onloadeddata","onloadedmetadata","onloadend","onloadstart","onlosecapture","onlostpointercapture","only","onmark","onmessage","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onmove","onmoveend","onmovestart","onmozfullscreenchange","onmozfullscreenerror","onmozorientationchange","onmozpointerlockchange","onmozpointerlockerror","onmscontentzoom","onmsfullscreenchange","onmsfullscreenerror","onmsgesturechange","onmsgesturedoubletap","onmsgestureend","onmsgesturehold","onmsgesturestart","onmsgesturetap","onmsgotpointercapture","onmsinertiastart","onmslostpointercapture","onmsmanipulationstatechanged","onmsneedkey","onmsorientationchange","onmspointercancel","onmspointerdown","onmspointerenter","onmspointerhover","onmspointerleave","onmspointermove","onmspointerout","onmspointerover","onmspointerup","onmssitemodejumplistitemremoved","onmsthumbnailclick","onnegotiationneeded","onnomatch","onnoupdate","onobsolete","onoffline","ononline","onopen","onorientationchange","onpagechange","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpluginstreamstart","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointerlockchange","onpointerlockerror","onpointermove","onpointerout","onpointerover","onpointerup","onpopstate","onprogress","onpropertychange","onratechange","onreadystatechange","onremovestream","onremovetrack","onreset","onresize","onresizeend","onresizestart","onresourcetimingbufferfull","onresult","onresume","onrowenter","onrowexit","onrowsdelete","onrowsinserted","onscroll","onsearch","onseeked","onseeking","onselect","onselectionchange","onselectstart","onshow","onsignalingstatechange","onsoundend","onsoundstart","onspeechend","onspeechstart","onstalled","onstart","onstatechange","onstop","onstorage","onstoragecommit","onsubmit","onsuccess","onsuspend","ontextinput","ontimeout","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onunload","onupdateready","onupgradeneeded","onuserproximity","onversionchange","onvoiceschanged","onvolumechange","onwaiting","onwarning","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkitcurrentplaybacktargetiswirelesschanged","onwebkitfullscreenchange","onwebkitfullscreenerror","onwebkitkeyadded","onwebkitkeyerror","onwebkitkeymessage","onwebkitneedkey","onwebkitorientationchange","onwebkitplaybacktargetavailabilitychanged","onwebkitpointerlockchange","onwebkitpointerlockerror","onwebkitresourcetimingbufferfull","onwebkittransitionend","onwheel","onzoom","opacity","open","openCursor","openDatabase","openKeyCursor","opener","opera","operationType","operator","opr","optimum","options","order","orderX","orderY","ordered","org","orient","orientAngle","orientType","orientation","origin","originalTarget","orphans","oscpu","outerHTML","outerHeight","outerText","outerWidth","outline","outline-color","outline-offset","outline-style","outline-width","outlineColor","outlineOffset","outlineStyle","outlineWidth","outputBuffer","overflow","overflow-x","overflow-y","overflowX","overflowY","overrideMimeType","oversample","ownerDocument","ownerElement","ownerNode","ownerRule","ownerSVGElement","owningElement","p1","p2","p3","p4","pad","padding","padding-bottom","padding-left","padding-right","padding-top","paddingBottom","paddingLeft","paddingRight","paddingTop","page","page-break-after","page-break-before","page-break-inside","pageBreakAfter","pageBreakBefore","pageBreakInside","pageCount","pageX","pageXOffset","pageY","pageYOffset","pages","paint-order","paintOrder","paintRequests","paintType","palette","panningModel","parent","parentElement","parentNode","parentRule","parentStyleSheet","parentTextEdit","parentWindow","parse","parseFloat","parseFromString","parseInt","participants","password","pasteHTML","path","pathLength","pathSegList","pathSegType","pathSegTypeAsLetter","pathname","pattern","patternContentUnits","patternMismatch","patternTransform","patternUnits","pause","pauseAnimations","pauseOnExit","paused","pending","performance","permission","persisted","personalbar","perspective","perspective-origin","perspectiveOrigin","phoneticFamilyName","phoneticGivenName","photo","ping","pitch","pixelBottom","pixelDepth","pixelHeight","pixelLeft","pixelRight","pixelStorei","pixelTop","pixelUnitToMillimeterX","pixelUnitToMillimeterY","pixelWidth","placeholder","platform","play","playbackRate","playbackState","playbackTime","played","plugins","pluginspage","pname","pointer-events","pointerBeforeReferenceNode","pointerEnabled","pointerEvents","pointerId","pointerLockElement","pointerType","points","pointsAtX","pointsAtY","pointsAtZ","polygonOffset","pop","popupWindowFeatures","popupWindowName","popupWindowURI","port","port1","port2","ports","posBottom","posHeight","posLeft","posRight","posTop","posWidth","position","positionAlign","postError","postMessage","poster","pow","powerOff","preMultiplySelf","precision","preferredStyleSheetSet","preferredStylesheetSet","prefix","preload","preserveAlpha","preserveAspectRatio","preserveAspectRatioString","pressed","pressure","prevValue","preventDefault","preventExtensions","previousElementSibling","previousNode","previousPage","previousScale","previousSibling","previousTranslate","primaryKey","primitiveType","primitiveUnits","principals","print","privateKey","probablySupportsContext","process","processIceMessage","product","productSub","profile","profileEnd","profiles","prompt","properties","propertyIsEnumerable","propertyName","protocol","protocolLong","prototype","pseudoClass","pseudoElement","publicId","publicKey","published","push","pushNotification","pushState","put","putImageData","quadraticCurveTo","qualifier","queryCommandEnabled","queryCommandIndeterm","queryCommandState","queryCommandSupported","queryCommandText","queryCommandValue","querySelector","querySelectorAll","quote","quotes","r","r1","r2","race","radiogroup","radiusX","radiusY","random","range","rangeCount","rangeMax","rangeMin","rangeOffset","rangeOverflow","rangeParent","rangeUnderflow","rate","ratio","raw","read","readAsArrayBuffer","readAsBinaryString","readAsBlob","readAsDataURL","readAsText","readOnly","readPixels","readReportRequested","readyState","reason","reboot","receiver","receivers","recordNumber","recordset","rect","red","redirectCount","redirectEnd","redirectStart","reduce","reduceRight","reduction","refDistance","refX","refY","referenceNode","referrer","refresh","region","regionAnchorX","regionAnchorY","regionId","regions","register","registerContentHandler","registerElement","registerProtocolHandler","reject","rel","relList","relatedNode","relatedTarget","release","releaseCapture","releaseEvents","releasePointerCapture","releaseShaderCompiler","reliable","reload","remainingSpace","remoteDescription","remove","removeAllRanges","removeAttribute","removeAttributeNS","removeAttributeNode","removeBehavior","removeChild","removeCue","removeEventListener","removeFilter","removeImport","removeItem","removeListener","removeNamedItem","removeNamedItemNS","removeNode","removeParameter","removeProperty","removeRange","removeRegion","removeRule","removeSiteSpecificTrackingException","removeSourceBuffer","removeStream","removeTrack","removeVariable","removeWakeLockListener","removeWebWideTrackingException","removedNodes","renderbufferStorage","renderedBuffer","renderingMode","repeat","replace","replaceAdjacentText","replaceChild","replaceData","replaceId","replaceItem","replaceNode","replaceState","replaceTrack","replaceWholeText","reportValidity","requestAnimationFrame","requestAutocomplete","requestData","requestFullscreen","requestMediaKeySystemAccess","requestPermission","requestPointerLock","requestStart","requestingWindow","required","requiredExtensions","requiredFeatures","reset","resetTransform","resize","resizeBy","resizeTo","resolve","response","responseBody","responseEnd","responseStart","responseText","responseType","responseURL","responseXML","restore","result","resultType","resume","returnValue","rev","reverse","reversed","revocable","revokeObjectURL","rgbColor","right","rightContext","rightMargin","rolloffFactor","root","rootElement","rotate","rotateAxisAngle","rotateAxisAngleSelf","rotateFromVector","rotateFromVectorSelf","rotateSelf","rotation","rotationRate","round","rowIndex","rowSpan","rows","rubyAlign","rubyOverhang","rubyPosition","rules","runtime","runtimeStyle","rx","ry","safari","sampleCoverage","sampleRate","sandbox","save","scale","scale3d","scale3dSelf","scaleNonUniform","scaleNonUniformSelf","scaleSelf","scheme","scissor","scope","scopeName","scoped","screen","screenBrightness","screenEnabled","screenLeft","screenPixelToMillimeterX","screenPixelToMillimeterY","screenTop","screenX","screenY","scripts","scroll","scroll-behavior","scrollAmount","scrollBehavior","scrollBy","scrollByLines","scrollByPages","scrollDelay","scrollHeight","scrollIntoView","scrollIntoViewIfNeeded","scrollLeft","scrollLeftMax","scrollMaxX","scrollMaxY","scrollTo","scrollTop","scrollTopMax","scrollWidth","scrollX","scrollY","scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarDarkShadowColor","scrollbarFaceColor","scrollbarHighlightColor","scrollbarShadowColor","scrollbarTrackColor","scrollbars","scrolling","sdp","sdpMLineIndex","sdpMid","seal","search","searchBox","searchBoxJavaBridge_","searchParams","sectionRowIndex","secureConnectionStart","security","seed","seekable","seeking","select","selectAllChildren","selectNode","selectNodeContents","selectNodes","selectSingleNode","selectSubString","selected","selectedIndex","selectedOptions","selectedStyleSheetSet","selectedStylesheetSet","selection","selectionDirection","selectionEnd","selectionStart","selector","selectorText","self","send","sendAsBinary","sendBeacon","sender","sentTimestamp","separator","serializeToString","serviceWorker","sessionId","sessionStorage","set","setActive","setAlpha","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","setBaseAndExtent","setBingCurrentSearchDefault","setCapture","setColor","setCompositeOperation","setCurrentTime","setCustomValidity","setData","setDate","setDragImage","setEnd","setEndAfter","setEndBefore","setEndPoint","setFillColor","setFilterRes","setFloat32","setFloat64","setFloatValue","setFullYear","setHours","setImmediate","setInt16","setInt32","setInt8","setInterval","setItem","setLineCap","setLineDash","setLineJoin","setLineWidth","setLocalDescription","setMatrix","setMatrixValue","setMediaKeys","setMilliseconds","setMinutes","setMiterLimit","setMonth","setNamedItem","setNamedItemNS","setNonUserCodeExceptions","setOrientToAngle","setOrientToAuto","setOrientation","setOverrideHistoryNavigationMode","setPaint","setParameter","setPeriodicWave","setPointerCapture","setPosition","setPreference","setProperty","setPrototypeOf","setRGBColor","setRGBColorICCColor","setRadius","setRangeText","setRemoteDescription","setRequestHeader","setResizable","setResourceTimingBufferSize","setRotate","setScale","setSeconds","setSelectionRange","setServerCertificate","setShadow","setSkewX","setSkewY","setStart","setStartAfter","setStartBefore","setStdDeviation","setStringValue","setStrokeColor","setSuggestResult","setTargetAtTime","setTargetValueAtTime","setTime","setTimeout","setTransform","setTranslate","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setUint16","setUint32","setUint8","setUri","setValueAtTime","setValueCurveAtTime","setVariable","setVelocity","setVersion","setYear","settingName","settingValue","sex","shaderSource","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","shadowRoot","shape","shape-rendering","shapeRendering","sheet","shift","shiftKey","shiftLeft","show","showHelp","showModal","showModalDialog","showModelessDialog","showNotification","sidebar","sign","signalingState","sin","singleNodeValue","sinh","size","sizeToContent","sizes","skewX","skewXSelf","skewY","skewYSelf","slice","slope","small","smil","smoothingTimeConstant","snapToLines","snapshotItem","snapshotLength","some","sort","source","sourceBuffer","sourceBuffers","sourceIndex","spacing","span","speakAs","speaking","specified","specularConstant","specularExponent","speechSynthesis","speed","speedOfSound","spellcheck","splice","split","splitText","spreadMethod","sqrt","src","srcElement","srcFilter","srcUrn","srcdoc","srclang","srcset","stack","stackTraceLimit","stacktrace","standalone","standby","start","startContainer","startIce","startOffset","startRendering","startTime","startsWith","state","status","statusMessage","statusText","statusbar","stdDeviationX","stdDeviationY","stencilFunc","stencilFuncSeparate","stencilMask","stencilMaskSeparate","stencilOp","stencilOpSeparate","step","stepDown","stepMismatch","stepUp","sticky","stitchTiles","stop","stop-color","stop-opacity","stopColor","stopImmediatePropagation","stopOpacity","stopPropagation","storageArea","storageName","storageStatus","storeSiteSpecificTrackingException","storeWebWideTrackingException","stpVersion","stream","strike","stringValue","stringify","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeRect","strokeStyle","strokeText","strokeWidth","style","styleFloat","styleMedia","styleSheet","styleSheetSets","styleSheets","sub","subarray","subject","submit","subscribe","substr","substring","substringData","subtle","suffix","suffixes","summary","sup","supports","surfaceScale","surroundContents","suspend","suspendRedraw","swapCache","swapNode","sweepFlag","symbols","system","systemCode","systemId","systemLanguage","systemXDPI","systemYDPI","tBodies","tFoot","tHead","tabIndex","table","table-layout","tableLayout","tableValues","tag","tagName","tagUrn","tags","taintEnabled","takeRecords","tan","tanh","target","targetElement","targetTouches","targetX","targetY","tel","terminate","test","texImage2D","texParameterf","texParameteri","texSubImage2D","text","text-align","text-anchor","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","textAlign","textAlignLast","textAnchor","textAutospace","textBaseline","textContent","textDecoration","textDecorationBlink","textDecorationColor","textDecorationLine","textDecorationLineThrough","textDecorationNone","textDecorationOverline","textDecorationStyle","textDecorationUnderline","textIndent","textJustify","textJustifyTrim","textKashida","textKashidaSpace","textLength","textOverflow","textRendering","textShadow","textTracks","textTransform","textUnderlinePosition","then","threadId","threshold","tiltX","tiltY","time","timeEnd","timeStamp","timeout","timestamp","timestampOffset","timing","title","toArray","toBlob","toDataURL","toDateString","toElement","toExponential","toFixed","toFloat32Array","toFloat64Array","toGMTString","toISOString","toJSON","toLocaleDateString","toLocaleFormat","toLocaleLowerCase","toLocaleString","toLocaleTimeString","toLocaleUpperCase","toLowerCase","toMethod","toPrecision","toSdp","toSource","toStaticHTML","toString","toStringTag","toTimeString","toUTCString","toUpperCase","toggle","toggleLongPressEnabled","tooLong","toolbar","top","topMargin","total","totalFrameDelay","totalVideoFrames","touchAction","touches","trace","track","transaction","transactions","transform","transform-origin","transform-style","transformOrigin","transformPoint","transformString","transformStyle","transformToDocument","transformToFragment","transition","transition-delay","transition-duration","transition-property","transition-timing-function","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","translateSelf","translationX","translationY","trim","trimLeft","trimRight","trueSpeed","trunc","truncate","type","typeDetail","typeMismatch","typeMustMatch","types","ubound","undefined","unescape","uneval","unicode-bidi","unicodeBidi","uniform1f","uniform1fv","uniform1i","uniform1iv","uniform2f","uniform2fv","uniform2i","uniform2iv","uniform3f","uniform3fv","uniform3i","uniform3iv","uniform4f","uniform4fv","uniform4i","uniform4iv","uniformMatrix2fv","uniformMatrix3fv","uniformMatrix4fv","unique","uniqueID","uniqueNumber","unitType","units","unloadEventEnd","unloadEventStart","unlock","unmount","unobserve","unpause","unpauseAnimations","unreadCount","unregister","unregisterContentHandler","unregisterProtocolHandler","unscopables","unselectable","unshift","unsubscribe","unsuspendRedraw","unsuspendRedrawAll","unwatch","unwrapKey","update","updateCommands","updateIce","updateInterval","updateSettings","updated","updating","upload","upper","upperBound","upperOpen","uri","url","urn","urns","usages","useCurrentView","useMap","useProgram","usedSpace","userAgent","userLanguage","username","v8BreakIterator","vAlign","vLink","valid","validateProgram","validationMessage","validity","value","valueAsDate","valueAsNumber","valueAsString","valueInSpecifiedUnits","valueMissing","valueOf","valueText","valueType","values","vector-effect","vectorEffect","velocityAngular","velocityExpansion","velocityX","velocityY","vendor","vendorSub","verify","version","vertexAttrib1f","vertexAttrib1fv","vertexAttrib2f","vertexAttrib2fv","vertexAttrib3f","vertexAttrib3fv","vertexAttrib4f","vertexAttrib4fv","vertexAttribDivisorANGLE","vertexAttribPointer","vertical","vertical-align","verticalAlign","verticalOverflow","vibrate","videoHeight","videoTracks","videoWidth","view","viewBox","viewBoxString","viewTarget","viewTargetString","viewport","viewportAnchorX","viewportAnchorY","viewportElement","visibility","visibilityState","visible","vlinkColor","voice","volume","vrml","vspace","w","wand","warn","wasClean","watch","watchPosition","webdriver","webkitAddKey","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppearance","webkitAudioContext","webkitAudioDecodedByteCount","webkitAudioPannerNode","webkitBackfaceVisibility","webkitBackground","webkitBackgroundAttachment","webkitBackgroundClip","webkitBackgroundColor","webkitBackgroundImage","webkitBackgroundOrigin","webkitBackgroundPosition","webkitBackgroundPositionX","webkitBackgroundPositionY","webkitBackgroundRepeat","webkitBackgroundSize","webkitBackingStorePixelRatio","webkitBorderImage","webkitBorderImageOutset","webkitBorderImageRepeat","webkitBorderImageSlice","webkitBorderImageSource","webkitBorderImageWidth","webkitBoxAlign","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxSizing","webkitCancelAnimationFrame","webkitCancelFullScreen","webkitCancelKeyRequest","webkitCancelRequestAnimationFrame","webkitClearResourceTimings","webkitClosedCaptionsVisible","webkitConvertPointFromNodeToPage","webkitConvertPointFromPageToNode","webkitCreateShadowRoot","webkitCurrentFullScreenElement","webkitCurrentPlaybackTargetIsWireless","webkitDirectionInvertedFromDevice","webkitDisplayingFullscreen","webkitEnterFullScreen","webkitEnterFullscreen","webkitExitFullScreen","webkitExitFullscreen","webkitExitPointerLock","webkitFullScreenKeyboardInputAllowed","webkitFullscreenElement","webkitFullscreenEnabled","webkitGenerateKeyRequest","webkitGetAsEntry","webkitGetDatabaseNames","webkitGetEntries","webkitGetEntriesByName","webkitGetEntriesByType","webkitGetFlowByName","webkitGetGamepads","webkitGetImageDataHD","webkitGetNamedFlows","webkitGetRegionFlowRanges","webkitGetUserMedia","webkitHasClosedCaptions","webkitHidden","webkitIDBCursor","webkitIDBDatabase","webkitIDBDatabaseError","webkitIDBDatabaseException","webkitIDBFactory","webkitIDBIndex","webkitIDBKeyRange","webkitIDBObjectStore","webkitIDBRequest","webkitIDBTransaction","webkitImageSmoothingEnabled","webkitIndexedDB","webkitInitMessageEvent","webkitIsFullScreen","webkitKeys","webkitLineDashOffset","webkitLockOrientation","webkitMatchesSelector","webkitMediaStream","webkitNotifications","webkitOfflineAudioContext","webkitOrientation","webkitPeerConnection00","webkitPersistentStorage","webkitPointerLockElement","webkitPostMessage","webkitPreservesPitch","webkitPutImageDataHD","webkitRTCPeerConnection","webkitRegionOverset","webkitRequestAnimationFrame","webkitRequestFileSystem","webkitRequestFullScreen","webkitRequestFullscreen","webkitRequestPointerLock","webkitResolveLocalFileSystemURL","webkitSetMediaKeys","webkitSetResourceTimingBufferSize","webkitShadowRoot","webkitShowPlaybackTargetPicker","webkitSlice","webkitSpeechGrammar","webkitSpeechGrammarList","webkitSpeechRecognition","webkitSpeechRecognitionError","webkitSpeechRecognitionEvent","webkitStorageInfo","webkitSupportsFullscreen","webkitTemporaryStorage","webkitTextSizeAdjust","webkitTransform","webkitTransformOrigin","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitURL","webkitUnlockOrientation","webkitUserSelect","webkitVideoDecodedByteCount","webkitVisibilityState","webkitWirelessVideoPlaybackDisabled","webkitdropzone","webstore","weight","whatToShow","wheelDelta","wheelDeltaX","wheelDeltaY","which","white-space","whiteSpace","wholeText","widows","width","will-change","willChange","willValidate","window","withCredentials","word-break","word-spacing","word-wrap","wordBreak","wordSpacing","wordWrap","wrap","wrapKey","write","writeln","writingMode","x","x1","x2","xChannelSelector","xmlEncoding","xmlStandalone","xmlVersion","xmlbase","xmllang","xmlspace","y","y1","y2","yChannelSelector","yandex","z","z-index","zIndex","zoom","zoomAndPan","zoomRectScreen"]; -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ -"use strict";function n(e){return e.split("")}function i(e,t){return t.indexOf(e)>=0}function r(e,t){for(var n=0,i=t.length;n=0&&!l(););u.reverse(),c.reverse()}else for(s=0;s=0;)e[n]===t&&e.splice(n,1)}function D(e,t){if(e.length<2)return e.slice();return function e(n){if(n.length<=1)return n;var i=Math.floor(n.length/2),r=n.slice(0,i),o=n.slice(i);return function(e,n){for(var i=[],r=0,o=0,a=0;r3){n.sort(function(e,t){return t.length-e.length}),t+="switch(str.length){";for(i=0;i=0;)if(!t(e[n]))return!1;return!0}function A(){this._values=Object.create(null),this._size=0}function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function T(e){for(var t,n=e.parent(-1),i=0;t=e.parent(i);i++){if(t instanceof F&&t.body===n)return!0;if(!(t instanceof Me&&t.expressions[0]===n||"Call"==t.TYPE&&t.expression===n||t instanceof we&&t.expression===n||t instanceof xe&&t.expression===n||t instanceof Pe&&t.condition===n||t instanceof Ve&&t.left===n||t instanceof Le&&t.expression===n))return!1;n=t}}function b(e,t){return!0===e||e instanceof RegExp&&e.test(t)}function y(t,n,i,r){arguments.length<4&&(r=O);var o=n=n?n.split(/\s+/):[];r&&r.PROPS&&(n=n.concat(r.PROPS));for(var a="return function AST_"+t+"(props){ if (props) { ",s=n.length;--s>=0;)a+="this."+n[s]+" = props."+n[s]+";";var u=r&&new r;(u&&u.initialize||i&&i.initialize)&&(a+="this.initialize();"),a+="}}";var c=new Function(a)();if(u&&(c.prototype=u,c.BASE=r),r&&r.SUBCLASSES.push(c),c.prototype.CTOR=c,c.PROPS=n||null,c.SELF_PROPS=o,c.SUBCLASSES=[],t&&(c.prototype.TYPE=c.TYPE=t),i)for(s in i)S(i,s)&&(/^\$/.test(s)?c[s.substr(1)]=i[s]:c.prototype[s]=i[s]);return c.DEFMETHOD=function(e,t){this.prototype[e]=t},void 0!==e&&(e["AST_"+t]=c),c}A.prototype={set:function(e,t){return this.has(e)||++this._size,this._values["$"+e]=t,this},add:function(e,t){return this.has(e)?this.get(e).push(t):this.set(e,[t]),this},get:function(e){return this._values["$"+e]},del:function(e){return this.has(e)&&(--this._size,delete this._values["$"+e]),this},has:function(e){return"$"+e in this._values},each:function(e){for(var t in this._values)e(this._values[t],t.substr(1))},size:function(){return this._size},map:function(e){var t=[];for(var n in this._values)t.push(e(this._values[n],n.substr(1)));return t},clone:function(){var e=new A;for(var t in this._values)e._values[t]=this._values[t];return e._size=this._size,e},toObject:function(){return this._values}},A.fromObject=function(e){var t=new A;return t._size=u(t._values,e),t},e.Dictionary=A;var C=y("Token","type value line col pos endline endcol endpos nlb comments_before comments_after file raw",{},null),O=y("Node","start end",{_clone:function(e){if(e){var t=this.clone();return t.transform(new vn(function(e){if(e!==t)return e.clone(!0)}))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)}},null);O.warn_function=null,O.warn=function(e,t){O.warn_function&&O.warn_function(E(e,t))};var F=y("Statement",null,{$documentation:"Base class of all statements"}),R=y("Debugger",null,{$documentation:"Represents a debugger statement"},F),M=y("Directive","value quote",{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},F),N=y("SimpleStatement","body",{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,function(){this.body._walk(e)})}},F);function w(e,t){var n=e.body;if(n instanceof O)n._walk(t);else for(var i=0,r=n.length;i SymbolDef for all variables/functions defined in this scope",functions:"[Object/S] like `variables`, but only lists function declarations",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){for(var e=this;e.is_block_scope();)e=e.parent_scope;return e},clone:function(e){var t=this._clone(e);return this.variables&&(t.variables=this.variables.clone()),this.functions&&(t.functions=this.functions.clone()),this.enclosed&&(t.enclosed=this.enclosed.slice()),t},pinned:function(){return this.uses_eval||this.uses_with}},k),q=y("Toplevel","globals",{$documentation:"The toplevel scope",$propdoc:{globals:"[Object/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body,n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";return n=(n=gn(n)).transform(new vn(function(e){if(e instanceof M&&"$ORIG"==e.value)return _.splice(t)}))},wrap_enclose:function(e){"string"!=typeof e&&(e="");var t=e.indexOf(":");t<0&&(t=e.length);var n=this.body;return gn(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new vn(function(e){if(e instanceof M&&"$ORIG"==e.value)return _.splice(n)}))}},Y),$=y("Expansion","expression",{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){var t=this;return e._visit(this,function(){t.expression.walk(e)})}}),j=y("Lambda","name argnames uses_arguments is_generator async",{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){for(var e=[],t=0;t b)"},j),ee=y("Defun","inlined",{$documentation:"A function definition"},j),te=y("Destructuring","names is_array",{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,function(){this.names.forEach(function(t){t._walk(e)})})},all_symbols:function(){var e=[];return this.walk(new It(function(t){t instanceof Ze&&e.push(t),t instanceof $&&e.push(t.expression)})),e}}),ne=y("PrefixedTemplateString","template_string prefix",{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_SymbolRef|AST_PropAccess] The prefix, which can be a symbol such as `foo` or a dotted expression such as `String.raw`."},_walk:function(e){this.prefix._walk(e),this.template_string._walk(e)}}),ie=y("TemplateString","segments",{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,function(){this.segments.forEach(function(t){t._walk(e)})})}}),re=y("TemplateSegment","value raw",{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw content of the segment"}}),oe=y("Jump",null,{$documentation:"Base class for \u201cjumps\u201d (for now that's `return`, `throw`, `break` and `continue`)"},F),ae=y("Exit","value",{$documentation:"Base class for \u201cexits\u201d (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e)})}},oe),se=y("Return",null,{$documentation:"A `return` statement"},ae),ue=y("Throw",null,{$documentation:"A `throw` statement"},ae),ce=y("LoopControl","label",{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e)})}},oe),le=y("Break",null,{$documentation:"A `break` statement"},ce),fe=y("Continue",null,{$documentation:"A `continue` statement"},ce),pe=y("If","condition alternative",{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,function(){this.condition._walk(e),this.body._walk(e),this.alternative&&this.alternative._walk(e)})}},V),de=y("Switch","expression",{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` \u201cdiscriminant\u201d"},_walk:function(e){return e._visit(this,function(){this.expression._walk(e),w(this,e)})}},k),_e=y("SwitchBranch",null,{$documentation:"Base class for `switch` branches"},k),me=y("Default",null,{$documentation:"A `default` switch branch"},_e),Ee=y("Case","expression",{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,function(){this.expression._walk(e),w(this,e)})}},_e),he=y("Try","bcatch bfinally",{$documentation:"A `try` statement",$propdoc:{bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,function(){w(this,e),this.bcatch&&this.bcatch._walk(e),this.bfinally&&this.bfinally._walk(e)})}},k),De=y("Catch","argname",{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,function(){this.argname&&this.argname._walk(e),w(this,e)})}},k),ge=y("Finally",null,{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},k),ve=y("Definitions","definitions",{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,function(){for(var t=this.definitions,n=0,i=t.length;n a`"},Ve),Ue=y("Array","elements",{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,function(){for(var t=this.elements,n=0,i=t.length;n=0;){var i=t[n];if(i instanceof e)return i}},has_directive:function(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof Y&&n.body)for(var i=0;i=0;){if((i=t[n])instanceof P&&i.label.name==e.label.name)return i.body}else for(n=t.length;--n>=0;){var i;if((i=t[n])instanceof B||e instanceof le&&i instanceof de)return i}}};var Lt="break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with",Vt="false null true",Pt="enum implements import interface package private protected public static super this "+Vt+" "+Lt,Bt="return new delete throw else case yield await";Lt=g(Lt),Pt=g(Pt),Bt=g(Bt),Vt=g(Vt);var Kt=g(n("+-*&%=<>!?|~^")),Ut=/[0-9a-f]/i,Gt=/^0x[0-9a-f]+$/i,Ht=/^0[0-7]+$/,Xt=/^0o[0-7]+$/i,zt=/^0b[01]+$/i,Wt=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,Yt=g(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","||"]),qt=g(n(" \xa0\n\r\t\f\v\u200b\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff")),$t=g(n("\n\r\u2028\u2029")),jt=g(n(";]),:")),Zt=g(n("[{(,;:")),Qt=g(n("[]{}(),;:")),Jt={ID_Start:/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u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\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\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50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\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DE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uD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uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};function en(e,t){var n=e.charAt(t);if(tn(n)){var i=e.charAt(t+1);if(nn(i))return n+i}if(nn(n)){var r=e.charAt(t-1);if(tn(r))return r+n}return n}function tn(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e>=55296&&e<=56319}function nn(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e>=56320&&e<=57343}function rn(e){return e>=48&&e<=57}function on(e){return"string"==typeof e&&!Pt(e)}function an(e){var t=e.charCodeAt(0);return Jt.ID_Start.test(e)||36==t||95==t}function sn(e){var t=e.charCodeAt(0);return Jt.ID_Continue.test(e)||36==t||95==t||8204==t||8205==t}function un(e){return/^[a-z_$][a-z0-9_$]*$/i.test(e)}function cn(e,t,n,i,r){this.message=e,this.filename=t,this.line=n,this.col=i,this.pos=r}function ln(e,t,n,i,r){throw new cn(e,t,n,i,r)}function fn(e,t,n){return e.type==t&&(null==n||e.value==n)}cn.prototype=Object.create(Error.prototype),cn.prototype.constructor=cn,cn.prototype.name="SyntaxError",o(cn);var pn={};function dn(e,t,n,i){var r={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function o(){return en(r.text,r.pos)}function a(e,t){var n=en(r.text,r.pos++);if(e&&!n)throw pn;return $t(n)?(r.newline_before=r.newline_before||!t,++r.line,r.col=0,t||"\r"!=n||"\n"!=o()||(++r.pos,n="\n")):(n.length>1&&(++r.pos,++r.col),++r.col),n}function s(e){for(;e-- >0;)a()}function u(e){return r.text.substr(r.pos,e.length)==e}function c(e,t){var n=r.text.indexOf(e,r.pos);if(t&&-1==n)throw pn;return n}function l(){r.tokline=r.line,r.tokcol=r.col,r.tokpos=r.pos}var f=!1,p=null;function d(n,i,o){r.regex_allowed="operator"==n&&!mn(i)||"keyword"==n&&Bt(i)||"punc"==n&&Zt(i)||"arrow"==n,"punc"==n&&"."==i?f=!0:o||(f=!1);var a={type:n,value:i,line:r.tokline,col:r.tokcol,pos:r.tokpos,endline:r.line,endcol:r.col,endpos:r.pos,nlb:r.newline_before,file:t};return/^(?:num|string|regexp)$/i.test(n)&&(a.raw=e.substring(a.pos,a.endpos)),o||(a.comments_before=r.comments_before,a.comments_after=r.comments_before=[]),r.newline_before=!1,a=new C(a),o||(p=a),a}function _(){for(;qt(o());)a()}function m(e){ln(e,t,r.tokline,r.tokcol,r.tokpos)}function E(e){var t=!1,n=!1,i=!1,r="."==e,s=function(e){for(var t,n="",i=0;(t=o())&&e(t,i++);)n+=a();return n}(function(o,a){switch(o.charCodeAt(0)){case 98:case 66:return i=!0;case 111:case 79:case 120:case 88:return!i&&(i=!0);case 101:case 69:return!!i||!t&&(t=n=!0);case 45:return n||0==a&&!e;case 43:return n;case n=!1,46:return!(r||i||t)&&(r=!0)}return Ut.test(o)});e&&(s=e+s),Ht.test(s)&&R.has_directive("use strict")&&m("Legacy octal literals are not allowed in strict mode");var u=function(e){if(Gt.test(e))return parseInt(e.substr(2),16);if(Ht.test(e))return parseInt(e.substr(1),8);if(Xt.test(e))return parseInt(e.substr(2),8);if(zt.test(e))return parseInt(e.substr(2),2);if(Wt.test(e))return parseFloat(e);var t=parseFloat(e);return t==e?t:void 0}(s);if(!isNaN(u))return d("num",u);m("Invalid syntax: "+s)}function h(e,t,n){var i,s=a(!0,e);switch(s.charCodeAt(0)){case 110:return"\n";case 114:return"\r";case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 120:return String.fromCharCode(D(2,t));case 117:if("{"==o()){for(a(!0),"}"===o()&&m("Expecting hex-character between {}");"0"==o();)a(!0);var u,l=c("}",!0)-r.pos;return(l>6||(u=D(l,t))>1114111)&&m("Unicode reference out of bounds"),a(!0),(i=u)>65535?(i-=65536,String.fromCharCode(55296+(i>>10))+String.fromCharCode(i%1024+56320)):String.fromCharCode(i)}return String.fromCharCode(D(4,t));case 10:return"";case 13:if("\n"==o())return a(!0,e),""}return s>="0"&&s<="7"?(n&&t&&m("Octal escape sequences are not allowed in template strings"),function(e,t){var n=o();n>="0"&&n<="7"&&(e+=a(!0))[0]<="3"&&(n=o())>="0"&&n<="7"&&(e+=a(!0));if("0"===e)return"\0";e.length>0&&R.has_directive("use strict")&&t&&m("Legacy octal escape sequences are not allowed in strict mode");return String.fromCharCode(parseInt(e,8))}(s,t)):s}function D(e,t){for(var n=0;e>0;--e){if(!t&&isNaN(parseInt(o(),16)))return parseInt(n,16)||"";var i=a(!0);isNaN(parseInt(i,16))&&m("Invalid hex-character pattern in string"),n+=i}return parseInt(n,16)}var g=F("Unterminated string constant",function(e){for(var t=a(),n="";;){var i=a(!0,!0);if("\\"==i)i=h(!0,!0);else if($t(i))m("Unterminated string constant");else if(i==t)break;n+=i}var r=d("string",n);return r.quote=e,r}),v=F("Unterminated template",function(e){e&&r.template_braces.push(r.brace_counter);var t,n,i="",s="";for(a(!0,!0);"`"!=(t=a(!0,!0));){if("\r"==t)"\n"==o()&&++r.pos,t="\n";else if("$"==t&&"{"==o())return a(!0,!0),r.brace_counter++,(n=d(e?"template_head":"template_substitution",i)).begin=e,n.raw=s,n.end=!1,n;if(s+=t,"\\"==t){var u=r.pos;t=h(!0,!("name"===p.type||"punc"===p.type&&(")"===p.value||"]"===p.value)),!0),s+=r.text.substr(u,r.pos-u)}i+=t}return r.template_braces.pop(),(n=d(e?"template_head":"template_substitution",i)).begin=e,n.raw=s,n.end=!0,n});function A(e){var t,n=r.regex_allowed,i=function(){for(var e=r.text,t=r.pos,n=r.text.length;t=0,r.regex_allowed=e,R}),T=F("Unterminated identifier name",function(){var e,t="",n=!1,i=function(){return n=!0,a(),"u"!==o()&&m("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"),h(!1,!0)};if("\\"===(t=o()))an(t=i())||m("First identifier char is an invalid identifier char");else{if(!an(t))return"";a()}for(;null!=(e=o());){if("\\"===(e=o()))sn(e=i())||m("Invalid escaped identifier char");else{if(!sn(e))break;a()}t+=e}return Pt(t)&&n&&m("Escaped characters are not allowed in keywords"),t}),b=F("Unterminated regular expression",function(e){for(var t,n=!1,i=!1;t=a(!0);)if($t(t))m("Unexpected line terminator");else if(n)e+="\\"+t,n=!1;else if("["==t)i=!0,e+=t;else if("]"==t&&i)i=!1,e+=t;else{if("/"==t&&!i)break;"\\"==t?n=!0:e+=t}var r=T();try{var o=new RegExp(e,r);return o.raw_source="/"+e+"/"+r,d("regexp",o)}catch(e){m(e.message)}});function y(e){return d("operator",function e(t){if(!o())return t;var n=t+o();return Yt(n)?(a(),e(n)):t}(e||a()))}function O(){switch(a(),o()){case"/":return a(),A("comment1");case"*":return a(),S()}return r.regex_allowed?b(""):y("/")}function F(e,t){return function(n){try{return t(n)}catch(t){if(t!==pn)throw t;m(e)}}}function R(e){if(null!=e)return b(e);for(i&&0==r.pos&&u("#!")&&(l(),s(2),A("comment5"));;){if(_(),l(),n){if(u("\x3c!--")){s(4),A("comment3");continue}if(u("--\x3e")&&r.newline_before){s(3),A("comment4");continue}}var t=o();if(!t)return d("eof");var c=t.charCodeAt(0);switch(c){case 34:case 39:return g(t);case 46:return a(),rn(o().charCodeAt(0))?E("."):"."===o()?(a(),a(),d("expand","...")):d("punc",".");case 47:var p=O();if(p===R)continue;return p;case 61:return a(),">"===o()?(a(),d("arrow","=>")):y("=");case 96:return v(!0);case 123:r.brace_counter++;break;case 125:if(r.brace_counter--,r.template_braces.length>0&&r.template_braces[r.template_braces.length-1]===r.brace_counter)return v(!1)}if(rn(c))return E();if(Qt(t))return d("punc",a());if(Kt(t))return y();if(92==c||an(t))return h=void 0,h=T(),f?d("name",h):Vt(h)?d("atom",h):Lt(h)?Yt(h)?d("operator",h):d("keyword",h):d("name",h);break}var h;m("Unexpected character '"+t+"'")}return R.next=a,R.peek=o,R.context=function(e){return e&&(r=e),r},R.add_directive=function(e){r.directive_stack[r.directive_stack.length-1].push(e),void 0===r.directives[e]?r.directives[e]=1:r.directives[e]++},R.push_directives_stack=function(){r.directive_stack.push([])},R.pop_directives_stack=function(){for(var e=r.directive_stack[r.directive_stack.length-1],t=0;t0},R}var _n=g(["typeof","void","delete","--","++","!","~","-","+"]),mn=g(["--","++"]),En=g(["=","+=","-=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]),hn=function(e,t){for(var n=0;n","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{}),Dn=g(["atom","num","string","regexp","name"]);function gn(e,t){t=s(t,{bare_returns:!1,ecma:8,expression:!1,filename:null,html5_comments:!0,module:!1,shebang:!0,strict:!1,toplevel:null},!0);var n={input:"string"==typeof e?dn(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:!0,in_loop:0,labels:[]};function i(e,t){return fn(n.token,e,t)}function o(){return n.peeked||(n.peeked=n.input())}function a(){return n.prev=n.token,n.peeked||o(),n.token=n.peeked,n.peeked=null,n.in_directives=n.in_directives&&("string"==n.token.type||i("punc",";")),n.token}function u(){return n.prev}function c(e,t,i,r){var o=n.input.context();ln(e,o.filename,null!=t?t:o.tokline,null!=i?i:o.tokcol,null!=r?r:o.tokpos)}function l(e,t){c(t,e.line,e.col)}function f(e){null==e&&(e=n.token),l(e,"Unexpected token: "+e.type+" ("+e.value+")")}function p(e,t){if(i(e,t))return a();l(n.token,"Unexpected token "+n.token.type+" \xab"+n.token.value+"\xbb, expected "+e+" \xab"+t+"\xbb")}function d(e){return p("punc",e)}function _(e){return e.nlb||!v(e.comments_before,function(e){return!e.nlb})}function m(){return!t.strict&&(i("eof")||i("punc","}")||_(n.token))}function E(){return n.in_generator===n.in_function}function h(){return n.in_async===n.in_function}function D(e){i("punc",";")?a():e||m()||f()}function g(){d("(");var e=tn(!0);return d(")"),e}function A(e){return function(){var t=n.token,i=e.apply(null,arguments),r=u();return i.start=t,i.end=r,i}}function T(){(i("operator","/")||i("operator","/="))&&(n.peeked=null,n.token=n.input(n.token.value.substr(1)))}n.token=a();var b=A(function(e,s,E){switch(T(),n.token.type){case"string":if(n.in_directives){var v=o();-1==n.token.raw.indexOf("\\")&&(fn(v,"punc",";")||fn(v,"punc","}")||_(v)||fn(v,"eof"))?n.input.add_directive(n.token.value):n.in_directives=!1}var A=n.in_directives,S=y();return A&&S.body instanceof At?new M(S.body):S;case"template_head":case"num":case"regexp":case"operator":case"atom":return y();case"name":if("async"==n.token.value&&fn(o(),"keyword","function"))return a(),a(),s&&c("functions are not allowed as the body of a loop"),w(ee,!1,!0,e);if("import"==n.token.value&&!fn(o(),"punc","(")){a();var O=function(){var e,t,r=u();i("name")&&(e=Ht(ft));i("punc",",")&&a();((t=Bt(!0))||e)&&p("name","from");var o=n.token;"string"!==o.type&&f();return a(),new ye({start:r,imported_name:e,imported_names:t,module_name:new At({start:o,value:o.value,quote:o.quote,end:o}),end:n.token})}();return D(),O}return fn(o(),"punc",":")?function(){var e=Ht(dt);"await"===e.name&&h()&&l(n.prev,"await cannot be used as label inside async function");r(function(t){return t.name==e.name},n.labels)&&c("Label "+e.name+" defined twice");d(":"),n.labels.push(e);var t=b();n.labels.pop(),t instanceof B||e.references.forEach(function(t){t instanceof fe&&(t=t.label.start,c("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos))});return new P({body:t,label:e})}():y();case"punc":switch(n.token.value){case"{":return new I({start:n.token,body:Y(),end:u()});case"[":case"(":return y();case";":return n.in_directives=!1,a(),new L;default:f()}case"keyword":switch(n.token.value){case"break":return a(),C(le);case"continue":return a(),C(fe);case"debugger":return a(),D(),new R;case"do":a();var F=nn(b);p("keyword","while");var x=g();return D(!0),new U({body:F,condition:x});case"while":return a(),new G({condition:g(),body:nn(function(){return b(!1,!0)})});case"for":return a(),function(){var e="`for await` invalid in this context",t=n.token;"name"==t.type&&"await"==t.value?(h()||l(t,e),a()):t=!1;d("(");var r=null;if(i("punc",";"))t&&l(t,e);else{r=i("keyword","var")?(a(),ce(!0)):i("keyword","let")?(a(),_e(!0)):i("keyword","const")?(a(),ke(!0)):tn(!0,!0);var o=i("operator","in"),s=i("name","of");if(t&&!s&&l(t,e),o||s)return r instanceof ve?r.definitions.length>1&&l(r.start,"Only one variable declaration allowed in for..in loop"):Qt(r)||(r=Jt(r))instanceof te||l(r.start,"Invalid left-hand side in for..in loop"),a(),o?function(e){var t=tn(!0);return d(")"),new X({init:e,object:t,body:nn(function(){return b(!1,!0)})})}(r):function(e,t){var n=e instanceof ve?e.definitions[0].name:null,i=tn(!0);return d(")"),new z({await:t,init:e,name:n,object:i,body:nn(function(){return b(!1,!0)})})}(r,!!t)}return function(e){d(";");var t=i("punc",";")?null:tn(!0);d(";");var n=i("punc",")")?null:tn(!0);return d(")"),new H({init:e,condition:t,step:n,body:nn(function(){return b(!1,!0)})})}(r)}();case"class":return a(),s&&c("classes are not allowed as the body of a loop"),E&&c("classes are not allowed as the body of an if"),Mt($e);case"function":return a(),s&&c("functions are not allowed as the body of a loop"),w(ee,!1,!1,e);case"if":return a(),function(){var e=g(),t=b(!1,!1,!0),n=null;i("keyword","else")&&(a(),n=b(!1,!1,!0));return new pe({condition:e,body:t,alternative:n})}();case"return":0!=n.in_function||t.bare_returns||c("'return' outside of function"),a();var V=null;return i("punc",";")?a():m()||(V=tn(!0),D()),new se({value:V});case"switch":return a(),new de({expression:g(),body:nn(oe)});case"throw":a(),_(n.token)&&c("Illegal newline after 'throw'");V=tn(!0);return D(),new ue({value:V});case"try":return a(),function(){var e=Y(),t=null,r=null;if(i("keyword","catch")){var o=n.token;if(a(),i("punc","{"))var s=null;else{d("(");var s=k(void 0,lt);d(")")}t=new De({start:o,argname:s,body:Y(),end:u()})}if(i("keyword","finally")){var o=n.token;a(),r=new ge({start:o,body:Y(),end:u()})}t||r||c("Missing catch/finally blocks");return new he({body:e,bcatch:t,bfinally:r})}();case"var":a();O=ce();return D(),O;case"let":a();O=_e();return D(),O;case"const":a();O=ke();return D(),O;case"with":return n.input.has_directive("use strict")&&c("Strict mode may not include a with statement"),a(),new W({expression:g(),body:b()});case"export":if(!fn(o(),"punc","(")){a();O=function(){var e,t,r,s,c,l=n.token;if(i("keyword","default"))e=!0,a();else if(t=Bt(!1)){if(i("name","from")){a();var p=n.token;return"string"!==p.type&&f(),a(),new Ce({start:l,is_default:e,exported_names:t,module_name:new At({start:p,value:p.value,quote:p.quote,end:p}),end:u()})}return new Ce({start:l,is_default:e,exported_names:t,end:u()})}i("punc","{")||e&&(i("keyword","class")||i("keyword","function"))&&fn(o(),"punc")?(s=tn(!1),D()):(r=b(e))instanceof ve&&e?f(r.start):r instanceof ve||r instanceof j||r instanceof $e?c=r:r instanceof N?s=r.body:f(r.start);return new Ce({start:l,is_default:e,exported_value:s,exported_definition:c,end:u()})}();return i("punc",";")&&D(),O}}}f()});function y(e){return new N({body:(e=tn(!0),D(),e)})}function C(e){var t,i=null;m()||(i=Ht(ht,!0)),null!=i?((t=r(function(e){return e.name==i.name},n.labels))||c("Undefined label "+i.name),i.thedef=t):0==n.in_loop&&c(e.TYPE+" not inside a loop or switch"),D();var o=new e({label:i});return t&&t.references.push(o),o}var F=function(e,t,r){_(n.token)&&c("Unexpected newline before arrow (=>)"),p("arrow","=>");var o=K(i("punc","{"),!1,r),a=o instanceof Array&&o.length?o[o.length-1].end:o instanceof Array?e:o.end;return new J({start:e,end:a,async:r,argnames:t,body:o})},w=function(e,t,r,o){n.token;var s=e===ee,c=i("operator","*");c&&a();var l=i("name")?Ht(s?ot:st):null;s&&!l&&(o?e=Q:f()),!l||e===Z||l instanceof Je||f(u());var p=[],d=K(!0,c||t,r,l,p);return new e({start:p.start,end:d.end,is_generator:c,async:r,name:l,argnames:p,body:d})};function x(e,t){var n={},i=!1,r=!1,o=!1,a=!!t,s={add_parameter:function(t){if(void 0!==n["$"+t.value])!1===i&&(i=t),s.check_strict();else if(n["$"+t.value]=!0,e)switch(t.value){case"arguments":case"eval":case"yield":a&&l(t,"Unexpected "+t.value+" identifier as parameter inside strict mode");break;default:Pt(t.value)&&f()}},mark_default_assignment:function(e){!1===r&&(r=e)},mark_spread:function(e){!1===o&&(o=e)},mark_strict_mode:function(){a=!0},is_strict:function(){return!1!==r||!1!==o||a},check_strict:function(){s.is_strict()&&!1!==i&&l(i,"Parameter "+i.value+" was used already")}};return s}function k(e,t){var r,o=!1;return void 0===e&&(e=x(!0,n.input.has_directive("use strict"))),i("expand","...")&&(o=n.token,e.mark_spread(n.token),a()),r=V(e,t),i("operator","=")&&!1===o&&(e.mark_default_assignment(n.token),a(),r=new Ke({start:r.start,left:r,operator:"=",right:tn(!1),end:n.token})),!1!==o&&(i("punc",")")||f(),r=new $({start:o,expression:r,end:o})),e.check_strict(),r}function V(e,t){var r,s=[],l=!0,p=!1,_=n.token;if(void 0===e&&(e=x(!1,n.input.has_directive("use strict"))),t=void 0===t?rt:t,i("punc","[")){for(a();!i("punc","]");){if(l?l=!1:d(","),i("expand","...")&&(p=!0,r=n.token,e.mark_spread(n.token),a()),i("punc"))switch(n.token.value){case",":s.push(new Ft({start:n.token,end:n.token}));continue;case"]":break;case"[":case"{":s.push(V(e,t));break;default:f()}else i("name")?(e.add_parameter(n.token),s.push(Ht(t))):c("Invalid function parameter");i("operator","=")&&!1===p&&(e.mark_default_assignment(n.token),a(),s[s.length-1]=new Ke({start:s[s.length-1].start,left:s[s.length-1],operator:"=",right:tn(!1),end:n.token})),p&&(i("punc","]")||c("Rest element must be last element"),s[s.length-1]=new $({start:r,expression:s[s.length-1],end:r}))}return d("]"),e.check_strict(),new te({start:_,names:s,is_array:!0,end:u()})}if(i("punc","{")){for(a();!i("punc","}");){if(l?l=!1:d(","),i("expand","...")&&(p=!0,r=n.token,e.mark_spread(n.token),a()),i("name")&&(fn(o(),"punc")||fn(o(),"operator"))&&-1!==[",","}","="].indexOf(o().value)){e.add_parameter(n.token);var m=u(),E=Ht(t);p?s.push(new $({start:r,expression:E,end:E.end})):s.push(new Xe({start:m,key:E.name,value:E,end:E.end}))}else{if(i("punc","}"))continue;var h=n.token,D=Kt();null===D?f(u()):"name"!==u().type||i("punc",":")?(d(":"),s.push(new Xe({start:h,quote:h.quote,key:D,value:V(e,t),end:u()}))):s.push(new Xe({start:u(),key:D,value:new t({start:u(),name:D,end:u()}),end:u()}))}p?i("punc","}")||c("Rest element must be last element"):i("operator","=")&&(e.mark_default_assignment(n.token),a(),s[s.length-1].value=new Ke({start:s[s.length-1].value.start,left:s[s.length-1].value,operator:"=",right:tn(!1),end:n.token}))}return d("}"),e.check_strict(),new te({start:_,names:s,is_array:!1,end:u()})}if(i("name"))return e.add_parameter(n.token),Ht(t);c("Invalid function parameter")}function K(e,r,o,s,u){var c=n.in_loop,l=n.labels,p=n.in_generator,_=n.in_async;if(++n.in_function,r&&(n.in_generator=n.in_function),o&&(n.in_async=n.in_function),u&&function(e){n.token;var r=x(!0,n.input.has_directive("use strict"));for(d("(");!i("punc",")");){var o=k(r);if(e.push(o),i("punc",")")||(d(","),i("punc",")")&&t.ecma<8&&f()),o instanceof $)break}a()}(u),e&&(n.in_directives=!0),n.in_loop=0,n.labels=[],e){n.input.push_directives_stack();var m=Y();s&&Gt(s),u&&u.forEach(Gt),n.input.pop_directives_stack()}else m=tn(!1);return--n.in_function,n.in_loop=c,n.labels=l,n.in_generator=p,n.in_async=_,m}function Y(){d("{");for(var e=[];!i("punc","}");)i("eof")&&f(),e.push(b());return a(),e}function oe(){d("{");for(var e,t=[],r=null,o=null;!i("punc","}");)i("eof")&&f(),i("keyword","case")?(o&&(o.end=u()),r=[],o=new Ee({start:(e=n.token,a(),e),expression:tn(!0),body:r}),t.push(o),d(":")):i("keyword","default")?(o&&(o.end=u()),r=[],o=new me({start:(e=n.token,a(),d(":"),e),body:r}),t.push(o)):(r||f(),r.push(b()));return o&&(o.end=u()),a(),t}function ae(e,t){for(var r,o=[];;){var s="var"===t?et:"const"===t?nt:"let"===t?it:null;if(i("punc","{")||i("punc","[")?r=new Oe({start:n.token,name:V(void 0,s),value:i("operator","=")?(p("operator","="),tn(!1,e)):null,end:u()}):"import"==(r=new Oe({start:n.token,name:Ht(s),value:i("operator","=")?(a(),tn(!1,e)):e||"const"!==t?null:c("Missing initializer in const declaration"),end:u()})).name.name&&c("Unexpected token: import"),o.push(r),!i("punc",","))break;a()}return o}var ce=function(e){return new Ae({start:u(),definitions:ae(e,"var"),end:u()})},_e=function(e){return new Se({start:u(),definitions:ae(e,"let"),end:u()})},ke=function(e){return new Te({start:u(),definitions:ae(e,"const"),end:u()})};function qe(){var e,t=n.token;switch(t.type){case"name":e=Ut(_t);break;case"num":e=new St({start:t,end:t,value:t.value});break;case"string":e=new At({start:t,end:t,value:t.value,quote:t.quote});break;case"regexp":e=new Tt({start:t,end:t,value:t.value});break;case"atom":switch(t.value){case"false":e=new Nt({start:t,end:t});break;case"true":e=new wt({start:t,end:t});break;case"null":e=new yt({start:t,end:t})}}return a(),e}function Ze(e,t,n,i){var r=function(e,t){return t?new Ke({start:e.start,left:e,operator:"=",right:t,end:t.end}):e};return e instanceof Ge?r(new te({start:e.start,end:e.end,is_array:!1,names:e.properties.map(Ze)}),i):e instanceof Xe?(e.value=Ze(e.value,0,[e.key]),r(e,i)):e instanceof Ft?e:e instanceof te?(e.names=e.names.map(Ze),r(e,i)):e instanceof _t?r(new rt({name:e.name,start:e.start,end:e.end}),i):e instanceof $?(e.expression=Ze(e.expression),r(e,i)):e instanceof Ue?r(new te({start:e.start,end:e.end,is_array:!0,names:e.elements.map(Ze)}),i):e instanceof Be?r(Ze(e.left,void 0,void 0,e.right),i):e instanceof Ke?(e.left=Ze(e.left,0,[e.left]),e):void c("Invalid function parameter",e.start.line,e.start.col)}var tt=function(e,r){if(i("operator","new"))return function(e){var r=n.token;if(p("operator","new"),i("punc","."))return a(),p("name","target"),zt(new Qe({start:r,end:u()}),e);var o,s=tt(!1);i("punc","(")?(a(),o=bt(")",t.ecma>=8)):o=[];var c=new Re({start:r,expression:s,args:o,end:u()});return Xt(c),zt(c,e)}(e);var s,c=n.token,l=i("name","async")&&"["!=(s=o()).value&&"arrow"!=s.type&&qe();if(i("punc")){switch(n.token.value){case"(":if(l&&!e)break;var _=function(e,r){var o,s,c,l=[];for(d("(");!i("punc",")");)o&&f(o),i("expand","...")?(o=n.token,r&&(s=n.token),a(),l.push(new $({start:u(),expression:tn(),end:n.token}))):l.push(tn()),i("punc",")")||(d(","),i("punc",")")&&(t.ecma<8&&f(),c=u(),r&&(s=c)));return d(")"),e&&i("arrow","=>")?o&&c&&f(c):s&&f(s),l}(r,!l);if(r&&i("arrow","=>"))return F(c,_.map(Ze),!!l);var m=l?new Fe({expression:l,args:_}):1==_.length?_[0]:new Me({expressions:_});if(m.start){var E=c.comments_before.length;if([].unshift.apply(m.start.comments_before,c.comments_before),c.comments_before=m.start.comments_before,c.comments_before_length=E,0==E&&c.comments_before.length>0){var h=c.comments_before[0];h.nlb||(h.nlb=c.nlb,c.nlb=!1)}c.comments_after=m.start.comments_after}m.start=c;var D=u();return m.end&&(D.comments_before=m.end.comments_before,[].push.apply(m.end.comments_after,D.comments_after),D.comments_after=m.end.comments_after),m.end=D,m instanceof Fe&&Xt(m),zt(m,e);case"[":return zt(Ct(),e);case"{":return zt(Rt(),e)}l||f()}if(r&&i("name")&&fn(o(),"arrow")){var g=new rt({name:n.token.value,start:c,end:c});return a(),F(c,[g],!!l)}if(i("keyword","function")){a();var v=w(Q,!1,!!l);return v.start=c,v.end=u(),zt(v,e)}if(l)return zt(l,e);if(i("keyword","class")){a();var A=Mt(je);return A.start=c,A.end=u(),zt(A,e)}return i("template_head")?zt(vt(!1),e):Dn(n.token.type)?zt(qe(),e):void f()};function vt(e){var t=[],i=n.token;for(t.push(new re({start:n.token,raw:n.token.raw,value:n.token.value,end:n.token}));!1===n.token.end;)a(),T(),t.push(tn(!0)),fn("template_substitution")||f(),t.push(new re({start:n.token,raw:n.token.raw,value:n.token.value,end:n.token}));return a(),new ie({start:i,segments:t,end:n.token})}function bt(e,t,r){for(var o=!0,s=[];!i("punc",e)&&(o?o=!1:d(","),!t||!i("punc",e));)i("punc",",")&&r?s.push(new Ft({start:n.token,end:n.token})):i("expand","...")?(a(),s.push(new $({start:u(),expression:tn(),end:n.token}))):s.push(tn(!1));return a(),s}var Ct=A(function(){return d("["),new Ue({elements:bt("]",!t.strict,!0)})}),Ot=A(function(e,t){return w(Z,e,t)}),Rt=A(function(){var e=n.token,r=!0,o=[];for(d("{");!i("punc","}")&&(r?r=!1:d(","),t.strict||!i("punc","}"));)if("expand"!=(e=n.token).type){var s,c=Kt();if(i("punc",":"))null===c?f(u()):(a(),s=tn(!1));else{var l=It(c,e);if(l){o.push(l);continue}s=new _t({start:u(),name:c,end:u()})}i("operator","=")&&(a(),s=new Be({start:e,left:s,operator:"=",right:tn(!1),end:u()})),o.push(new Xe({start:e,quote:e.quote,key:c instanceof O?c:""+c,value:s,end:u()}))}else a(),o.push(new $({start:e,expression:tn(!1),end:u()}));return a(),new Ge({properties:o})});function Mt(e){var t,r,o,s,c=[];for(n.input.push_directives_stack(),n.input.add_directive("use strict"),"name"==n.token.type&&"extends"!=n.token.value&&(o=Ht(e===$e?ut:ct)),e!==$e||o||f(),"extends"==n.token.value&&(a(),s=tn(!0)),d("{"),i("punc",";")&&a();!i("punc","}");)t=n.token,(r=It(Kt(),t,!0))||f(),c.push(r),i("punc",";")&&a();return n.input.pop_directives_stack(),a(),new e({start:t,name:o,extends:s,properties:c,end:u()})}function It(e,t,r){var o=function(e,t){return"string"==typeof e||"number"==typeof e?new at({start:t,name:""+e,end:u()}):(null===e&&f(),e)},a=!1,s=!1,c=!1,l=t;if(r&&"static"===e&&!i("punc","(")&&(s=!0,l=n.token,e=Kt()),"async"!==e||i("punc","(")||i("punc",",")||i("punc","}")||(a=!0,l=n.token,e=Kt()),null===e&&(c=!0,l=n.token,null===(e=Kt())&&f()),i("punc","("))return e=o(e,t),new Ye({start:t,static:s,is_generator:c,async:a,key:e,quote:e instanceof at?l.quote:void 0,value:Ot(c,a),end:u()});if(l=n.token,"get"==e){if(!i("punc")||i("punc","["))return e=o(Kt(),t),new We({start:t,static:s,key:e,quote:e instanceof at?l.quote:void 0,value:Ot(),end:u()})}else if("set"==e&&(!i("punc")||i("punc","[")))return e=o(Kt(),t),new ze({start:t,static:s,key:e,quote:e instanceof at?l.quote:void 0,value:Ot(),end:u()})}function Lt(e){function t(e){return new e({name:Kt(),start:u(),end:u()})}var r,o,s=e?pt:Et,c=e?ft:mt,l=n.token;return e?r=t(s):o=t(c),i("name","as")?(a(),e?o=t(c):r=t(s)):e?o=new c(r):r=new s(o),new be({start:l,foreign_name:r,name:o,end:u()})}function Vt(e,t){var i,r=e?pt:Et,o=e?ft:mt,a=n.token,s=u();return t=t||new o({name:"*",start:a,end:s}),i=new r({name:"*",start:a,end:s}),new be({start:a,foreign_name:i,name:t,end:s})}function Bt(e){var t;if(i("punc","{")){for(a(),t=[];!i("punc","}");)t.push(Lt(e)),i("punc",",")&&a();a()}else if(i("operator","*")){var n;a(),e&&i("name","as")&&(a(),n=Ht(e?ft:Et)),t=[Vt(e,n)]}return t}function Kt(){var e=n.token;switch(e.type){case"punc":if("["===e.value){a();var t=tn(!1);return d("]"),t}f(e);case"operator":if("*"===e.value)return a(),null;-1===["delete","in","instanceof","new","typeof","void"].indexOf(e.value)&&f(e);case"name":"yield"==e.value&&(E()?l(e,"Yield cannot be used as identifier inside generators"):fn(o(),"punc",":")||fn(o(),"punc","(")||!n.input.has_directive("use strict")||l(e,"Unexpected yield identifier inside strict mode"));case"string":case"num":case"keyword":case"atom":return a(),e.value;default:f(e)}}function Ut(e){var t=n.token.value;return new("this"==t?Dt:"super"==t?gt:e)({name:String(t),start:n.token,end:n.token})}function Gt(e){var t=e.name;E()&&"yield"==t&&l(e.start,"Yield cannot be used as identifier inside generators"),n.input.has_directive("use strict")&&("yield"==t&&l(e.start,"Unexpected yield identifier inside strict mode"),e instanceof Je&&("arguments"==t||"eval"==t)&&l(e.start,"Unexpected "+t+" in strict mode"))}function Ht(e,t){if(!i("name"))return t||c("Name expected"),null;var n=Ut(e);return Gt(n),a(),n}function Xt(e){for(var t=e.start,n=t.comments_before,i=S(t,"comments_before_length")?t.comments_before_length:n.length;--i>=0;){var r=n[i];if(/[@#]__PURE__/.test(r.value)){e.pure=r;break}}}var zt=function(e,t){var r,o=e.start;if(i("punc","."))return a(),zt(new we({start:o,expression:e,property:(r=n.token,"name"!=r.type&&f(),a(),r.value),end:u()}),t);if(i("punc","[")){a();var s=tn(!0);return d("]"),zt(new xe({start:o,expression:e,property:s,end:u()}),t)}if(t&&i("punc","(")){a();var c=new Fe({start:o,expression:e,args:Wt(),end:u()});return Xt(c),zt(c,!0)}return i("template_head")?zt(new ne({start:o,prefix:e,template_string:vt(),end:u()}),t):e},Wt=A(function(){for(var e=[];!i("punc",")");)i("expand","...")?(a(),e.push(new $({start:u(),expression:tn(!1),end:u()}))):e.push(tn(!1)),i("punc",")")||(d(","),i("punc",")")&&t.ecma<8&&f());return a(),e}),Yt=function(e,t){var r=n.token;if("name"==r.type&&"await"==r.value){if(h())return a(),h()||c("Unexpected await expression outside async function",n.prev.line,n.prev.col,n.prev.pos),new xt({start:u(),end:n.token,expression:Yt(!0)});n.input.has_directive("use strict")&&l(n.token,"Unexpected await identifier inside strict mode")}if(i("operator")&&_n(r.value)){a(),T();var o=qt(Ie,r,Yt(e));return o.start=r,o.end=u(),o}for(var s=tt(e,t);i("operator")&&mn(n.token.value)&&!_(n.token);)s instanceof J&&f(),(s=qt(Le,n.token,s)).start=r,s.end=n.token,a();return s};function qt(e,t,i){var r=t.value;switch(r){case"++":case"--":Qt(i)||c("Invalid use of "+r+" operator",t.line,t.col,t.pos);break;case"delete":i instanceof _t&&n.input.has_directive("use strict")&&c("Calling delete on expression not allowed in strict mode",i.start.line,i.start.col,i.start.pos)}return new e({operator:r,expression:i})}var $t=function(e,t,r){var o=i("operator")?n.token.value:null;"in"==o&&r&&(o=null),"**"==o&&e instanceof Ie&&!fn(e.start,"punc","(")&&"--"!==e.operator&&"++"!==e.operator&&f(e.start);var s=null!=o?hn[o]:null;if(null!=s&&(s>t||"**"===o&&t===s)){a();var u=$t(Yt(!0),s,r);return $t(new Ve({start:e.start,left:e,operator:o,right:u,end:u.end}),t,r)}return e};var Zt=function(e){var t=n.token,r=function(e){return $t(Yt(!0,!0),0,e)}(e);if(i("operator","?")){a();var o=tn(!1);return d(":"),new Pe({start:t,condition:r,consequent:o,alternative:tn(!1,e),end:u()})}return r};function Qt(e){return e instanceof Ne||e instanceof _t}function Jt(e){if(e instanceof Ge)e=new te({start:e.start,names:e.properties.map(Jt),is_array:!1,end:e.end});else if(e instanceof Ue){for(var t=[],n=0;n=0;){var a=n[o];if(r==(a.mangled_name||a.unmangleable(t)&&a.name))continue e}return r}}}An.prototype={unmangleable:function(e){return e||(e={}),this.global&&!e.toplevel||this.export&Sn||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof st||this.orig[0]instanceof ot)&&b(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof at||(this.orig[0]instanceof ct||this.orig[0]instanceof ut)&&b(e.keep_classnames,this.orig[0].name)},mangle:function(e){var t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name))this.mangled_name=t.get(this.name);else if(!this.mangled_name&&!this.unmangleable(e)){var n,i=this.scope,r=this.orig[0];e.ie8&&r instanceof st&&(i=i.parent_scope),(n=this.redefined())?this.mangled_name=n.mangled_name||n.name:this.mangled_name=i.next_mangled(e,this),this.global&&t&&t.set(this.name,this.mangled_name)}},redefined:function(){return this.defun&&this.defun.variables.get(this.name)}},q.DEFMETHOD("figure_out_scope",function(e){e=s(e,{cache:null,ie8:!1,safari10:!1});var t=this,n=t.parent_scope=null,i=new A,r=null,o=null,a=[],u=new It(function(t,s){if(t.is_block_scope()){var c=n;return t.block_scope=n=new Y(t),n.init_scope_vars(c),t instanceof Y||(n.uses_with=c.uses_with,n.uses_eval=c.uses_eval,n.directives=c.directives),e.safari10&&(t instanceof H||t instanceof X)&&a.push(n),s(),n=c,!0}if(t instanceof te)return o=t,s(),o=null,!0;if(t instanceof Y){t.init_scope_vars(n);c=n;var l=r,f=i;return r=n=t,i=new A,s(),n=c,r=l,i=f,!0}if(t instanceof P){var p=t.label;if(i.has(p.name))throw new Error(E("Label {name} defined twice",p));return i.set(p.name,p),s(),i.del(p.name),!0}if(t instanceof W)for(var d=n;d;d=d.parent_scope)d.uses_with=!0;else{if(t instanceof Ze&&(t.scope=n),t instanceof dt&&(t.thedef=t,t.references=[]),t instanceof st)r.def_function(t,"arguments"==t.name?void 0:r);else if(t instanceof ot)h((t.scope=r.parent_scope.get_defun_scope()).def_function(t,r),1);else if(t instanceof ct)h(r.def_variable(t,r),1);else if(t instanceof ft)n.def_variable(t);else if(t instanceof ut)h((t.scope=r.parent_scope).def_function(t,r),1);else if(t instanceof et||t instanceof it||t instanceof nt){if(v((_=t instanceof tt?n.def_variable(t,null):r.def_variable(t,"SymbolVar"==t.TYPE?null:void 0)).orig,function(e){return e===t||(t instanceof tt?e instanceof st:!(e instanceof it||e instanceof nt))})||ln(t.name+" redeclared",t.start.file,t.start.line,t.start.col,t.start.pos),t instanceof rt||h(_,2),_.destructuring=o,r!==n){t.mark_enclosed(e);var _=n.find_variable(t);t.thedef!==_&&(t.thedef=_,t.reference(e))}}else if(t instanceof lt)n.def_variable(t).defun=r;else if(t instanceof ht){var m=i.get(t.name);if(!m)throw new Error(E("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=m}n instanceof q||!(t instanceof Ce||t instanceof ye)||ln(t.TYPE+" statement may only appear at top level",t.start.file,t.start.line,t.start.col,t.start.pos)}function h(e,t){if(o){var n=0;do{t++}while(u.parent(n++)!==o)}var i=u.parent(t);if(e.export=i instanceof Ce&&Sn){var r=i.exported_definition;(r instanceof ee||r instanceof $e)&&i.is_default&&(e.export=Tn)}}});t.walk(u),t.globals=new A;u=new It(function(n,i){if(n instanceof ce&&n.label)return n.label.thedef.references.push(n),!0;if(n instanceof _t){var r,o=n.name;if("eval"==o&&u.parent()instanceof Fe)for(var a=n.scope;a&&!a.uses_eval;a=a.parent_scope)a.uses_eval=!0;return u.parent()instanceof be&&u.parent(1).module_name||!(r=n.scope.find_variable(o))?(r=t.def_global(n),n instanceof mt&&(r.export=Sn)):r.scope instanceof j&&"arguments"==o&&(r.scope.uses_arguments=!0),n.thedef=r,n.reference(e),!n.scope.is_block_scope()||r.orig[0]instanceof tt||(n.scope=n.scope.get_defun_scope()),!0}var s;if(n instanceof lt&&(s=n.definition().redefined()))for(a=n.scope;a&&(m(a.enclosed,s),a!==s.scope);)a=a.parent_scope});if(t.walk(u),(e.ie8||e.safari10)&&t.walk(new It(function(n,i){if(n instanceof lt){var r=n.name,o=n.thedef.references,a=n.thedef.defun,s=a.find_variable(r)||t.globals.get(r)||a.def_variable(n);return o.forEach(function(t){t.thedef=s,t.reference(e)}),n.thedef=s,n.reference(e),!0}})),e.safari10)for(var c=0;c0);return n}return a.consider=function(e,n){for(var i=e.length;--i>=0;)t[e[i]]+=n},a.sort=function(){e=D(n,o).concat(D(i,o))},a.reset=r,r(),a}(),Cn=/^$|[;{][\s\n]*$/;function On(e){return"comment2"==e.type&&/@preserve|@license|@cc_on/i.test(e.value)}function Fn(e){var t=!e;void 0===(e=s(e,{ascii_only:!1,beautify:!1,braces:!1,comments:!1,ecma:5,ie8:!1,indent_level:4,indent_start:0,inline_script:!0,keep_quoted_props:!1,max_line_len:!1,preamble:null,quote_keys:!1,quote_style:0,safari10:!1,semicolons:!0,shebang:!0,shorthand:void 0,source_map:null,webkit:!1,width:80,wrap_iife:!1},!0)).shorthand&&(e.shorthand=e.ecma>5);var n=l;if(e.comments){var i=e.comments;if("string"==typeof e.comments&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var r=e.comments.lastIndexOf("/");i=new RegExp(e.comments.substr(1,r-1),e.comments.substr(r+1))}n=i instanceof RegExp?function(e){return"comment5"!=e.type&&i.test(e.value)}:"function"==typeof i?function(e){return"comment5"!=e.type&&i(this,e)}:"some"===i?On:f}var o=0,a=0,u=1,p=0,d="",_=e.ascii_only?function(t,n){return e.ecma>=6&&(t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,function(e){var t,n;return"\\u{"+(t=e,n=0,tn(t.charAt(n))?65536+(t.charCodeAt(n)-55296<<10)+t.charCodeAt(n+1)-56320:t.charCodeAt(n)).toString(16)+"}"})),t.replace(/[\u0000-\u001f\u007f-\uffff]/g,function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){for(;t.length<2;)t="0"+t;return"\\x"+t}for(;t.length<4;)t="0"+t;return"\\u"+t})}:function(e){for(var t="",n=0,i=e.length;nr?o():a()}}(t,n);return e.inline_script&&(i=(i=(i=i.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2")).replace(/\x3c!--/g,"\\x3c!--")).replace(/--\x3e/g,"--\\x3e")),i}function E(t){return function e(t,n){if(n<=0)return"";if(1==n)return t;var i=e(t,n>>1);return i+=i,1&n&&(i+=t),i}(" ",e.indent_start+o-t*e.indent_level)}var h,D,A=!1,S=!1,T=!1,b=0,y=!1,C=!1,R=-1,M="",N=e.source_map&&[],w=N?function(){N.forEach(function(t){try{e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,t.name||"name"!=t.token.type?t.name:t.token.value)}catch(e){null!=t.token.file&&O.warn("Couldn't figure out mapping for {file}:{line},{col} \u2192 {cline},{ccol} [{name}]",{file:t.token.file,line:t.token.line,col:t.token.col,cline:t.line,ccol:t.col,name:t.name||""})}}),N=[]}:c,x=e.max_line_len?function(){if(a>e.max_line_len){if(b){var t=d.slice(0,b),n=d.slice(b);if(N){var i=n.length-a;N.forEach(function(e){e.line++,e.col+=i})}d=t+"\n"+n,u++,p++,a=n.length}a>e.max_line_len&&O.warn("Output exceeds {max_line_len} characters",e)}b&&(b=0,w())}:c,k=g("( [ + * / - , . `");function I(t){var n=en(t=String(t),0),i=en(M,M.length-1);y&&n&&(y=!1,"\n"!=n&&(I("\n"),V())),C&&n&&(C=!1,/[\s;})]/.test(n)||L()),R=-1;i=M.charAt(M.length-1);T&&(T=!1,(":"==i&&"}"==n||(!n||";}".indexOf(n)<0)&&";"!=i)&&(e.semicolons||k(n)?(d+=";",a++,p++):(x(),d+="\n",p++,u++,a=0,/^\s+$/.test(t)&&(T=!0)),e.beautify||(S=!1))),S&&((sn(i)&&(sn(n)||"\\"==n)||"/"==n&&n==i||("+"==n||"-"==n)&&n==M)&&(d+=" ",a++,p++),S=!1),h&&(N.push({token:h,name:D,line:u,col:a}),h=!1,b||w()),d+=t,A="("==t[t.length-1],p+=t.length;var r=t.split(/\r?\n/),o=r.length-1;u+=o,a+=r[0].length,o>0&&(x(),a=r[o].length),M=t}var L=e.beautify?function(){I(" ")}:function(){S=!0},V=e.beautify?function(t){e.beautify&&I(E(t?.5:0))}:c,P=e.beautify?function(e,t){!0===e&&(e=G());var n=o;o=e;var i=t();return o=n,i}:function(e,t){return t()},B=e.beautify?function(){if(R<0)return I("\n");"\n"!=d[R]&&(d=d.slice(0,R)+"\n"+d.slice(R),p++,u++),R++}:e.max_line_len?function(){x(),b=d.length}:c,K=e.beautify?function(){I(";")}:function(){T=!0};function U(){T=!1,I(";")}function G(){return o+e.indent_level}function H(){return b&&x(),d}function X(){var e=d.lastIndexOf("\n");return/^ *$/.test(d.slice(e+1))}var z=[];return{get:H,toString:H,indent:V,indentation:function(){return o},current_width:function(){return a-o},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return A},newline:B,print:I,star:function(){I("*")},space:L,comma:function(){I(","),L()},colon:function(){I(":"),L()},last:function(){return M},semicolon:K,force_semicolon:U,to_utf8:_,print_name:function(e){I(function(e){return e=e.toString(),e=_(e,!0)}(e))},print_string:function(e,t,n){var i=m(e,t);!0===n&&-1===i.indexOf("\\")&&(Cn.test(d)||U(),U()),I(i)},print_template_string_chars:function(e){var t=m(e,"`").replace(/\${/g,"\\${");return I(t.substr(1,t.length-2))},encode_string:m,next_indent:G,with_indent:P,with_block:function(e){var t;return I("{"),B(),P(G(),function(){t=e()}),V(),I("}"),t},with_parens:function(e){I("(");var t=e();return I(")"),t},with_square:function(e){I("[");var t=e();return I("]"),t},add_mapping:N?function(e,t){h=e,D=t}:c,option:function(t){return e[t]},prepend_comments:t?c:function(t){var i=this,r=t.start;if(r&&(!r.comments_before||r.comments_before._dumped!==i)){var o=r.comments_before;if(o||(o=r.comments_before=[]),o._dumped=i,t instanceof ae&&t.value){var a=new It(function(e){var t=a.parent();if(!(t instanceof ae||t instanceof Ve&&t.left===e||"Call"==t.TYPE&&t.expression===e||t instanceof Pe&&t.condition===e||t instanceof we&&t.expression===e||t instanceof Me&&t.expressions[0]===e||t instanceof xe&&t.expression===e||t instanceof Le))return!0;if(e.start){var n=e.start.comments_before;n&&n._dumped!==i&&(n._dumped=i,o=o.concat(n))}});a.push(t),t.value.walk(a)}if(0==p){o.length>0&&e.shebang&&"comment5"==o[0].type&&(I("#!"+o.shift().value+"\n"),V());var s=e.preamble;s&&I(s.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"))}if(0!=(o=o.filter(n,t)).length){var u=X();o.forEach(function(e,t){u||(e.nlb?(I("\n"),V(),u=!0):t>0&&L()),/comment[134]/.test(e.type)?(I("//"+e.value.replace(/[@#]__PURE__/g," ")+"\n"),V(),u=!0):"comment2"==e.type&&(I("/*"+e.value.replace(/[@#]__PURE__/g," ")+"*/"),u=!1)}),u||(r.nlb?(I("\n"),V()):L())}}},append_comments:t||n===l?c:function(e,t){var i=e.end;if(i){var r=i[t?"comments_before":"comments_after"];if(r&&r._dumped!==this&&(e instanceof F||v(r,function(e){return!/comment[134]/.test(e.type)}))){r._dumped=this;var o=d.length;r.filter(n,e).forEach(function(e,n){C=!1,y?(I("\n"),V(),y=!1):e.nlb&&(n>0||!X())?(I("\n"),V()):(n>0||!t)&&L(),/comment[134]/.test(e.type)?(I("//"+e.value.replace(/[@#]__PURE__/g," ")),y=!0):"comment2"==e.type&&(I("/*"+e.value.replace(/[@#]__PURE__/g," ")+"*/"),C=!0)}),d.length>o&&(R=o)}}},line:function(){return u},col:function(){return a},pos:function(){return p},push_node:function(e){z.push(e)},pop_node:function(){return z.pop()},parent:function(e){return z[z.length-2-(e||0)]}}}function Rn(e,t){if(!(this instanceof Rn))return new Rn(e,t);vn.call(this,this.before,this.after),void 0===e.defaults||e.defaults||(t=!0),this.options=s(e,{arguments:!1,arrows:!t,booleans:!t,booleans_as_integers:!1,collapse_vars:!t,comparisons:!t,computed_props:!t,conditionals:!t,dead_code:!t,defaults:!0,directives:!t,drop_console:!1,drop_debugger:!t,ecma:5,evaluate:!t,expression:!1,global_defs:!1,hoist_funs:!1,hoist_props:!t,hoist_vars:!1,ie8:!1,if_return:!t,inline:!t,join_vars:!t,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1,loops:!t,module:!1,negate_iife:!t,passes:1,properties:!t,pure_getters:!t&&"strict",pure_funcs:null,reduce_funcs:!t,reduce_vars:!t,sequences:!t,side_effects:!t,switches:!t,top_retain:null,toplevel:!(!e||!e.top_retain),typeofs:!t,unsafe:!1,unsafe_arrows:!1,unsafe_comps:!1,unsafe_Function:!1,unsafe_math:!1,unsafe_methods:!1,unsafe_proto:!1,unsafe_regexp:!1,unsafe_undefined:!1,unused:!t,warnings:!1},!0);var n=this.options.global_defs;if("object"==typeof n)for(var i in n)/^@/.test(i)&&S(n,i)&&(n[i.slice(1)]=gn(n[i],{expression:!0}));!0===this.options.inline&&(this.options.inline=3);var r=this.options.pure_funcs;this.pure_funcs="function"==typeof r?r:r?function(e){return r.indexOf(e.expression.print_to_string())<0}:f;var o=this.options.top_retain;o instanceof RegExp?this.top_retain=function(e){return o.test(e.name)}:"function"==typeof o?this.top_retain=o:o&&("string"==typeof o&&(o=o.split(/,/)),this.top_retain=function(e){return o.indexOf(e.name)>=0}),this.options.module&&(this.directives["use strict"]=!0,this.options.toplevel=!0);var a=this.options.toplevel;this.toplevel="string"==typeof a?{funcs:/funcs/.test(a),vars:/vars/.test(a)}:{funcs:a,vars:a};var u=this.options.sequences;this.sequences_limit=1==u?800:0|u,this.warnings_produced={}}function Mn(e,t){function n(e){m(t,e)}e.walk(new It(function(e){e instanceof Xe&&e.quote?n(e.key):e instanceof He&&e.quote?n(e.key.name):e instanceof xe&&Nn(e.property,n)}))}function Nn(e,t){e.walk(new It(function(e){return e instanceof Me?Nn(e.tail_node(),t):e instanceof At?t(e.value):e instanceof Pe&&(Nn(e.consequent,t),Nn(e.alternative,t)),!0}))}function wn(e,n){var i=(n=s(n,{builtins:!1,cache:null,debug:!1,keep_quoted:!1,only_cache:!1,regex:null,reserved:null},!0)).reserved;Array.isArray(i)||(i=[i]),n.builtins||function(e){e.push.apply(e,t);var n={},i="object"==typeof global?global:self;function r(t){m(e,t)}["Symbol","Map","Promise","Proxy","Reflect","Set","WeakMap","WeakSet"].forEach(function(e){n[e]=i[e]||new Function}),["null","true","false","Infinity","-Infinity","undefined"].forEach(r),[Object,Array,Function,Number,String,Boolean,Error,Math,Date,RegExp,n.Symbol,ArrayBuffer,DataView,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,eval,EvalError,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,isFinite,isNaN,JSON,n.Map,parseFloat,parseInt,n.Promise,n.Proxy,RangeError,ReferenceError,n.Reflect,n.Set,SyntaxError,TypeError,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,URIError,n.WeakMap,n.WeakSet].forEach(function(e){Object.getOwnPropertyNames(e).map(r),e.prototype&&Object.getOwnPropertyNames(e.prototype).map(r)})}(i);var r,o=-1;n.cache?(r=n.cache.props).each(function(e){m(i,e)}):r=new A;var a,u=n.regex,c=!1!==n.debug;c&&(a=!0===n.debug?"":n.debug);var l=[],f=[];return e.walk(new It(function(e){if(e instanceof Xe)"string"==typeof e.key&&_(e.key);else if(e instanceof He)_(e.key.name);else if(e instanceof we){for(var t=e;t.expression;)t=t.expression;t.thedef&&t.thedef.undeclared||_(e.property)}else e instanceof xe?Nn(e.property,_):e instanceof Fe&&"Object.defineProperty"==e.expression.print_to_string()&&Nn(e.args[1],_)})),e.transform(new vn(function(e){e instanceof Xe?"string"==typeof e.key&&(e.key=E(e.key)):e instanceof He?e.key.name=E(e.key.name):e instanceof we?e.property=E(e.property):!n.keep_quoted&&e instanceof xe?e.property=h(e.property):e instanceof Fe&&"Object.defineProperty"==e.expression.print_to_string()&&(e.args[1]=h(e.args[1]))}));function p(e){return!(f.indexOf(e)>=0)&&(!(i.indexOf(e)>=0)&&(n.only_cache?r.has(e):!/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(e)))}function d(e){return!(u&&!u.test(e))&&(!(i.indexOf(e)>=0)&&(r.has(e)||l.indexOf(e)>=0))}function _(e){p(e)&&m(l,e),d(e)||m(f,e)}function E(e){if(!d(e))return e;var t=r.get(e);if(!t){if(c){var n="_$"+e+"$"+a+"_";p(n)&&(t=n)}if(!t)do{t=yn(++o)}while(!p(t));r.set(e,t)}return t}function h(e){return e.transform(new vn(function(e){if(e instanceof Me){var t=e.expressions.length-1;e.expressions[t]=h(e.expressions[t])}else e instanceof At?e.value=E(e.value):e instanceof Pe&&(e.consequent=h(e.consequent),e.alternative=h(e.alternative));return e}))}}!function(){function e(e,t){e.DEFMETHOD("_codegen",t)}var t=!1,n=null,i=null;function r(e,t){Array.isArray(e)?e.forEach(function(e){r(e,t)}):e.DEFMETHOD("needs_parens",t)}function o(e,n,i,r){var o=e.length-1;t=r,e.forEach(function(e,r){!0!==t||e instanceof M||e instanceof L||e instanceof N&&e.body instanceof At||(t=!1),e instanceof L||(i.indent(),e.print(i),r==o&&n||(i.newline(),n&&i.newline())),!0===t&&e instanceof N&&e.body instanceof At&&(t=!1)}),t=!1}function a(e,t){t.print("{"),t.with_indent(t.next_indent(),function(){t.append_comments(e,!0)}),t.print("}")}function s(e,t,n){e.body.length>0?t.with_block(function(){o(e.body,!1,t,n)}):a(e,t)}function u(e,t,n){var i=!1;n&&e.walk(new It(function(e){return!!(i||e instanceof Y)||(e instanceof Ve&&"in"==e.operator?(i=!0,!0):void 0)})),e.print(t,i)}function f(e,t,n){n.option("quote_keys")?n.print_string(e):""+ +e==e&&e>=0?n.print(_(e)):(Pt(e)?!n.option("ie8"):un(e))?t&&n.option("keep_quoted_props")?n.print_string(e,t):n.print_name(e):n.print_string(e,t)}function p(e,t){t.option("braces")?m(e,t):!e||e instanceof L?t.force_semicolon():e.print(t)}function d(e,t){return e.args.length>0||t.option("beautify")}function _(e){var t,n=e.toString(10),i=[n.replace(/^0\./,".").replace("e+","e")];return Math.floor(e)===e?(e>=0?i.push("0x"+e.toString(16).toLowerCase(),"0"+e.toString(8)):i.push("-0x"+(-e).toString(16).toLowerCase(),"-0"+(-e).toString(8)),(t=/^(.*?)(0+)$/.exec(e))&&i.push(t[1]+"e"+t[2].length)):(t=/^0?\.(0+)(.*)$/.exec(e))&&i.push(t[2]+"e-"+(t[1].length+t[2].length),n.substr(n.indexOf("."))),function(e){for(var t=e[0],n=t.length,i=1;io||i==o&&(this===t.right||"**"==n))return!0}}),r(kt,function(e){var t=e.parent();return t instanceof Ve&&"="!==t.operator||(t instanceof Fe&&t.expression===this||(t instanceof Pe&&t.condition===this||(t instanceof ke||(t instanceof Ne&&t.expression===this||void 0))))}),r(Ne,function(e){var t=e.parent();if(t instanceof Re&&t.expression===this){var n=!1;return this.walk(new It(function(e){return!!(n||e instanceof Y)||(e instanceof Fe?(n=!0,!0):void 0)})),n}}),r(Fe,function(e){var t,n=e.parent();return!!(n instanceof Re&&n.expression===this||n instanceof Ce&&n.is_default&&this.expression instanceof Q)||this.expression instanceof Q&&n instanceof Ne&&n.expression===this&&(t=e.parent(1))instanceof Be&&t.left===n}),r(Re,function(e){var t=e.parent();if(!d(this,e)&&(t instanceof Ne||t instanceof Fe&&t.expression===this))return!0}),r(St,function(e){var t=e.parent();if(t instanceof Ne&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(_(n)))return!0}}),r([Be,Pe],function(e){var t=e.parent();return t instanceof ke||(t instanceof Ve&&!(t instanceof Be)||(t instanceof Fe&&t.expression===this||(t instanceof Pe&&t.condition===this||(t instanceof Ne&&t.expression===this||(this instanceof Be&&this.left instanceof te&&!1===this.left.is_array||void 0)))))}),e(M,function(e,t){t.print_string(e.value,e.quote),t.semicolon()}),e($,function(e,t){t.print("..."),e.expression.print(t)}),e(te,function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach(function(e,i){i>0&&t.comma(),e.print(t),i==n-1&&e instanceof Ft&&t.comma()}),t.print(e.is_array?"]":"}")}),e(R,function(e,t){t.print("debugger"),t.semicolon()}),V.DEFMETHOD("_do_print_body",function(e){p(this.body,e)}),e(F,function(e,t){e.body.print(t),t.semicolon()}),e(q,function(e,t){o(e.body,!0,t,!0),t.print("")}),e(P,function(e,t){e.label.print(t),t.colon(),e.body.print(t)}),e(N,function(e,t){e.body.print(t),t.semicolon()}),e(I,function(e,t){s(e,t)}),e(L,function(e,t){t.semicolon()}),e(U,function(e,t){t.print("do"),t.space(),m(e.body,t),t.space(),t.print("while"),t.space(),t.with_parens(function(){e.condition.print(t)}),t.semicolon()}),e(G,function(e,t){t.print("while"),t.space(),t.with_parens(function(){e.condition.print(t)}),t.space(),e._do_print_body(t)}),e(H,function(e,t){t.print("for"),t.space(),t.with_parens(function(){e.init?(e.init instanceof ve?e.init.print(t):u(e.init,t,!0),t.print(";"),t.space()):t.print(";"),e.condition?(e.condition.print(t),t.print(";"),t.space()):t.print(";"),e.step&&e.step.print(t)}),t.space(),e._do_print_body(t)}),e(X,function(e,t){t.print("for"),e.await&&(t.space(),t.print("await")),t.space(),t.with_parens(function(){e.init.print(t),t.space(),t.print(e instanceof z?"of":"in"),t.space(),e.object.print(t)}),t.space(),e._do_print_body(t)}),e(W,function(e,t){t.print("with"),t.space(),t.with_parens(function(){e.expression.print(t)}),t.space(),e._do_print_body(t)}),j.DEFMETHOD("_do_print",function(e,t){var n=this;t||(n.async&&(e.print("async"),e.space()),e.print("function"),n.is_generator&&e.star(),n.name&&e.space()),n.name instanceof Ze?n.name.print(e):t&&n.name instanceof O&&e.with_square(function(){n.name.print(e)}),e.with_parens(function(){n.argnames.forEach(function(t,n){n&&e.comma(),t.print(e)})}),e.space(),s(n,e,!0)}),e(j,function(e,t){e._do_print(t)}),e(ne,function(e,t){var n=e.prefix,i=n instanceof J||n instanceof Ve||n instanceof Pe||n instanceof Me||n instanceof ke;i&&t.print("("),e.prefix.print(t),i&&t.print(")"),e.template_string.print(t)}),e(ie,function(e,t){var n=t.parent()instanceof ne;t.print("`");for(var i=0;i"),e.space(),t.body instanceof O?t.body.print(e):s(t,e),i&&e.print(")")}),ae.DEFMETHOD("_do_print",function(e,t){e.print(t),this.value&&(e.space(),this.value.print(e)),e.semicolon()}),e(se,function(e,t){e._do_print(t,"return")}),e(ue,function(e,t){e._do_print(t,"throw")}),e(kt,function(e,t){var n=e.is_star?"*":"";t.print("yield"+n),e.expression&&(t.space(),e.expression.print(t))}),e(xt,function(e,t){t.print("await"),t.space();var n=e.expression,i=!(n instanceof Fe||n instanceof _t||n instanceof Ne||n instanceof ke||n instanceof vt);i&&t.print("("),e.expression.print(t),i&&t.print(")")}),ce.DEFMETHOD("_do_print",function(e,t){e.print(t),this.label&&(e.space(),this.label.print(e)),e.semicolon()}),e(le,function(e,t){e._do_print(t,"break")}),e(fe,function(e,t){e._do_print(t,"continue")}),e(pe,function(e,t){t.print("if"),t.space(),t.with_parens(function(){e.condition.print(t)}),t.space(),e.alternative?(!function(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof U)return m(n,t);if(!n)return t.force_semicolon();for(;;)if(n instanceof pe){if(!n.alternative)return void m(e.body,t);n=n.alternative}else{if(!(n instanceof V))break;n=n.body}p(e.body,t)}(e,t),t.space(),t.print("else"),t.space(),e.alternative instanceof pe?e.alternative.print(t):p(e.alternative,t)):e._do_print_body(t)}),e(de,function(e,t){t.print("switch"),t.space(),t.with_parens(function(){e.expression.print(t)}),t.space();var n=e.body.length-1;n<0?a(e,t):t.with_block(function(){e.body.forEach(function(e,i){t.indent(!0),e.print(t),i0&&t.newline()})})}),_e.DEFMETHOD("_do_print_body",function(e){e.newline(),this.body.forEach(function(t){e.indent(),t.print(e),e.newline()})}),e(me,function(e,t){t.print("default:"),e._do_print_body(t)}),e(Ee,function(e,t){t.print("case"),t.space(),e.expression.print(t),t.print(":"),e._do_print_body(t)}),e(he,function(e,t){t.print("try"),t.space(),s(e,t),e.bcatch&&(t.space(),e.bcatch.print(t)),e.bfinally&&(t.space(),e.bfinally.print(t))}),e(De,function(e,t){t.print("catch"),e.argname&&(t.space(),t.with_parens(function(){e.argname.print(t)})),t.space(),s(e,t)}),e(ge,function(e,t){t.print("finally"),t.space(),s(e,t)}),ve.DEFMETHOD("_do_print",function(e,t){e.print(t),e.space(),this.definitions.forEach(function(t,n){n&&e.comma(),t.print(e)});var n=e.parent();(!(n instanceof H||n instanceof X)||n&&n.init!==this)&&e.semicolon()}),e(Se,function(e,t){e._do_print(t,"let")}),e(Ae,function(e,t){e._do_print(t,"var")}),e(Te,function(e,t){e._do_print(t,"const")}),e(ye,function(e,t){t.print("import"),t.space(),e.imported_name&&e.imported_name.print(t),e.imported_name&&e.imported_names&&(t.print(","),t.space()),e.imported_names&&(1===e.imported_names.length&&"*"===e.imported_names[0].foreign_name.name?e.imported_names[0].print(t):(t.print("{"),e.imported_names.forEach(function(n,i){t.space(),n.print(t),i0&&(e.comma(),e.should_break()&&(e.newline(),e.indent())),t.print(e)})}),e(Me,function(e,t){e._do_print(t)}),e(we,function(e,t){var n=e.expression;n.print(t);var i=e.property;t.option("ie8")&&Pt(i)?(t.print("["),t.add_mapping(e.end),t.print_string(i),t.print("]")):(n instanceof St&&n.getValue()>=0&&(/[xa-f.)]/i.test(t.last())||t.print(".")),t.print("."),t.add_mapping(e.end),t.print_name(i))}),e(xe,function(e,t){e.expression.print(t),t.print("["),e.property.print(t),t.print("]")}),e(Ie,function(e,t){var n=e.operator;t.print(n),(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof Ie&&/^[+-]/.test(e.expression.operator))&&t.space(),e.expression.print(t)}),e(Le,function(e,t){e.expression.print(t),t.print(e.operator)}),e(Ve,function(e,t){var n=e.operator;e.left.print(t),">"==n[0]&&e.left instanceof Le&&"--"==e.left.operator?t.print(" "):t.space(),t.print(n),("<"==n||"<<"==n)&&e.right instanceof Ie&&"!"==e.right.operator&&e.right.expression instanceof Ie&&"--"==e.right.expression.operator?t.print(" "):t.space(),e.right.print(t)}),e(Pe,function(e,t){e.condition.print(t),t.space(),t.print("?"),t.space(),e.consequent.print(t),t.space(),t.colon(),e.alternative.print(t)}),e(Ue,function(e,t){t.with_square(function(){var n=e.elements,i=n.length;i>0&&t.space(),n.forEach(function(e,n){n&&t.comma(),e.print(t),n===i-1&&e instanceof Ft&&t.comma()}),i>0&&t.space()})}),e(Ge,function(e,t){e.properties.length>0?t.with_block(function(){e.properties.forEach(function(e,n){n&&(t.print(","),t.newline()),t.indent(),e.print(t)}),t.newline()}):a(e,t)}),e(qe,function(e,t){if(t.print("class"),t.space(),e.name&&(e.name.print(t),t.space()),e.extends){var n=!(e.extends instanceof _t||e.extends instanceof Ne||e.extends instanceof je||e.extends instanceof Q);t.print("extends"),n?t.print("("):t.space(),e.extends.print(t),n?t.print(")"):t.space()}e.properties.length>0?t.with_block(function(){e.properties.forEach(function(e,n){n&&t.newline(),t.indent(),e.print(t)}),t.newline()}):t.print("{}")}),e(Qe,function(e,t){t.print("new.target")}),e(Xe,function(e,t){function n(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}var i=t.option("shorthand");i&&e.value instanceof Ze&&un(e.key)&&n(e.value)===e.key&&on(e.key)?f(e.key,e.quote,t):i&&e.value instanceof Ke&&e.value.left instanceof Ze&&un(e.key)&&n(e.value.left)===e.key?(f(e.key,e.quote,t),t.space(),t.print("="),t.space(),e.value.right.print(t)):(e.key instanceof O?t.with_square(function(){e.key.print(t)}):f(e.key,e.quote,t),t.colon(),e.value.print(t))}),He.DEFMETHOD("_print_getter_setter",function(e,t){var n=this;n.static&&(t.print("static"),t.space()),e&&(t.print(e),t.space()),n.key instanceof at?f(n.key.name,n.quote,t):t.with_square(function(){n.key.print(t)}),n.value._do_print(t,!0)}),e(ze,function(e,t){e._print_getter_setter("set",t)}),e(We,function(e,t){e._print_getter_setter("get",t)}),e(Ye,function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,t)}),Ze.DEFMETHOD("_do_print",function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name)}),e(Ze,function(e,t){e._do_print(t)}),e(Ft,c),e(Dt,function(e,t){t.print("this")}),e(gt,function(e,t){t.print("super")}),e(vt,function(e,t){t.print(e.getValue())}),e(At,function(e,n){n.print_string(e.getValue(),e.quote,t)}),e(St,function(e,t){i&&e.start&&null!=e.start.raw?t.print(e.start.raw):t.print(_(e.getValue()))}),e(Tt,function(e,t){var n=e.getValue().toString();n=t.to_utf8(n),t.print(n);var i=t.parent();i instanceof Ve&&/^in/.test(i.operator)&&i.left===e&&t.print(" ")}),E([O,P,q],c),E([Ue,I,De,qe,vt,R,ve,M,ge,oe,j,Re,Ge,V,Ze,de,_e,he],function(e){e.add_mapping(this.start)}),E([We,ze],function(e){e.add_mapping(this.start,this.key.name)}),E([He],function(e){e.add_mapping(this.start,this.key)})}(),Rn.prototype=new vn,u(Rn.prototype,{option:function(e){return this.options[e]},exposed:function(e){if(e.export)return!0;if(e.global)for(var t=0,n=e.orig.length;t0||this.option("reduce_vars"))&&e.reset_opt_flags(this),e=e.transform(this),t>1){var a=0;if(e.walk(new It(function(){a++})),this.info("pass "+o+": last_count: "+n+", count: "+a),a=0;){if(!(r[o]instanceof Xe))return;n||r[o].key!==t||(n=r[o].value)}}return n instanceof _t&&n.fixed_value()||n}}function n(e,i,r,o,a,s){var u=i.parent(a),c=Pt(r,u);if(c)return c;if(!s&&u instanceof Fe&&u.expression===r&&!(o instanceof J)&&!(o instanceof qe)&&!u.is_expr_pure(e)&&(!(o instanceof Q)||!(u instanceof Re)&&o.contains_this()))return!0;if(u instanceof Ue)return n(e,i,u,u,a+1);if(u instanceof Xe&&r===u.value){var l=i.parent(a+1);return n(e,i,l,l,a+2)}if(u instanceof Ne&&u.expression===r){var f=t(o,u.property);return!s&&n(e,i,u,f,a+1)}}function o(e){return e instanceof J||e instanceof Q}function a(e){if(e instanceof Dt)return!0;if(e instanceof _t)return e.definition().orig[0]instanceof st;if(e instanceof Ne){if((e=e.expression)instanceof _t){if(e.is_immutable())return!1;e=e.fixed_value()}return!e||!(e instanceof Tt)&&(e instanceof vt||a(e))}return!1}function s(e,t){if(!(e instanceof _t))return!1;for(var n=e.definition().orig,i=n.length;--i>=0;)if(n[i]instanceof t)return!0}function u(e,t){for(var n,i=0;(n=e.parent(i++))&&!(n instanceof Y);)if(n instanceof De&&n.argname){n=n.argname.definition().scope;break}return n.find_variable(t)}function m(e,t,n){return n||(n={}),t&&(n.start||(n.start=t.start),n.end||(n.end=t.end)),new e(n)}function D(e,t){return 1==t.length?t[0]:m(Me,e,{expressions:t.reduce(x,[])})}function y(e,t){switch(typeof e){case"string":return m(At,t,{value:e});case"number":return isNaN(e)?m(Ct,t):isFinite(e)?1/e<0?m(Ie,t,{operator:"-",expression:m(St,t,{value:-e})}):m(St,t,{value:e}):e<0?m(Ie,t,{operator:"-",expression:m(Rt,t)}):m(Rt,t);case"boolean":return m(e?wt:Nt,t);case"undefined":return m(Ot,t);default:if(null===e)return m(yt,t,{value:null});if(e instanceof RegExp)return m(Tt,t,{value:e});throw new Error(E("Can't handle constant of type: {type}",{type:typeof e}))}}function C(e,t,n){return e instanceof Ie&&"delete"==e.operator||e instanceof Fe&&e.expression===t&&(n instanceof Ne||n instanceof _t&&"eval"==n.name)?D(t,[m(St,t,{value:0}),n]):n}function x(e,t){return t instanceof Me?e.push.apply(e,t.expressions):e.push(t),e}function V(e){if(null===e)return[];if(e instanceof I)return e.body;if(e instanceof L)return[];if(e instanceof F)return[e];throw new Error("Can't convert thing to statement array")}function z(e){return null===e||(e instanceof L||e instanceof I&&0==e.body.length)}function ue(e){return!(e instanceof $e||e instanceof ee||e instanceof Se||e instanceof Te||e instanceof Ce||e instanceof ye)}function be(e){return e instanceof B&&e.body instanceof I?e.body:e}function ze(e){return"Call"==e.TYPE&&(e.expression instanceof Q||ze(e.expression))}function Qe(e){return e instanceof _t&&e.definition().undeclared}e(O,function(e,t){return e}),q.DEFMETHOD("drop_console",function(){return this.transform(new vn(function(e){if("Call"==e.TYPE){var t=e.expression;if(t instanceof Ne){for(var n=t.expression;n.expression;)n=n.expression;if(Qe(n)&&"console"==n.name)return m(Ot,e)}}}))}),O.DEFMETHOD("equivalent_to",function(e){return this.TYPE==e.TYPE&&this.print_to_string()==e.print_to_string()}),Y.DEFMETHOD("process_expression",function(e,t){var n=this,i=new vn(function(r){if(e&&r instanceof N)return m(se,r,{value:r.body});if(!e&&r instanceof se){if(t){var o=r.value&&r.value.drop_side_effect_free(t,!0);return o?m(N,r,{body:o}):m(L,r)}return m(N,r,{body:r.value||m(Ie,r,{operator:"void",expression:m(St,r,{value:0})})})}if(r instanceof qe||r instanceof j&&r!==n)return r;if(r instanceof k){var a=r.body.length-1;a>=0&&(r.body[a]=r.body[a].transform(i))}else r instanceof pe?(r.body=r.body.transform(i),r.alternative&&(r.alternative=r.alternative.transform(i))):r instanceof W&&(r.body=r.body.transform(i));return r});n.transform(i)}),function(e){function i(e,t){t.assignments=0,t.chained=!1,t.direct_access=!1,t.escaped=!1,t.scope.pinned()?t.fixed=!1:t.orig[0]instanceof nt||!e.exposed(t)?t.fixed=t.init:t.fixed=!1,t.recursive_refs=0,t.references=[],t.should_replace=void 0,t.single_use=void 0}function r(e,t,n){n.variables.each(function(n){i(t,n),null===n.fixed?(n.safe_ids=e.safe_ids,u(e,n,!0)):n.fixed&&(e.loop_ids[n.id]=e.in_loop,u(e,n,!0))})}function o(e,t){t.block_scope&&t.block_scope.variables.each(function(t){i(e,t)})}function a(e){e.safe_ids=Object.create(e.safe_ids)}function s(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids)}function u(e,t,n){e.safe_ids[t.id]=n}function l(e,t){if("m"==t.single_use)return!1;if(e.safe_ids[t.id]){if(null==t.fixed){var n=t.orig[0];if(n instanceof rt||"arguments"==n.name)return!1;t.fixed=m(Ot,n)}return!0}return t.fixed instanceof ee}function f(e,t,n){return void 0===t.fixed||(null===t.fixed&&t.safe_ids?(t.safe_ids[t.id]=!1,delete t.safe_ids,!0):!!S(e.safe_ids,t.id)&&(!!l(e,t)&&(!1!==t.fixed&&(!(null!=t.fixed&&(!n||t.references.length>t.assignments))&&v(t.orig,function(e){return!(e instanceof nt||e instanceof ot||e instanceof st)})))))}function p(e,n,i,r,o,a,s){var u=e.parent(a);if(o){if(o.is_constant())return;if(o instanceof je)return}if(u instanceof Be&&"="==u.operator&&r===u.right||u instanceof Fe&&(r!==u.expression||u instanceof Re)||u instanceof ae&&r===u.value&&r.scope!==n.scope||u instanceof Oe&&r===u.value||u instanceof kt&&r===u.value&&r.scope!==n.scope)return!(s>1)||o&&o.is_constant_expression(i)||(s=1),void((!n.escaped||n.escaped>s)&&(n.escaped=s));if(u instanceof Ue||u instanceof xt||u instanceof Ve&&Lt(u.operator)||u instanceof Pe&&r!==u.condition||u instanceof $||u instanceof Me&&r===u.tail_node())p(e,n,i,u,u,a+1,s);else if(u instanceof Xe&&r===u.value){var c=e.parent(a+1);p(e,n,i,c,c,a+2,s)}else if(u instanceof Ne&&r===u.expression&&(p(e,n,i,u,o=t(o,u.property),a+1,s+1),o))return;a>0||u instanceof Me&&r!==u.tail_node()||u instanceof N||(n.direct_access=!0)}e(O,c);var d=new It(function(e){if(e instanceof Ze){var t=e.definition();t&&(e instanceof _t&&t.references.push(e),t.fixed=!1)}});function _(e,t,n){this.inlined=!1;var i=e.safe_ids;return e.safe_ids=Object.create(null),r(e,n,this),t(),e.safe_ids=i,!0}function E(e,t,n){var i,o=this;return o.inlined=!1,a(e),r(e,n,o),!o.name&&(i=e.parent())instanceof Fe&&i.expression===o&&o.argnames.forEach(function(t,n){if(t.definition){var r=t.definition();void 0!==r.fixed||o.uses_arguments&&!e.has_directive("use strict")?r.fixed=!1:(r.fixed=function(){return i.args[n]||m(Ot,i)},e.loop_ids[r.id]=e.in_loop,u(e,r,!0))}}),t(),s(e),!0}e(Z,function(e,t,n){return a(e),r(e,n,this),t(),s(e),!0}),e(J,E),e(Be,function(e,t,i){var r=this;if(r.left instanceof te)r.left.walk(d);else{var o=r.left;if(o instanceof _t){var a=o.definition(),s=f(e,a,o.scope,r.right);if(a.assignments++,s){var c=a.fixed;if(c||"="==r.operator){var l="="==r.operator,_=l?r.right:r;if(!n(i,e,r,_,0))return a.references.push(o),l||(a.chained=!0),a.fixed=l?function(){return r.right}:function(){return m(Ve,r,{operator:r.operator.slice(0,-1),left:c instanceof O?c:c(),right:r.right})},u(e,a,!1),r.right.walk(e),u(e,a,!0),p(e,a,o.scope,r,_,0,1),!0}}}}}),e(Ve,function(e){if(Lt(this.operator))return this.left.walk(e),a(e),this.right.walk(e),s(e),!0}),e(k,function(e,t,n){o(n,this)}),e(Ee,function(e){return a(e),this.expression.walk(e),s(e),a(e),w(this,e),s(e),!0}),e(je,function(e,t){return this.inlined=!1,a(e),t(),s(e),!0}),e(Pe,function(e){return this.condition.walk(e),a(e),this.consequent.walk(e),s(e),a(e),this.alternative.walk(e),s(e),!0}),e(me,function(e,t){return a(e),t(),s(e),!0}),e($e,_),e(ee,_),e(U,function(e,t,n){o(n,this);var i=e.in_loop;return e.in_loop=this,a(e),this.body.walk(e),$t(this)&&(s(e),a(e)),this.condition.walk(e),s(e),e.in_loop=i,!0}),e(H,function(e,t,n){o(n,this),this.init&&this.init.walk(e);var i=e.in_loop;return e.in_loop=this,a(e),this.condition&&this.condition.walk(e),this.body.walk(e),this.step&&($t(this)&&(s(e),a(e)),this.step.walk(e)),s(e),e.in_loop=i,!0}),e(X,function(e,t,n){o(n,this),this.init.walk(d),this.object.walk(e);var i=e.in_loop;return e.in_loop=this,a(e),this.body.walk(e),s(e),e.in_loop=i,!0}),e(Q,E),e(pe,function(e){return this.condition.walk(e),a(e),this.body.walk(e),s(e),this.alternative&&(a(e),this.alternative.walk(e),s(e)),!0}),e(P,function(e){return a(e),this.body.walk(e),s(e),!0}),e(lt,function(){this.definition().fixed=!1}),e(_t,function(e,t,i){var r,o=this.definition();o.references.push(this),1==o.references.length&&!o.fixed&&o.orig[0]instanceof ot&&(e.loop_ids[o.id]=e.in_loop),void 0!==o.fixed&&l(e,o)?o.fixed&&((r=this.fixed_value())instanceof j&&Qt(e,o)?o.recursive_refs++:r&&!i.exposed(o)&&function(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids[n.id]===e.in_loop}(e,i,o)?o.single_use=r instanceof j&&!r.pinned()||r instanceof qe||o.scope===this.scope&&r.is_constant_expression():o.single_use=!1,n(i,e,this,r,0,function(e){return!!e&&(e.is_constant()||e instanceof j||e instanceof Dt)}(r))&&(o.single_use?o.single_use="m":o.fixed=!1)):o.fixed=!1,p(e,o,this.scope,this,r,0,1)}),e(q,function(e,t,n){this.globals.each(function(e){i(n,e)}),r(e,n,this)}),e(he,function(e,t,n){return o(n,this),a(e),w(this,e),s(e),this.bcatch&&(a(e),this.bcatch.walk(e),s(e)),this.bfinally&&this.bfinally.walk(e),!0}),e(ke,function(e,t){var n=this;if("++"==n.operator||"--"==n.operator){var i=n.expression;if(i instanceof _t){var r=i.definition(),o=f(e,r,!0);if(r.assignments++,o){var a=r.fixed;if(a)return r.references.push(i),r.chained=!0,r.fixed=function(){return m(Ve,n,{operator:n.operator.slice(0,-1),left:m(Ie,n,{operator:"+",expression:a instanceof O?a:a()}),right:m(St,n,{value:1})})},u(e,r,!0),!0}}}}),e(Oe,function(e,t){var n=this;if(n.name instanceof te)n.name.walk(d);else{var i=n.name.definition();if(n.value){if(f(e,i,n.value))return i.fixed=function(){return n.value},e.loop_ids[i.id]=e.in_loop,u(e,i,!1),t(),u(e,i,!0),!0;i.fixed=!1}}}),e(G,function(e,t,n){o(n,this);var i=e.in_loop;return e.in_loop=this,a(e),t(),s(e),e.in_loop=i,!0})}(function(e,t){e.DEFMETHOD("reduce_vars",t)}),q.DEFMETHOD("reset_opt_flags",function(e){var t=this,n=e.option("reduce_vars"),i=new It(function(r,o){if(r._squeezed=!1,r._optimized=!1,n)return e.top_retain&&(i.parent()===t?r._top=!0:delete r._top),r.reduce_vars(i,o,e)});i.safe_ids=Object.create(null),i.in_loop=null,i.loop_ids=Object.create(null),t.walk(i)}),Ze.DEFMETHOD("fixed_value",function(){var e=this.definition().fixed;return!e||e instanceof O?e:e()}),_t.DEFMETHOD("is_immutable",function(){var e=this.definition().orig;return 1==e.length&&e[0]instanceof st});var it=g("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");_t.DEFMETHOD("is_declared",function(e){return!this.definition().undeclared||e.option("unsafe")&&it(this.name)});var ut,ct,ft,pt=g("Infinity NaN undefined");function dt(e){return e instanceof Rt||e instanceof Ct||e instanceof Ot}function Et(e,t){var r,u,c=t.find_parent(Y).get_defun_scope();!function(){var e=t.self(),n=0;do{if(e instanceof De||e instanceof ge)n++;else if(e instanceof B)r=!0;else{if(e instanceof Y){c=e;break}e instanceof he&&(u=!0)}}while(e=t.parent(n++))}();var l,f=10;do{l=!1,d(e),t.option("dead_code")&&g(e,t),t.option("if_return")&&E(e,t),t.sequences_limit>0&&(S(e,t),b(e,t)),t.option("join_vars")&&F(e),t.option("collapse_vars")&&p(e,t)}while(l&&f-- >0);function p(e,t){if(c.pinned())return e;for(var f,p=[],d=e.length,E=new vn(function(e,n){if(V)return e;if(!L)return e!==D[g]?e:++g=0;){0==d&&t.option("unused")&&ee();var D=[];for(ne(e[d]);p.length>0;){D=p.pop();var g=0,A=D[D.length-1],S=null,T=null,b=null,y=ie(A);if(y&&!a(y)&&!y.has_side_effects(t)){var O=oe(A),F=ue(y);y instanceof _t&&(O[y.name]=!1);var M=le(A),w=fe(),x=A.may_throw(t),I=A.name instanceof rt,L=I,V=!1,P=0,U=!f||!L;if(!U){for(var G=t.self().argnames.lastIndexOf(A.name)+1;!V&&GP)P=!1;else{V=!1,g=0,L=I;for(z=d;!V&&z=0;){var c=n.argnames[u],l=e.args[u];if(f.unshift(m(Oe,c,{name:c,value:l})),!(c.name in s))if(s[c.name]=!0,c instanceof $){var d=e.args.slice(u);v(d,function(e){return!Q(n,e,r)})&&p.unshift([m(Oe,c,{name:c.expression,value:m(Ue,e,{elements:d})})])}else l?(l instanceof j&&l.pinned()||Q(n,l,r))&&(l=null):l=m(Ot,c).transform(t),l&&p.unshift([m(Oe,c,{name:c,value:l})])}}}function ne(e){if(D.push(e),e instanceof Be)e.left.has_side_effects(t)||p.push(D.slice()),ne(e.right);else if(e instanceof Ve)ne(e.left),ne(e.right);else if(e instanceof Fe)ne(e.expression),e.args.forEach(ne);else if(e instanceof Ee)ne(e.expression);else if(e instanceof Pe)ne(e.condition),ne(e.consequent),ne(e.alternative);else if(!(e instanceof ve)||!t.option("unused")&&e instanceof Te)e instanceof K?(ne(e.condition),e.body instanceof k||ne(e.body)):e instanceof ae?e.value&&ne(e.value):e instanceof H?(e.init&&ne(e.init),e.condition&&ne(e.condition),e.step&&ne(e.step),e.body instanceof k||ne(e.body)):e instanceof X?(ne(e.object),e.body instanceof k||ne(e.body)):e instanceof pe?(ne(e.condition),e.body instanceof k||ne(e.body),!e.alternative||e.alternative instanceof k||ne(e.alternative)):e instanceof Me?e.expressions.forEach(ne):e instanceof N?ne(e.body):e instanceof de?(ne(e.expression),e.body.forEach(ne)):e instanceof ke?"++"!=e.operator&&"--"!=e.operator||p.push(D.slice()):e instanceof Oe&&e.value&&(p.push(D.slice()),ne(e.value));else{var n=e.definitions.length,i=n-200;for(i<0&&(i=0);i1&&!(e.name instanceof rt)||(o>1?function(e){var t=e.value;if(t instanceof _t&&"arguments"!=t.name){var n=t.definition();if(!n.undeclared)return S=n}}(e):!t.exposed(r))?m(_t,e.name,e.name):void 0}}function re(e){return e[e instanceof Be?"right":"value"]}function oe(e){var i=Object.create(null);if(e instanceof ke)return i;var r=new It(function(e,o){for(var a=e;a instanceof Ne;)a=a.expression;(a instanceof _t||a instanceof Dt)&&(i[a.name]=i[a.name]||n(t,r,e,e,0))});return re(e).walk(r),i}function se(n){if(n.name instanceof rt){var i=t.parent(),r=t.self().argnames,o=r.indexOf(n.name);if(o<0)i.args.length=Math.min(i.args.length,r.length-1);else{var a=i.args;a[o]&&(a[o]=m(St,a[o],{value:0}))}return!0}var s=!1;return e[d].transform(new vn(function(e,t,i){return s?e:e===n||e.body===n?(s=!0,e instanceof Oe?(e.value=null,e):i?_.skip:null):void 0},function(e){if(e instanceof Me)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}}))}function ue(e){for(;e instanceof Ne;)e=e.expression;return e instanceof _t&&e.definition().scope===c&&!(r&&(e.name in O||A instanceof ke||A instanceof Be&&"="!=A.operator))}function le(e){return!(e instanceof ke)&&re(e).has_side_effects(t)}function fe(){if(M)return!1;if(S)return!0;if(y instanceof _t){var e=y.definition();if(e.references.length-e.replaced==(A instanceof Oe?1:2))return!0}return!1}function _e(e){if(!e.definition)return!0;var t=e.definition();return!(1==t.orig.length&&t.orig[0]instanceof ot)&&(t.scope.get_defun_scope()!==c||!v(t.references,function(e){var t=e.scope.get_defun_scope();return"Scope"==t.TYPE&&(t=t.parent_scope),t===c}))}}function d(e){for(var t=[],n=0;n=0;){var i=e[n];if(i instanceof pe&&i.body instanceof se&&++t>1)return!0}return!1}(e),r=n instanceof j,o=e.length;--o>=0;){var a=e[o],s=g(o),u=e[s];if(r&&!u&&a instanceof se){if(!a.value){l=!0,e.splice(o,1);continue}if(a.value instanceof Ie&&"void"==a.value.operator){l=!0,e[o]=m(N,a,{body:a.value.expression});continue}}if(a instanceof pe){var c;if(_(c=Wt(a.body))){c.label&&h(c.label.thedef.references,c),l=!0,(a=a.clone()).condition=a.condition.negate(t);var f=D(a.body,c);a.body=m(I,a,{body:V(a.alternative).concat(E())}),a.alternative=m(I,a,{body:f}),e[o]=a.transform(t);continue}if(_(c=Wt(a.alternative))){c.label&&h(c.label.thedef.references,c),l=!0,(a=a.clone()).body=m(I,a.body,{body:V(a.body).concat(E())});f=D(a.alternative,c);a.alternative=m(I,a.alternative,{body:f}),e[o]=a.transform(t);continue}}if(a instanceof pe&&a.body instanceof se){var p=a.body.value;if(!p&&!a.alternative&&(r&&!u||u instanceof se&&!u.value)){l=!0,e[o]=m(N,a.condition,{body:a.condition});continue}if(p&&!a.alternative&&u instanceof se&&u.value){l=!0,(a=a.clone()).alternative=u,e.splice(o,1,a.transform(t)),e.splice(s,1);continue}if(p&&!a.alternative&&(!u&&r&&i||u instanceof se)){l=!0,(a=a.clone()).alternative=u||m(se,a,{value:null}),e.splice(o,1,a.transform(t)),u&&e.splice(s,1);continue}var d=e[v(o)];if(t.option("sequences")&&r&&!a.alternative&&d instanceof pe&&d.body instanceof se&&g(s)==e.length&&u instanceof N){l=!0,(a=a.clone()).alternative=m(I,u,{body:[u,m(se,u,{value:null})]}),e.splice(o,1,a.transform(t)),e.splice(s,1);continue}}}function _(i){if(!i)return!1;for(var a=o+1,s=e.length;a=0;){var i=e[n];if(!(i instanceof Ae&&A(i)))break}return n}}function g(e,t){for(var n,i=t.self(),r=0,o=0,a=e.length;r=t.sequences_limit&&u();var s=a.body;n.length>0&&(s=s.drop_side_effect_free(t)),s&&x(n,s)}else a instanceof ve&&A(a)||a instanceof ee?e[i++]=a:(u(),e[i++]=a)}u(),e.length=i,i!=o&&(l=!0)}function u(){if(n.length){var t=D(n[0],n);e[i++]=m(N,t,{body:t}),n=[]}}}function T(e,t){if(!(e instanceof I))return e;for(var n=null,i=0,r=e.body.length;i0){var p=u.length;u.push(m(pe,a,{condition:a.condition,body:c||m(L,a.body),alternative:f})),u.unshift(r,1),[].splice.apply(e,u),o+=p,r+=p+1,i=null,l=!0;continue}}e[r++]=a,i=a instanceof N?a:null}e.length=r}function y(e,n){if(e instanceof ve){var i,r=e.definitions[e.definitions.length-1];if(r.value instanceof Ge)if(n instanceof Be?i=[n]:n instanceof Me&&(i=n.expressions.slice()),i){var o=!1;do{var a=i[0];if(!(a instanceof Be))break;if("="!=a.operator)break;if(!(a.left instanceof Ne))break;var s=a.left.expression;if(!(s instanceof _t))break;if(r.name.name!=s.name)break;if(!a.right.is_constant_expression(c))break;var u=a.left.property;if(u instanceof O&&(u=u.evaluate(t)),u instanceof O)break;u=""+u;var l=t.option("ecma")<6&&t.has_directive("use strict")?function(e){return e.key!=u&&e.key.name!=u}:function(e){return e.key.name!=u};if(!v(r.value.properties,l))break;var f=r.value.properties.filter(function(e){return e.key===u})[0];f?f.value=new Me({start:f.start,expressions:[f.value.clone(),a.right.clone()],end:f.end}):r.value.properties.push(m(Xe,a,{key:u,value:a.right})),i.shift(),o=!0}while(i.length);return o&&i}}}function F(e){for(var t,n=0,i=-1,r=e.length;n=0;)if(this.properties[n]._dot_throw(e))return!0;return!1}),e(He,l),e(We,f),e($,function(e){return this.expression._dot_throw(e)}),e(Q,l),e(J,l),e(Le,l),e(Ie,function(){return"void"==this.operator}),e(Ve,function(e){return("&&"==this.operator||"||"==this.operator)&&(this.left._dot_throw(e)||this.right._dot_throw(e))}),e(Be,function(e){return"="==this.operator&&this.right._dot_throw(e)}),e(Pe,function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)}),e(we,function(e){return!!t(e)&&!(this.expression instanceof Q&&"prototype"==this.property)}),e(Me,function(e){return this.tail_node()._dot_throw(e)}),e(_t,function(e){if(this.is_undefined)return!0;if(!t(e))return!1;if(Qe(this)&&this.is_declared(e))return!1;if(this.is_immutable())return!1;var n=this.fixed_value();return!n||n._dot_throw(e)})}(function(e,t){e.DEFMETHOD("_dot_throw",t)}),ct=["!","delete"],ft=["in","instanceof","==","!=","===","!==","<","<=",">=",">"],(ut=function(e,t){e.DEFMETHOD("is_boolean",t)})(O,l),ut(Ie,function(){return i(this.operator,ct)}),ut(Ve,function(){return i(this.operator,ft)||Lt(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()}),ut(Pe,function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()}),ut(Be,function(){return"="==this.operator&&this.right.is_boolean()}),ut(Me,function(){return this.tail_node().is_boolean()}),ut(wt,f),ut(Nt,f),function(e){e(O,l),e(St,f);var t=g("+ - ~ ++ --");e(ke,function(){return t(this.operator)});var n=g("- * / % & | ^ << >> >>>");e(Ve,function(e){return n(this.operator)||"+"==this.operator&&this.left.is_number(e)&&this.right.is_number(e)}),e(Be,function(e){return n(this.operator.slice(0,-1))||"="==this.operator&&this.right.is_number(e)}),e(Me,function(e){return this.tail_node().is_number(e)}),e(Pe,function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)})}(function(e,t){e.DEFMETHOD("is_number",t)}),function(e){e(O,l),e(At,f),e(ie,function(){return 1===this.segments.length}),e(Ie,function(){return"typeof"==this.operator}),e(Ve,function(e){return"+"==this.operator&&(this.left.is_string(e)||this.right.is_string(e))}),e(Be,function(e){return("="==this.operator||"+="==this.operator)&&this.right.is_string(e)}),e(Me,function(e){return this.tail_node().is_string(e)}),e(Pe,function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)})}(function(e,t){e.DEFMETHOD("is_string",t)});var Lt=g("&& ||"),Vt=g("delete ++ --");function Pt(e,t){return t instanceof ke&&Vt(t.operator)?t.expression:t instanceof Be&&t.left===e?e:void 0}function Bt(e,t){return e.print_to_string().length>t.print_to_string().length?t:e}function Kt(e,t,n){return(T(e)?function(e,t){return Bt(m(N,e,{body:e}),m(N,t,{body:t})).body}:Bt)(t,n)}function Ut(e){for(var t in e)e[t]=g(e[t])}!function(e){function t(e,t){e.warn("global_defs "+t.print_to_string()+" redefined [{file}:{line},{col}]",t.start)}q.DEFMETHOD("resolve_defines",function(e){return e.option("global_defs")?(this.figure_out_scope({ie8:e.option("ie8")}),this.transform(new vn(function(n){var i=n._find_defs(e,"");if(i){for(var r,o=0,a=n;(r=this.parent(o++))&&r instanceof Ne&&r.expression===a;)a=r;if(!Pt(a,r))return i;t(e,n)}}))):this}),e(O,c),e(we,function(e,t){return this.expression._find_defs(e,"."+this.property+t)}),e(Je,function(e){this.global()&&S(e.option("global_defs"),this.name)&&t(e,this)}),e(_t,function(e,t){if(this.global()){var n=e.option("global_defs"),i=this.name+t;return S(n,i)?function e(t,n){if(t instanceof O)return m(t.CTOR,n,t);if(Array.isArray(t))return m(Ue,n,{elements:t.map(function(t){return e(t,n)})});if(t&&"object"==typeof t){var i=[];for(var r in t)S(t,r)&&i.push(m(Xe,n,{key:r,value:e(t[r],n)}));return m(Ge,n,{properties:i})}return y(t,n)}(n[i],this):void 0}})}(function(e,t){e.DEFMETHOD("_find_defs",t)});var Gt=["constructor","toString","valueOf"],Ht={Array:["indexOf","join","lastIndexOf","slice"].concat(Gt),Boolean:Gt,Function:Gt,Number:["toExponential","toFixed","toPrecision"].concat(Gt),Object:Gt,RegExp:["test"].concat(Gt),String:["charAt","charCodeAt","concat","indexOf","italics","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","trim"].concat(Gt)};Ut(Ht);var Xt={Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","keys"],String:["fromCharCode"]};Ut(Xt),function(e){O.DEFMETHOD("evaluate",function(e){if(!e.option("evaluate"))return this;var t=this._eval(e,1);return!t||t instanceof RegExp?t:"function"==typeof t||"object"==typeof t?this:t});var t=g("! ~ - + void");O.DEFMETHOD("is_constant",function(){return this instanceof vt?!(this instanceof Tt):this instanceof Ie&&this.expression instanceof vt&&t(this.operator)}),e(F,function(){throw new Error(E("Cannot evaluate a statement [{file}:{line},{col}]",this.start))}),e(j,p),e(qe,p),e(O,p),e(vt,function(){return this.getValue()}),e(ie,function(){return 1!==this.segments.length?this:this.segments[0].value}),e(Q,function(e){if(e.option("unsafe")){var t=function(){};return t.node=this,t.toString=function(){return this.node.print_to_string()},t}return this}),e(Ue,function(e,t){if(e.option("unsafe")){for(var n=[],i=0,r=this.elements.length;i>":r=n>>o;break;case">>>":r=n>>>o;break;case"==":r=n==o;break;case"===":r=n===o;break;case"!=":r=n!=o;break;case"!==":r=n!==o;break;case"<":r=n":r=n>o;break;case">=":r=n>=o;break;default:return this}return isNaN(r)&&e.find_parent(W)?this:r}),e(Pe,function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var i=n?this.consequent:this.alternative,r=i._eval(e,t);return r===i?this:r}),e(_t,function(e,t){var n,i=this.fixed_value();if(!i)return this;if(S(i,"_eval"))n=i._eval();else{if(this._eval=p,n=i._eval(e,t),delete this._eval,n===i)return this;i._eval=function(){return n}}if(n&&"object"==typeof n){var r=this.definition().escaped;if(r&&t>r)return this}return n});var r={Array:Array,Math:Math,Number:Number,Object:Object,String:String},o={Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]};Ut(o),e(Ne,function(e,t){if(e.option("unsafe")){var n=this.property;if(n instanceof O&&(n=n._eval(e,t))===this.property)return this;var i,a=this.expression;if(Qe(a)){var s,u="hasOwnProperty"===a.name&&"call"===n&&(s=e.parent()&&e.parent().args)&&s&&s[0]&&s[0].evaluate(e);if(null==u||u.thedef&&u.thedef.undeclared)return this.clone();if(!(o[a.name]||l)(n))return this;i=r[a.name]}else{if(!(i=a._eval(e,t+1))||i===a||!S(i,n))return this;if("function"==typeof i)switch(n){case"name":return i.node.name?i.node.name.name:"";case"length":return i.node.argnames.length;default:return this}}return i[n]}return this}),e(Fe,function(e,t){var n=this.expression;if(e.option("unsafe")&&n instanceof Ne){var i,o=n.property;if(o instanceof O&&(o=o._eval(e,t))===n.property)return this;var a=n.expression;if(Qe(a)){var s="hasOwnProperty"===a.name&&"call"===o&&this.args[0]&&this.args[0].evaluate(e);if(null==s||s.thedef&&s.thedef.undeclared)return this.clone();if(!(Xt[a.name]||l)(o))return this;i=r[a.name]}else if((i=a._eval(e,t+1))===a||!(i&&Ht[i.constructor.name]||l)(o))return this;for(var u=[],c=0,f=this.args.length;c=":return r.operator="<",r;case">":return r.operator="<=",r}switch(o){case"==":return r.operator="!=",r;case"!=":return r.operator="==",r;case"===":return r.operator="!==",r;case"!==":return r.operator="===",r;case"&&":return r.operator="||",r.left=r.left.negate(e,i),r.right=r.right.negate(e),n(this,r,i);case"||":return r.operator="&&",r.left=r.left.negate(e,i),r.right=r.right.negate(e),n(this,r,i)}return t(this)})}(function(e,t){e.DEFMETHOD("negate",function(e,n){return t.call(this,e,n)})});var zt=g("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");function Wt(e){return e&&e.aborts()}Fe.DEFMETHOD("is_expr_pure",function(e){if(e.option("unsafe")){var t=this.expression,n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&"hasOwnProperty"===t.expression.name&&(null==n||n.thedef&&n.thedef.undeclared))return!1;if(Qe(t)&&zt(t.name))return!0;if(t instanceof we&&Qe(t.expression)&&(Xt[t.expression.name]||l)(t.property))return!0}return this.pure||!e.pure_funcs(this)}),O.DEFMETHOD("is_call_pure",l),we.DEFMETHOD("is_call_pure",function(e){if(e.option("unsafe")){var t=this.expression,n=l;return t instanceof Ue?n=Ht.Array:t.is_boolean()?n=Ht.Boolean:t.is_number(e)?n=Ht.Number:t instanceof Tt?n=Ht.RegExp:t.is_string(e)?n=Ht.String:this.may_throw_on_access(e)||(n=Ht.Object),n(this.property)}}),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return!0;return!1}e(O,f),e(L,l),e(vt,l),e(Dt,l),e(k,function(e){return t(this.body,e)}),e(Fe,function(e){return!(this.is_expr_pure(e)||this.expression.is_call_pure(e)&&!this.expression.has_side_effects(e))||t(this.args,e)}),e(de,function(e){return this.expression.has_side_effects(e)||t(this.body,e)}),e(Ee,function(e){return this.expression.has_side_effects(e)||t(this.body,e)}),e(he,function(e){return t(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)}),e(pe,function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)}),e(P,function(e){return this.body.has_side_effects(e)}),e(N,function(e){return this.body.has_side_effects(e)}),e(j,l),e(qe,l),e($e,f),e(Ve,function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)}),e(Be,f),e(Pe,function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)}),e(ke,function(e){return Vt(this.operator)||this.expression.has_side_effects(e)}),e(_t,function(e){return!this.is_declared(e)}),e(Je,l),e(Ge,function(e){return t(this.properties,e)}),e(He,function(e){return!!(this.key instanceof Xe&&this.key.has_side_effects(e))||this.value.has_side_effects(e)}),e(Ue,function(e){return t(this.elements,e)}),e(we,function(e){return this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)}),e(xe,function(e){return this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e)}),e(Me,function(e){return t(this.expressions,e)}),e(ve,function(e){return t(this.definitions,e)}),e(Oe,function(e){return this.value}),e(re,l),e(ie,function(e){return t(this.segments,e)})}(function(e,t){e.DEFMETHOD("has_side_effects",t)}),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return!0;return!1}e(O,f),e(qe,l),e(vt,l),e(L,l),e(j,l),e(Je,l),e(Dt,l),e(Ue,function(e){return t(this.elements,e)}),e(Be,function(e){return!!this.right.may_throw(e)||!(!e.has_directive("use strict")&&"="==this.operator&&this.left instanceof _t)&&this.left.may_throw(e)}),e(Ve,function(e){return this.left.may_throw(e)||this.right.may_throw(e)}),e(k,function(e){return t(this.body,e)}),e(Fe,function(e){return!!t(this.args,e)||!this.is_expr_pure(e)&&(!!this.expression.may_throw(e)||(!(this.expression instanceof j)||t(this.expression.body,e)))}),e(Ee,function(e){return this.expression.may_throw(e)||t(this.body,e)}),e(Pe,function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)}),e(ve,function(e){return t(this.definitions,e)}),e(we,function(e){return this.expression.may_throw_on_access(e)||this.expression.may_throw(e)}),e(pe,function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)}),e(P,function(e){return this.body.may_throw(e)}),e(Ge,function(e){return t(this.properties,e)}),e(He,function(e){return this.value.may_throw(e)}),e(se,function(e){return this.value&&this.value.may_throw(e)}),e(Me,function(e){return t(this.expressions,e)}),e(N,function(e){return this.body.may_throw(e)}),e(xe,function(e){return this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e)}),e(de,function(e){return this.expression.may_throw(e)||t(this.body,e)}),e(_t,function(e){return!this.is_declared(e)}),e(he,function(e){return this.bcatch?this.bcatch.may_throw(e):t(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)}),e(ke,function(e){return!("typeof"==this.operator&&this.expression instanceof _t)&&this.expression.may_throw(e)}),e(Oe,function(e){return!!this.value&&this.value.may_throw(e)})}(function(e,t){e.DEFMETHOD("may_throw",t)}),function(e){function t(e){for(var t=e.length;--t>=0;)if(!e[t].is_constant_expression())return!1;return!0}function n(e){var t=this,n=!0;return t.walk(new It(function(r){if(!n)return!0;if(r instanceof _t){if(t.inlined)return n=!1,!0;var o=r.definition();if(i(o,t.enclosed)&&!t.variables.has(o.name)){if(e){var a=e.find_variable(r);if(o.undeclared?!a:a===o)return n="f",!0}n=!1}return!0}return r instanceof Dt&&t instanceof J?(n=!1,!0):void 0})),n}e(O,l),e(vt,f),e(qe,function(e){return!(this.extends&&!this.extends.is_constant_expression(e))&&n.call(this,e)}),e(j,n),e(ke,function(){return this.expression.is_constant_expression()}),e(Ve,function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()}),e(Ue,function(){return t(this.elements)}),e(Ge,function(){return t(this.properties)}),e(He,function(){return!(this.key instanceof O)&&this.value.is_constant_expression()})}(function(e,t){e.DEFMETHOD("is_constant_expression",t)}),function(e){function t(){for(var e=0;e1)||(o.name=null)),o instanceof j&&!(o instanceof Z))for(var g=!e.option("keep_fargs"),A=o.argnames,S=A.length;--S>=0;){var y;(y=A[S])instanceof $&&(y=y.expression),y instanceof Ke&&(y=y.left),y instanceof te||y.definition().id in a?g=!1:(y.__unused=!0,g&&(A.pop(),e[y.unreferenced()?"warn":"info"]("Dropping unused function argument {name} [{file}:{line},{col}]",V(y))))}if((o instanceof ee||o instanceof $e)&&o!==t)if(!((E=o.name.definition()).id in a||!n&&E.global))return e[o.name.unreferenced()?"warn":"info"]("Dropping unused function {name} [{file}:{line},{col}]",V(o.name)),E.eliminated++,m(L,o);if(o instanceof ve&&!(f instanceof X&&f.init===o)){var O=!(f instanceof q||o instanceof Ae),F=[],R=[],M=[],w=[];switch(o.definitions.forEach(function(t){t.value&&(t.value=t.value.transform(T));var n=t.name instanceof te,r=n?new An(null,{name:""}):t.name.definition();if(O&&r.global)return M.push(t);if(!i&&!O||n&&(t.name.names.length||t.name.is_array||1!=e.option("pure_getters"))||r.id in a){if(t.value&&r.id in u&&u[r.id]!==t&&(t.value=t.value.drop_side_effect_free(e)),t.name instanceof et){var s=c.get(r.id);if(s.length>1&&(!t.value||r.orig.indexOf(t.name)>r.eliminated)){if(e.warn("Dropping duplicated definition of variable {name} [{file}:{line},{col}]",V(t.name)),t.value){var l=m(_t,t.name,t.name);r.references.push(l);var f=m(Be,t,{operator:"=",left:l,right:t.value});u[r.id]===t&&(u[r.id]=f),w.push(f.transform(T))}return h(s,t),void r.eliminated++}}t.value?(w.length>0&&(M.length>0?(w.push(t.value),t.value=D(t.value,w)):F.push(m(N,o,{body:D(o,w)})),w=[]),M.push(t)):R.push(t)}else if(r.orig[0]instanceof lt){(p=t.value&&t.value.drop_side_effect_free(e))&&w.push(p),t.value=null,R.push(t)}else{var p;(p=t.value&&t.value.drop_side_effect_free(e))?(n||e.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]",V(t.name)),w.push(p)):n||e[t.name.unreferenced()?"warn":"info"]("Dropping unused variable {name} [{file}:{line},{col}]",V(t.name)),r.eliminated++}}),(R.length>0||M.length>0)&&(o.definitions=R.concat(M),F.push(o)),w.length>0&&F.push(m(N,o,{body:D(o,w)})),F.length){case 0:return l?_.skip:m(L,o);case 1:return F[0];default:return l?_.splice(F):m(I,o,{body:F})}}if(o instanceof H)return s(o,this),o.init instanceof I&&(x=o.init,o.init=x.body.pop(),x.body.push(o)),o.init instanceof N?o.init=o.init.body:z(o.init)&&(o.init=null),x?l?_.splice(x.body):x:o;if(o instanceof P&&o.body instanceof H){if(s(o,this),o.body instanceof I){var x=o.body;return o.body=x.body.pop(),x.body.push(o),l?_.splice(x.body):x}return o}if(o instanceof I)return s(o,this),l&&v(o.body,ue)?_.splice(o.body):o;if(o instanceof Y){var k=d;return d=o,s(o,this),d=k,o}}function V(e){return{name:e.name,file:e.start.file,line:e.start.line,col:e.start.col}}});t.transform(T)}}function y(e,n){var i,c=r(e);if(c instanceof _t&&!s(e.left,tt)&&t.variables.get(c.name)===(i=c.definition()))return e instanceof Be&&(e.right.walk(E),i.chained||e.left.fixed_value()!==e.right||(u[i.id]=e)),!0;if(e instanceof _t)return(i=e.definition()).id in a||(a[i.id]=!0,o.push(i),(i=i.redefined())&&(a[i.id]=!0,o.push(i))),!0;if(e instanceof Y){var l=d;return d=e,n(),d=l,!0}}}),Y.DEFMETHOD("hoist_declarations",function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs"),i=e.option("hoist_vars");if(n||i){var o=[],a=[],s=new A,u=0,c=0;t.walk(new It(function(e){return e instanceof Y&&e!==t||(e instanceof Ae?(++c,!0):void 0)})),i=i&&c>1;var l=new vn(function(r){if(r!==t){if(r instanceof M)return o.push(r),m(L,r);if(n&&r instanceof ee&&!(l.parent()instanceof Ce)&&l.parent()===t)return a.push(r),m(L,r);if(i&&r instanceof Ae){r.definitions.forEach(function(e){e.name instanceof te||(s.set(e.name.name,e),++u)});var c=r.to_assignments(e),f=l.parent();if(f instanceof X&&f.init===r){if(null==c){var p=r.definitions[0].name;return m(_t,p,p)}return c}return f instanceof H&&f.init===r?c:c?m(N,r,{body:c}):m(L,r)}if(r instanceof Y)return r}});if(t=t.transform(l),u>0){var f=[];if(s.each(function(e,n){t instanceof j&&r(function(t){return t.name==e.name.name},t.args_as_names())?s.del(n):((e=e.clone()).value=null,f.push(e),s.set(n,e))}),f.length>0){for(var p=0;p0&&(u[0].body=s.concat(u[0].body)),e.body=u;n=u[u.length-1];){var d=n.body[n.body.length-1];if(d instanceof le&&t.loopcontrol_target(d)===e&&n.body.pop(),n.body.length||n instanceof Ee&&(o||n.expression.has_side_effects(t)))break;u.pop()===o&&(o=null)}if(0==u.length)return m(I,e,{body:s.concat(m(N,e.expression,{body:e.expression}))}).optimize(t);if(1==u.length&&(u[0]===a||u[0]===o)){var _=!1,E=new It(function(t){if(_||t instanceof j||t instanceof N)return!0;t instanceof le&&E.loopcontrol_target(t)===e&&(_=!0)});if(e.walk(E),!_){var h,D=u[0].body.slice();return(h=u[0].expression)&&D.unshift(m(N,h,{body:h})),D.unshift(m(N,e.expression,{body:e.expression})),m(I,e,{body:D}).optimize(t)}}return e;function g(e,n){n&&!Wt(n)?n.body=n.body.concat(e.body):ht(t,e,s)}}),e(he,function(e,t){if(Et(e.body,t),e.bcatch&&e.bfinally&&v(e.bfinally.body,z)&&(e.bfinally=null),t.option("dead_code")&&v(e.body,z)){var n=[];return e.bcatch&&(ht(t,e.bcatch,n),n.forEach(function(e){e instanceof ve&&e.definitions.forEach(function(e){var t=e.name.definition().redefined();t&&(e.name=e.name.clone(),e.name.thedef=t)})})),e.bfinally&&(n=n.concat(e.bfinally.body)),m(I,e,{body:n}).optimize(t)}return e}),ve.DEFMETHOD("remove_initializers",function(){var e=[];this.definitions.forEach(function(t){t.name instanceof Je?(t.value=null,e.push(t)):t.name.walk(new It(function(n){n instanceof Je&&e.push(m(Oe,t,{name:n,value:null}))}))}),this.definitions=e}),ve.DEFMETHOD("to_assignments",function(e){var t=e.option("reduce_vars"),n=this.definitions.reduce(function(e,n){if(!n.value||n.name instanceof te){if(n.value){var i=m(Oe,n,{name:n.name,value:n.value}),r=m(Ae,n,{definitions:[i]});e.push(r)}}else{var o=m(_t,n.name,n.name);e.push(m(Be,n,{operator:"=",left:o,right:n.value})),t&&(o.definition().fixed=!1)}return(n=n.name.definition()).eliminated++,n.replaced--,e},[]);return 0==n.length?null:D(this,n)}),e(ve,function(e,t){return 0==e.definitions.length?m(L,e):e}),e(ye,function(e,t){return e}),e(Fe,function(e,t){var n=e.expression,i=n,r=v(e.args,function(e){return!(e instanceof $)});t.option("reduce_vars")&&i instanceof _t&&jt(i=i.fixed_value(),t)&&(i=n);var a=i instanceof j;if(t.option("unused")&&r&&a&&!i.uses_arguments&&!i.pinned()){for(var s=0,u=0,c=0,l=e.args.length;c=i.argnames.length;if(f||i.argnames[c].__unused){if(A=e.args[c].drop_side_effect_free(t))e.args[s++]=A;else if(!f){e.args[s++]=m(St,e.args[c],{value:0});continue}}else e.args[s++]=e.args[c];u=s}e.args.length=u}if(t.option("unsafe"))if(Qe(n))switch(n.name){case"Array":if(1!=e.args.length)return m(Ue,e,{elements:e.args}).optimize(t);break;case"Object":if(0==e.args.length)return m(Ge,e,{properties:[]});break;case"String":if(0==e.args.length)return m(At,e,{value:""});if(e.args.length<=1)return m(Ve,e,{left:e.args[0],operator:"+",right:m(At,e,{value:""})}).optimize(t);break;case"Number":if(0==e.args.length)return m(St,e,{value:0});if(1==e.args.length)return m(Ie,e,{expression:e.args[0],operator:"+"}).optimize(t);case"Boolean":if(0==e.args.length)return m(Nt,e);if(1==e.args.length)return m(Ie,e,{expression:m(Ie,e,{expression:e.args[0],operator:"!"}),operator:"!"}).optimize(t);break;case"RegExp":var p=[];if(v(e.args,function(e){var n=e.evaluate(t);return p.unshift(n),e!==n}))try{return Kt(t,e,m(Tt,e,{value:RegExp.apply(RegExp,p)}))}catch(n){t.warn("Error converting {expr} [{file}:{line},{col}]",{expr:e.print_to_string(),file:e.start.file,line:e.start.line,col:e.start.col})}}else if(n instanceof we)switch(n.property){case"toString":if(0==e.args.length&&!n.expression.may_throw_on_access(t))return m(Ve,e,{left:m(At,e,{value:""}),operator:"+",right:n.expression}).optimize(t);break;case"join":if(n.expression instanceof Ue)e:{var d;if(!(e.args.length>0&&(d=e.args[0].evaluate(t))===e.args[0])){var _,E=[],h=[];for(c=0,l=n.expression.elements.length;c0&&(E.push(m(At,e,{value:h.join(d)})),h.length=0),E.push(g))}return h.length>0&&E.push(m(At,e,{value:h.join(d)})),0==E.length?m(At,e,{value:""}):1==E.length?E[0].is_string(t)?E[0]:m(Ve,E[0],{operator:"+",left:m(At,e,{value:""}),right:E[0]}):""==d?(_=E[0].is_string(t)||E[1].is_string(t)?E.shift():m(At,e,{value:""}),E.reduce(function(e,t){return m(Ve,t,{operator:"+",left:e,right:t})},_).optimize(t)):((A=e.clone()).expression=A.expression.clone(),A.expression.expression=A.expression.expression.clone(),A.expression.expression.elements=E,Kt(t,e,A));var A}}break;case"charAt":if(n.expression.is_string(t)){var S=e.args[0],T=S?S.evaluate(t):0;if(T!==S)return m(xe,n,{expression:n.expression,property:y(0|T,S||n)}).optimize(t)}break;case"apply":if(2==e.args.length&&e.args[1]instanceof Ue)return(V=e.args[1].elements.slice()).unshift(e.args[0]),m(Fe,e,{expression:m(we,n,{expression:n.expression,property:"call"}),args:V}).optimize(t);break;case"call":var b=n.expression;if(b instanceof _t&&(b=b.fixed_value()),b instanceof j&&!b.contains_this())return(e.args.length?D(this,[e.args[0],m(Fe,e,{expression:n.expression,args:e.args.slice(1)})]):m(Fe,e,{expression:n.expression,args:[]})).optimize(t)}if(t.option("unsafe_Function")&&Qe(n)&&"Function"==n.name){if(0==e.args.length)return m(Q,e,{argnames:[],body:[]}).optimize(t);if(v(e.args,function(e){return e instanceof At}))try{var C=gn(w="n(function("+e.args.slice(0,-1).map(function(e){return e.value}).join(",")+"){"+e.args[e.args.length-1].value+"})"),F={ie8:t.option("ie8")};C.figure_out_scope(F);var R,M=new Rn(t.options);(C=C.transform(M)).figure_out_scope(F),yn.reset(),C.compute_char_frequency(F),C.mangle_names(F),C.walk(new It(function(e){return!!R||(o(e)?(R=e,!0):void 0)})),R.body instanceof O&&(R.body=[m(se,R.body,{value:R.body})]);var w=Fn();return I.prototype._codegen.call(R,R,w),e.args=[m(At,e,{value:R.argnames.map(function(e){return e.print_to_string()}).join(",")}),m(At,e.args[e.args.length-1],{value:w.get().replace(/^\{|\}$/g,"")})],e}catch(n){if(!(n instanceof cn))throw n;t.warn("Error parsing code passed to new Function [{file}:{line},{col}]",e.args[e.args.length-1].start),t.warn(n.toString())}}var x=a&&i.body;x instanceof O?x=m(se,x,{value:x}):x&&(x=x[0]);var k=a&&!i.is_generator&&!i.async,L=t.option("inline")&&!e.is_expr_pure(t);if(L&&x instanceof se&&k&&(!(K=x.value)||K.is_constant_expression())){K=K?K.clone(!0):m(Ot,e);var V=e.args.concat(K);return D(e,V).optimize(t)}if(k){var P,K,U,G,H=-1;if(L&&r&&!i.uses_arguments&&!i.pinned()&&!(t.parent()instanceof qe)&&!(i.name&&i instanceof Q)&&(!(t.find_parent(j)instanceof J)||0==i.argnames.length&&(i.body instanceof O||1==i.body.length))&&(K=function(e){var n=i.body instanceof O?[i.body]:i.body,r=n.length;if(t.option("inline")<3)return 1==r&&W(e);e=null;for(var o=0;o=0;){var s=o.definitions[a].name;if(s instanceof te||e[s.name]||pt(s.name)||U.var_names()[s.name])return!1;G&&G.push(s.definition())}}}return!0}(e,r>=3&&n)||!function(e,t){for(var n=0,r=i.argnames.length;n=2&&n)||G&&0!=G.length&&en(i,G))}()&&!(U instanceof qe))return i._squeezed=!0,D(e,function(){var n=[],r=[];(function(t,n){for(var r=i.argnames.length,o=e.args.length;--o>=r;)n.push(e.args[o]);for(o=r;--o>=0;){var a=i.argnames[o],s=e.args[o];if(a.__unused||!a.name||U.var_names()[a.name])s&&n.push(s);else{var u=m(et,a,a);a.definition().orig.push(u),!s&&G&&(s=m(Ot,e)),Z(t,n,u,s)}}t.reverse(),n.reverse()})(n,r),function(e,t){for(var n=t.length,r=0,o=i.body.length;r0&&bt(r[o],t);)o--;o0)return(n=this.clone()).right=D(this.right,t.slice(o)),(t=t.slice(0,o)).push(n),D(this,t).optimize(e)}}return this});var Zt=g("== === != !== * & | ^");function Qt(e,t){for(var n,i=0;n=e.parent(i);i++)if(n instanceof j){var r=n.name;if(r&&r.definition()===t)break}return n}function Jt(e,t){return e instanceof _t||e.TYPE===t.TYPE}function en(e,t){var n=!1,r=new It(function(e){return!!n||(e instanceof _t&&i(e.definition(),t)?n=!0:void 0)}),o=new It(function(t){if(n)return!0;if(t instanceof Y&&t!==e){var i=o.parent();if(i instanceof Fe&&i.expression===t)return;return t.walk(r),!0}});return e.walk(o),n}e(Ve,function(e,t){function n(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function i(t){if(n()){t&&(e.operator=t);var i=e.left;e.left=e.right,e.right=i}}if(Zt(e.operator)&&e.right.is_constant()&&!e.left.is_constant()&&(e.left instanceof Ve&&hn[e.left.operator]>=hn[e.operator]||i()),e=e.lift_sequences(t),t.option("comparisons"))switch(e.operator){case"===":case"!==":var r=!0;(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right))&&(e.operator=e.operator.substr(0,2));case"==":case"!=":if(!r&&bt(e.left,t))e.left=m(yt,e.left);else if(t.option("typeofs")&&e.left instanceof At&&"undefined"==e.left.value&&e.right instanceof Ie&&"typeof"==e.right.operator){var o=e.right.expression;(o instanceof _t?!o.is_declared(t):o instanceof Ne&&t.option("ie8"))||(e.right=o,e.left=m(Ot,e.left).optimize(t),2==e.operator.length&&(e.operator+="="))}else if(e.left instanceof _t&&e.right instanceof _t&&e.left.definition()===e.right.definition()&&((u=e.left.fixed_value())instanceof Ue||u instanceof j||u instanceof Ge||u instanceof qe))return m("="==e.operator[0]?wt:Nt,e);break;case"&&":case"||":var a=e.left;if(a.operator==e.operator&&(a=a.right),a instanceof Ve&&a.operator==("&&"==e.operator?"!==":"===")&&e.right instanceof Ve&&a.operator==e.right.operator&&(bt(a.left,t)&&e.right.left instanceof yt||a.left instanceof yt&&bt(e.right.left,t))&&!a.right.has_side_effects(t)&&a.right.equivalent_to(e.right.right)){var s=m(Ve,e,{operator:a.operator.slice(0,-1),left:m(yt,e),right:a.right});return a!==e.left&&(s=m(Ve,e,{operator:e.operator,left:e.left.left,right:s})),s}}var u;if("+"==e.operator&&t.in_boolean_context()){var c=e.left.evaluate(t),l=e.right.evaluate(t);if(c&&"string"==typeof c)return t.warn("+ in boolean context always true [{file}:{line},{col}]",e.start),D(e,[e.right,m(wt,e)]).optimize(t);if(l&&"string"==typeof l)return t.warn("+ in boolean context always true [{file}:{line},{col}]",e.start),D(e,[e.left,m(wt,e)]).optimize(t)}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof Ve)||t.parent()instanceof Be){var f=m(Ie,e,{operator:"!",expression:e.negate(t,T(t))});e=Kt(t,e,f)}if(t.option("unsafe_comps"))switch(e.operator){case"<":i(">");break;case"<=":i(">=")}}if("+"==e.operator){if(e.right instanceof At&&""==e.right.getValue()&&e.left.is_string(t))return e.left;if(e.left instanceof At&&""==e.left.getValue()&&e.right.is_string(t))return e.right;if(e.left instanceof Ve&&"+"==e.left.operator&&e.left.left instanceof At&&""==e.left.left.getValue()&&e.right.is_string(t))return e.left=e.left.right,e.transform(t)}if(t.option("evaluate")){switch(e.operator){case"&&":if(!(c=!!e.left.truthy||!e.left.falsy&&e.left.evaluate(t)))return t.warn("Condition left of && always false [{file}:{line},{col}]",e.start),C(t.parent(),t.self(),e.left).optimize(t);if(!(c instanceof O))return t.warn("Condition left of && always true [{file}:{line},{col}]",e.start),D(e,[e.left,e.right]).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof O)){if("&&"==(p=t.parent()).operator&&p.left===t.self()||t.in_boolean_context())return t.warn("Dropping side-effect-free && [{file}:{line},{col}]",e.start),e.left.optimize(t)}}else{if(t.in_boolean_context())return t.warn("Boolean && always false [{file}:{line},{col}]",e.start),D(e,[e.left,m(Nt,e)]).optimize(t);e.falsy=!0}if("||"==e.left.operator)if(!(d=e.left.right.evaluate(t)))return m(Pe,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t);break;case"||":var p,d;if(!(c=!!e.left.truthy||!e.left.falsy&&e.left.evaluate(t)))return t.warn("Condition left of || always false [{file}:{line},{col}]",e.start),D(e,[e.left,e.right]).optimize(t);if(!(c instanceof O))return t.warn("Condition left of || always true [{file}:{line},{col}]",e.start),C(t.parent(),t.self(),e.left).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof O)){if(t.in_boolean_context())return t.warn("Boolean || always true [{file}:{line},{col}]",e.start),D(e,[e.left,m(wt,e)]).optimize(t);e.truthy=!0}}else if("||"==(p=t.parent()).operator&&p.left===t.self()||t.in_boolean_context())return t.warn("Dropping side-effect-free || [{file}:{line},{col}]",e.start),e.left.optimize(t);if("&&"==e.left.operator)if((d=e.left.right.evaluate(t))&&!(d instanceof O))return m(Pe,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t)}var _=!0;switch(e.operator){case"+":if(e.left instanceof vt&&e.right instanceof Ve&&"+"==e.right.operator&&e.right.left instanceof vt&&e.right.is_string(t)&&(e=m(Ve,e,{operator:"+",left:m(At,e.left,{value:""+e.left.getValue()+e.right.left.getValue(),start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof vt&&e.left instanceof Ve&&"+"==e.left.operator&&e.left.right instanceof vt&&e.left.is_string(t)&&(e=m(Ve,e,{operator:"+",left:e.left.left,right:m(At,e.right,{value:""+e.left.right.getValue()+e.right.getValue(),start:e.left.right.start,end:e.right.end})})),e.left instanceof Ve&&"+"==e.left.operator&&e.left.is_string(t)&&e.left.right instanceof vt&&e.right instanceof Ve&&"+"==e.right.operator&&e.right.left instanceof vt&&e.right.is_string(t)&&(e=m(Ve,e,{operator:"+",left:m(Ve,e.left,{operator:"+",left:e.left.left,right:m(At,e.left.right,{value:""+e.left.right.getValue()+e.right.left.getValue(),start:e.left.right.start,end:e.right.left.end})}),right:e.right.right})),e.right instanceof Ie&&"-"==e.right.operator&&e.left.is_number(t)){e=m(Ve,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof Ie&&"-"==e.left.operator&&n()&&e.right.is_number(t)){e=m(Ve,e,{operator:"-",left:e.right,right:e.left.expression});break}case"*":_=t.option("unsafe_math");case"&":case"|":case"^":if(e.left.is_number(t)&&e.right.is_number(t)&&n()&&!(e.left instanceof Ve&&e.left.operator!=e.operator&&hn[e.left.operator]>=hn[e.operator])){var E=m(Ve,e,{operator:e.operator,left:e.right,right:e.left});e=e.right instanceof vt&&!(e.left instanceof vt)?Kt(t,E,e):Kt(t,e,E)}_&&e.is_number(t)&&(e.right instanceof Ve&&e.right.operator==e.operator&&(e=m(Ve,e,{operator:e.operator,left:m(Ve,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof vt&&e.left instanceof Ve&&e.left.operator==e.operator&&(e.left.left instanceof vt?e=m(Ve,e,{operator:e.operator,left:m(Ve,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right}):e.left.right instanceof vt&&(e=m(Ve,e,{operator:e.operator,left:m(Ve,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left}))),e.left instanceof Ve&&e.left.operator==e.operator&&e.left.right instanceof vt&&e.right instanceof Ve&&e.right.operator==e.operator&&e.right.left instanceof vt&&(e=m(Ve,e,{operator:e.operator,left:m(Ve,e.left,{operator:e.operator,left:m(Ve,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})))}}if(e.right instanceof Ve&&e.right.operator==e.operator&&(Lt(e.operator)||"+"==e.operator&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t))))return e.left=m(Ve,e.left,{operator:e.operator,left:e.left,right:e.right.left}),e.right=e.right.right,e.transform(t);var h=e.evaluate(t);return h!==e?(h=y(h,e).optimize(t),Kt(t,h,e)):e}),e(mt,function(e,t){return e}),e(_t,function(e,t){if(!t.option("ie8")&&Qe(e)&&(!e.scope.uses_with||!t.find_parent(W)))switch(e.name){case"undefined":return m(Ot,e).optimize(t);case"NaN":return m(Ct,e).optimize(t);case"Infinity":return m(Rt,e).optimize(t)}var n=t.parent();if(t.option("reduce_vars")&&Pt(e,n)!==e){var i=e.definition();if(t.top_retain&&i.global&&t.top_retain(i))return i.fixed=!1,i.should_replace=!1,i.single_use=!1,e;var r=e.fixed_value(),a=i.single_use&&!(n instanceof Fe&&n.is_expr_pure(t));if(a&&(r instanceof j||r instanceof qe))if(jt(r,t))a=!1;else if(i.scope!==e.scope&&(!t.option("reduce_funcs")&&r instanceof j||1==i.escaped||r.inlined||function(e){for(var t,n=0;t=e.parent(n++);){if(t instanceof F)return!1;if(t instanceof Ue||t instanceof Xe||t instanceof Ge)return!0}return!1}(t)))a=!1;else if(Qt(t,i))a=!1;else if((i.scope!==e.scope||i.orig[0]instanceof rt)&&"f"==(a=r.is_constant_expression(e.scope))){var s=e.scope;do{(s instanceof ee||o(s))&&(s.inlined=!0)}while(s=s.parent_scope)}if(a&&r){var u;if(r instanceof $e&&(r=m(je,r,r)),r instanceof ee&&(r._squeezed=!0,r=m(Q,r,r)),i.recursive_refs>0&&r.name instanceof ot){var c=(u=r.clone(!0)).name.definition(),l=u.variables.get(u.name.name),f=l&&l.orig[0];f instanceof st||((f=m(st,u.name,u.name)).scope=u,u.name=f,l=u.def_function(f)),u.walk(new It(function(e){e instanceof _t&&e.definition()===c&&(e.thedef=l,l.references.push(e))}))}else(u=r.optimize(t))===r&&(u=r.clone(!0));return u}if(r&&void 0===i.should_replace){var p;if(r instanceof Dt)i.orig[0]instanceof rt||!v(i.references,function(e){return i.scope===e.scope})||(p=r);else{var d=r.evaluate(t);d===r||!t.option("unsafe_regexp")&&d instanceof RegExp||(p=y(d,r))}if(p){var _,E=p.optimize(t).print_to_string().length;!function(e){var t;return e.walk(new It(function(e){if(e instanceof _t&&(t=!0),t)return!0})),t}(r)?(E=Math.min(E,r.print_to_string().length),_=function(){var e=Bt(p.optimize(t),r);return e===p||e===r?e.clone(!0):e}):_=function(){var e=p.optimize(t);return e===p?e.clone(!0):e};var h=i.name.length,D=0;t.option("unused")&&!t.exposed(i)&&(D=(h+2+E)/(i.references.length-i.assignments)),i.should_replace=E<=h+D&&_}else i.should_replace=!1}if(i.should_replace)return i.should_replace()}return e}),e(Ot,function(e,t){if(t.option("unsafe_undefined")){var n=u(t,"undefined");if(n){var i=m(_t,e,{name:"undefined",scope:n.scope,thedef:n});return i.is_undefined=!0,i}}var r=Pt(t.self(),t.parent());return r&&Jt(r,e)?e:m(Ie,e,{operator:"void",expression:m(St,e,{value:0})})}),e(Rt,function(e,t){var n=Pt(t.self(),t.parent());return n&&Jt(n,e)?e:!t.option("keep_infinity")||n&&!Jt(n,e)||u(t,"Infinity")?m(Ve,e,{operator:"/",left:m(St,e,{value:1}),right:m(St,e,{value:0})}):e}),e(Ct,function(e,t){var n=Pt(t.self(),t.parent());return n&&!Jt(n,e)||u(t,"NaN")?m(Ve,e,{operator:"/",left:m(St,e,{value:0}),right:m(St,e,{value:0})}):e});var tn=["+","-","/","*","%",">>","<<",">>>","|","^","&"],nn=["*","|","^","&"];function rn(e,t){return e instanceof _t&&(e=e.fixed_value()),!!e&&(!(e instanceof j||e instanceof qe)||t.parent()instanceof Re||!e.contains_this())}function on(e,t){return t.in_boolean_context()?Kt(t,e,D(e,[e,m(wt,e)]).optimize(t)):e}function an(e,t){if(!t.option("computed_props"))return e;if(!(e.key instanceof vt))return e;if(e.key instanceof At||e.key instanceof St){if("__proto__"===e.key.value)return e;if("constructor"==e.key.value&&t.parent()instanceof qe)return e;e.key=e instanceof Xe?e.key.value:m(at,e.key,{name:e.key.value})}return e}e(Be,function(e,t){var n;if(t.option("dead_code")&&e.left instanceof _t&&(n=e.left.definition()).scope===t.find_parent(j)){var r,o=0,a=e;do{if(r=a,(a=t.parent(o++))instanceof ae){if(s(o,a))break;if(en(n.scope,[n]))break;return"="==e.operator?e.right:(n.fixed=!1,m(Ve,e,{operator:e.operator.slice(0,-1),left:e.left,right:e.right}).optimize(t))}}while(a instanceof Ve&&a.right===r||a instanceof Me&&a.tail_node()===r)}return"="==(e=e.lift_sequences(t)).operator&&e.left instanceof _t&&e.right instanceof Ve&&(e.right.left instanceof _t&&e.right.left.name==e.left.name&&i(e.right.operator,tn)?(e.operator=e.right.operator+"=",e.right=e.right.right):e.right.right instanceof _t&&e.right.right.name==e.left.name&&i(e.right.operator,nn)&&!e.right.left.has_side_effects(t)&&(e.operator=e.right.operator+"=",e.right=e.right.left)),e;function s(n,i){var r=e.right;e.right=m(yt,r);var o=i.may_throw(t);e.right=r;for(var a,s=e.left.definition().scope;(a=t.parent(n++))!==s;)if(a instanceof he){if(a.bfinally)return!0;if(o&&a.bcatch)return!0}}}),e(Ke,function(e,t){if(!t.option("evaluate"))return e;var n=e.right.evaluate(t);return void 0===n?e=e.left:n!==e.right&&(n=y(n,e.right),e.right=Bt(n,e.right)),e}),e(Pe,function(e,t){if(!t.option("conditionals"))return e;if(e.condition instanceof Me){var n=e.condition.expressions.slice();return e.condition=n.pop(),n.push(e),D(e,n)}var i=e.condition.evaluate(t);if(i!==e.condition)return i?(t.warn("Condition always true [{file}:{line},{col}]",e.start),C(t.parent(),t.self(),e.consequent)):(t.warn("Condition always false [{file}:{line},{col}]",e.start),C(t.parent(),t.self(),e.alternative));var r=i.negate(t,T(t));Kt(t,i,r)===r&&(e=m(Pe,e,{condition:r,consequent:e.alternative,alternative:e.consequent}));var o,a=e.condition,s=e.consequent,u=e.alternative;if(a instanceof _t&&s instanceof _t&&a.definition()===s.definition())return m(Ve,e,{operator:"||",left:a,right:u});if(s instanceof Be&&u instanceof Be&&s.operator==u.operator&&s.left.equivalent_to(u.left)&&(!e.condition.has_side_effects(t)||"="==s.operator&&!s.left.has_side_effects(t)))return m(Be,e,{operator:s.operator,left:s.left,right:m(Pe,e,{condition:e.condition,consequent:s.right,alternative:u.right})});if(s instanceof Fe&&u.TYPE===s.TYPE&&s.args.length>0&&s.args.length==u.args.length&&s.expression.equivalent_to(u.expression)&&!e.condition.has_side_effects(t)&&!s.expression.has_side_effects(t)&&"number"==typeof(o=function(){for(var e=s.args,t=u.args,n=0,i=e.length;n1)&&(p=null)}else if(!p&&!t.option("keep_fargs")&&s=n.argnames.length;)p=m(rt,n,{name:n.make_var_name("argument_"+n.argnames.length),scope:n}),n.argnames.push(p),n.enclosed.push(n.def_variable(p));if(p){var _=m(_t,e,p);return _.reference({}),delete p.__unused,_}}if(Pt(e,t.parent()))return e;if(o!==r){var E=e.flatten_object(a,t);E&&(i=e.expression=E.expression,r=e.property=E.property)}if(t.option("properties")&&t.option("side_effects")&&r instanceof St&&i instanceof Ue){s=r.getValue();var h=i.elements,g=h[s];e:if(rn(g,t)){for(var v=!0,A=[],S=h.length;--S>s;){(T=h[S].drop_side_effect_free(t))&&(A.unshift(T),v&&T.has_side_effects(t)&&(v=!1))}if(g instanceof $)break e;for(g=g instanceof Ft?m(Ot,g):g,v||A.unshift(g);--S>=0;){var T;if((T=h[S])instanceof $)break e;(T=T.drop_side_effect_free(t))?A.unshift(T):s--}return v?(A.push(g),D(e,A).optimize(t)):m(xe,e,{expression:m(Ue,i,{elements:A}),property:m(St,r,{value:s})})}}var b=e.evaluate(t);return b!==e?Kt(t,b=y(b,e).optimize(t),e):e}),j.DEFMETHOD("contains_this",function(){var e,t=this;return t.walk(new It(function(n){return!!e||(n instanceof Dt?e=!0:n!==t&&n instanceof Y&&!(n instanceof J)||void 0)})),e}),Ne.DEFMETHOD("flatten_object",function(e,t){if(t.option("properties")){var n=t.option("unsafe_arrows")&&t.option("ecma")>=6,i=this.expression;if(i instanceof Ge)for(var r=i.properties,o=r.length;--o>=0;){var a=r[o];if(""+(a instanceof Ye?a.key.name:a.key)==e){if(!v(r,function(e){return e instanceof Xe||n&&e instanceof Ye&&!e.is_generator}))break;if(!rn(a.value,t))break;return m(xe,this,{expression:m(Ue,i,{elements:r.map(function(e){var t=e.value;t instanceof Z&&(t=m(Q,t,t));var n=e.key;return n instanceof O&&!(n instanceof at)?D(e,[n,t]):t})}),property:m(St,this,{value:o})})}}}}),e(we,function(e,t){if("arguments"!=e.property&&"caller"!=e.property||t.warn("Function.protoype.{prop} not supported [{file}:{line},{col}]",{prop:e.property,file:e.start.file,line:e.start.line,col:e.start.col}),Pt(e,t.parent()))return e;if(t.option("unsafe_proto")&&e.expression instanceof we&&"prototype"==e.expression.property){var n=e.expression.expression;if(Qe(n))switch(n.name){case"Array":e.expression=m(Ue,e.expression,{elements:[]});break;case"Function":e.expression=m(Q,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=m(St,e.expression,{value:0});break;case"Object":e.expression=m(Ge,e.expression,{properties:[]});break;case"RegExp":e.expression=m(Tt,e.expression,{value:/t/});break;case"String":e.expression=m(At,e.expression,{value:""})}}var i=e.flatten_object(e.property,t);if(i)return i.optimize(t);var r=e.evaluate(t);return r!==e?Kt(t,r=y(r,e).optimize(t),e):e}),e(Ue,on),e(Ge,on),e(Tt,on),e(se,function(e,t){return e.value&&bt(e.value,t)&&(e.value=null),e}),e(J,function(e,t){if(e.body instanceof O||(e=qt(e,t)),t.option("arrows")&&1==e.body.length&&e.body[0]instanceof se){var n=e.body[0].value;e.body=n||[]}return e}),e(Q,function(e,t){if(e=qt(e,t),t.option("unsafe_arrows")&&t.option("ecma")>=6&&!e.name&&!e.is_generator&&!e.uses_arguments&&!e.pinned()){var n=!1;if(e.walk(new It(function(e){return!!n||(e instanceof Dt?(n=!0,!0):void 0)})),!n)return m(J,e,e).optimize(t)}return e}),e(qe,function(e,t){return e}),e(kt,function(e,t){return e.expression&&!e.is_star&&bt(e.expression,t)&&(e.expression=null),e}),e(ie,function(e,t){if(!t.option("evaluate")||t.parent()instanceof ne)return e;for(var n=[],i=0;i=6&&(!(n instanceof RegExp)||n.test(e.key+""))){var i=e.key,r=e.value;if((r instanceof J&&Array.isArray(r.body)&&!r.contains_this()||r instanceof Q)&&!r.name)return m(Ye,e,{async:r.async,is_generator:r.is_generator,key:i instanceof O?i:m(at,e,{name:i}),value:m(Z,r,r),quote:e.quote})}return e}),e(te,function(e,t){if(1==t.option("pure_getters")&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!function(e){for(var t=[/^VarDef$/,/^(Const|Let|Var)$/,/^Export$/],n=0,i=0,r=t.length;n|%)([a-z0-9$_]+)/i.exec(e);if(!t)throw new Error("Can't understand property map: "+e);var n=t[1],i=t[2],r=t[3];switch(s+=",\n"+r+": ",l+=",\n"+n+": ",i){case"@":s+="M."+n+".map(from_moz)",l+="M."+r+".map(to_moz)";break;case">":s+="from_moz(M."+n+")",l+="to_moz(M."+r+")";break;case"=":s+="M."+n,l+="M."+r;break;case"%":s+="from_moz(M."+n+").body",l+="to_moz_block(M)";break;default:throw new Error("Can't understand operator in propmap: "+e)}}),s+="\n})\n}",l+="\n}\n}",s=new Function("U2","my_start_token","my_end_token","from_moz","return("+s+")")(e,r,o,u),l=new Function("to_moz","to_moz_block","to_moz_scope","return("+l+")")(f,d,_),n[t]=s,c(i,l)}n.UpdateExpression=n.UnaryExpression=function(e){return new(("prefix"in e?e.prefix:"UnaryExpression"==e.type)?Ie:Le)({start:r(e),end:o(e),operator:e.operator,expression:u(e.argument)})},n.ClassDeclaration=n.ClassExpression=function(e){return new("ClassDeclaration"===e.type?$e:je)({start:r(e),end:o(e),name:u(e.id),extends:u(e.superClass),properties:e.body.body.map(u)})},a("EmptyStatement",L),a("BlockStatement",I,"body@body"),a("IfStatement",pe,"test>condition, consequent>body, alternate>alternative"),a("LabeledStatement",P,"label>label, body>body"),a("BreakStatement",le,"label>label"),a("ContinueStatement",fe,"label>label"),a("WithStatement",W,"object>expression, body>body"),a("SwitchStatement",de,"discriminant>expression, cases@body"),a("ReturnStatement",se,"argument>value"),a("ThrowStatement",ue,"argument>value"),a("WhileStatement",G,"test>condition, body>body"),a("DoWhileStatement",U,"test>condition, body>body"),a("ForStatement",H,"init>init, test>condition, update>step, body>body"),a("ForInStatement",X,"left>init, right>object, body>body"),a("ForOfStatement",z,"left>init, right>object, body>body, await=await"),a("AwaitExpression",xt,"argument>expression"),a("YieldExpression",kt,"argument>expression, delegate=is_star"),a("DebuggerStatement",R),a("VariableDeclarator",Oe,"id>name, init>value"),a("CatchClause",De,"param>argname, body%body"),a("ThisExpression",Dt),a("Super",gt),a("BinaryExpression",Ve,"operator=operator, left>left, right>right"),a("LogicalExpression",Ve,"operator=operator, left>left, right>right"),a("AssignmentExpression",Be,"operator=operator, left>left, right>right"),a("ConditionalExpression",Pe,"test>condition, consequent>consequent, alternate>alternative"),a("NewExpression",Re,"callee>expression, arguments@args"),a("CallExpression",Fe,"callee>expression, arguments@args"),c(q,function(e){return _("Program",e)}),c($,function(e,t){return{type:p()?"RestElement":"SpreadElement",argument:f(e.expression)}}),c(ne,function(e){return{type:"TaggedTemplateExpression",tag:f(e.prefix),quasi:f(e.template_string)}}),c(ie,function(e){for(var t=[],n=[],i=0;i1)throw new Error("inline source map only works with singular input");t.sourceMap.content=(n=e[l],i=void 0,(i=/\n\/\/# sourceMappingURL=data:application\/json(;.*?)?;base64,(.*)/.exec(n))?xn(i[2]):(O.warn("inline source map not found"),null))}u=t.parse.toplevel}o&&Mn(u,o),t.wrap&&(u=u.wrap_commonjs(t.wrap)),t.enclose&&(u=u.wrap_enclose(t.enclose)),a&&(a.rename=Date.now()),a&&(a.compress=Date.now()),t.compress&&(u=new Rn(t.compress).compress(u)),a&&(a.scope=Date.now()),t.mangle&&u.figure_out_scope(t.mangle),a&&(a.mangle=Date.now()),t.mangle&&(yn.reset(),u.compute_char_frequency(t.mangle),u.mangle_names(t.mangle)),a&&(a.properties=Date.now()),t.mangle&&t.mangle.properties&&(u=wn(u,t.mangle.properties)),a&&(a.output=Date.now());var f={};if(t.output.ast&&(f.ast=u),!S(t.output,"code")||t.output.code){if(t.sourceMap&&("string"==typeof t.sourceMap.content&&(t.sourceMap.content=JSON.parse(t.sourceMap.content)),t.output.source_map=function(e){e=s(e,{file:null,root:null,orig:null,orig_line_diff:0,dest_line_diff:0});var t=new(require("source-map").SourceMapGenerator)({file:e.file,sourceRoot:e.root}),n=e.orig&&new(require("source-map").SourceMapConsumer)(e.orig);return n&&Array.isArray(e.orig.sources)&&n._sources.toArray().forEach(function(e){var i=n.sourceContentFor(e,!0);i&&t.setSourceContent(e,i)}),{add:function(i,r,o,a,s,u){if(n){var c=n.originalPositionFor({line:a,column:s});if(null===c.source)return;i=c.source,a=c.line,s=c.column,u=c.name||u}t.addMapping({generated:{line:r+e.dest_line_diff,column:o},original:{line:a+e.orig_line_diff,column:s},source:i,name:u})},get:function(){return t},toString:function(){return JSON.stringify(t.toJSON())}}}({file:t.sourceMap.filename,orig:t.sourceMap.content,root:t.sourceMap.root}),t.sourceMap.includeSources)){if(e instanceof q)throw new Error("original source content unavailable");for(var l in e)S(e,l)&&t.output.source_map.get().setSourceContent(l,e[l])}delete t.output.ast,delete t.output.code;var p=Fn(t.output);u.print(p),f.code=p.get(),t.sourceMap&&(f.map=t.output.source_map.toString(),"inline"==t.sourceMap.url?f.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+kn(f.map):t.sourceMap.url&&(f.code+="\n//# sourceMappingURL="+t.sourceMap.url))}return t.nameCache&&t.mangle&&(t.mangle.cache&&(t.nameCache.vars=Vn(t.mangle.cache)),t.mangle.properties&&t.mangle.properties.cache&&(t.nameCache.props=Vn(t.mangle.properties.cache))),a&&(a.end=Date.now(),f.timings={parse:.001*(a.rename-a.parse),rename:.001*(a.compress-a.rename),compress:.001*(a.scope-a.compress),scope:.001*(a.mangle-a.scope),mangle:.001*(a.properties-a.mangle),properties:.001*(a.output-a.properties),output:.001*(a.end-a.output),total:.001*(a.end-a.start)}),c.length&&(f.warnings=c),f}catch(e){return{error:e}}finally{O.warn_function=r}},e.parse=gn,e.push_uniq=m,e.OutputStream=Fn,e.TreeTransformer=vn,e.TreeWalker=It,e.string_template=E,e.Compressor=Rn,e.defaults=s,e.base54=yn,e.mangle_properties=wn,e.reserve_quoted_keys=Mn,e.to_ascii=xn}("undefined"!=typeof module?module.exports:Terser={}); -//# sourceMappingURL=bundle.js.map diff --git a/tools/node_modules/terser/dist/bundle.js.map b/tools/node_modules/terser/dist/bundle.js.map deleted file mode 100644 index b3c680b25383..000000000000 --- a/tools/node_modules/terser/dist/bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../tools/domprops.js","../lib/utils.js","../lib/ast.js","../lib/parse.js","../lib/transform.js","../lib/scope.js","../lib/output.js","../lib/compress.js","../lib/propmangle.js","../lib/mozilla-ast.js","../lib/minify.js","../tools/exports.js","../lib/sourcemap.js","0"],"names":["domprops","characters","str","split","member","name","array","indexOf","find_if","func","i","n","length","configure_error_stack","fn","Object","defineProperty","prototype","get","err","Error","this","message","e","stack","DefaultsError","msg","defs","defaults","args","croak","ret","HOP","merge","obj","ext","count","noop","return_false","return_true","return_this","return_null","create","constructor","MAP","a","f","backwards","top","doit","val","is_last","Last","v","AtTop","Splice","push","apply","slice","reverse","skip","Array","concat","at_top","splice","last","push_uniq","el","string_template","text","props","replace","p","remove","mergeSort","cmp","_ms","m","Math","floor","left","right","b","r","ai","bi","makePredicate","words","cats","out","j","quote","word","JSON","stringify","s","compareTo","arr","sort","cat","Function","all","predicate","Dictionary","_values","_size","prop","hasOwnProperty","call","first_in_statement","node","parent","AST_Statement","body","AST_Sequence","expressions","TYPE","expression","AST_Dot","AST_Sub","AST_Conditional","condition","AST_Binary","AST_UnaryPostfix","keep_name","keep_setting","RegExp","test","DEFNODE","type","methods","base","arguments","AST_Node","self_props","PROPS","code","proto","initialize","ctor","BASE","SUBCLASSES","CTOR","SELF_PROPS","substr","DEFMETHOD","method","exports","set","key","has","add","del","each","size","map","clone","toObject","fromObject","dict","AST_Token","_clone","deep","self","transform","TreeTransformer","$documentation","$propdoc","start","end","_walk","visitor","_visit","walk","warn_function","warn","txt","AST_Debugger","AST_Directive","value","AST_SimpleStatement","walk_body","len","clone_block_scope","block_scope","AST_Block","AST_BlockStatement","AST_EmptyStatement","AST_StatementWithBody","AST_LabeledStatement","label","def","TreeWalker","AST_LoopControl","thedef","references","AST_IterationStatement","AST_DWLoop","AST_Do","AST_While","AST_For","init","step","AST_ForIn","object","AST_ForOf","AST_With","AST_Scope","variables","functions","uses_with","uses_eval","parent_scope","enclosed","cname","get_defun_scope","is_block_scope","pinned","AST_Toplevel","globals","wrap_commonjs","wrapped_tl","parse","wrap_enclose","args_values","index","join","AST_Expansion","AST_Lambda","argnames","uses_arguments","is_generator","async","args_as_names","AST_Destructuring","all_symbols","AST_Accessor","AST_Function","AST_Arrow","AST_Defun","names","is_array","forEach","AST_Symbol","AST_PrefixedTemplateString","template_string","prefix","AST_TemplateString","segments","seg","AST_TemplateSegment","raw","AST_Jump","AST_Exit","AST_Return","AST_Throw","AST_Break","AST_Continue","AST_If","alternative","AST_Switch","AST_SwitchBranch","AST_Default","AST_Case","AST_Try","bcatch","bfinally","AST_Catch","argname","AST_Finally","AST_Definitions","definitions","AST_Var","AST_Let","AST_Const","AST_NameMapping","foreign_name","AST_Import","imported_name","imported_names","module_name","name_import","AST_Export","exported_definition","exported_value","exported_names","is_default","name_export","AST_VarDef","AST_Call","AST_New","AST_PropAccess","property","AST_Unary","operator","AST_UnaryPrefix","consequent","AST_Assign","AST_DefaultAssign","AST_Array","elements","AST_Object","properties","AST_ObjectProperty","AST_ObjectKeyVal","AST_ObjectSetter","static","AST_ObjectGetter","AST_ConciseMethod","AST_Class","extends","AST_DefClass","AST_ClassExpression","scope","AST_NewTarget","AST_SymbolDeclaration","AST_SymbolVar","AST_SymbolBlockDeclaration","AST_SymbolConst","AST_SymbolLet","AST_SymbolFunarg","AST_SymbolDefun","AST_SymbolMethod","AST_SymbolLambda","AST_SymbolDefClass","AST_SymbolClass","AST_SymbolCatch","AST_SymbolImport","AST_SymbolImportForeign","AST_Label","AST_SymbolRef","AST_SymbolExport","AST_SymbolExportForeign","AST_LabelRef","AST_This","AST_Super","AST_Constant","getValue","AST_String","AST_Number","literal","AST_RegExp","AST_Atom","AST_Null","AST_NaN","AST_Undefined","AST_Hole","AST_Infinity","AST_Boolean","AST_False","AST_True","AST_Await","AST_Yield","is_star","callback","visit","directives","descend","pop","getPrototypeOf","find_parent","x","has_directive","dir","st","loopcontrol_target","KEYWORDS","KEYWORDS_ATOM","RESERVED_WORDS","KEYWORDS_BEFORE_EXPRESSION","OPERATOR_CHARS","RE_NUM_LITERAL","RE_HEX_NUMBER","RE_OCT_NUMBER","RE_ES6_OCT_NUMBER","RE_BIN_NUMBER","RE_DEC_NUMBER","OPERATORS","WHITESPACE_CHARS","NEWLINE_CHARS","PUNC_AFTER_EXPRESSION","PUNC_BEFORE_EXPRESSION","PUNC_CHARS","UNICODE","ID_Start","ID_Continue","get_full_char","pos","char","charAt","is_surrogate_pair_head","next","is_surrogate_pair_tail","prev","charCodeAt","is_digit","is_identifier","is_identifier_start","ch","is_identifier_char","is_identifier_string","JS_Parse_Error","filename","line","col","js_error","is_token","token","EX_EOF","tokenizer","$TEXT","html5_comments","shebang","S","tokpos","tokline","tokcol","newline_before","regex_allowed","brace_counter","template_braces","comments_before","directive_stack","peek","signal_eof","in_string","forward","looking_at","find","what","start_token","prev_was_dot","previous_token","is_comment","UNARY_POSTFIX","endline","endcol","endpos","nlb","file","substring","comments_after","skip_whitespace","parse_error","read_num","has_e","after_e","has_x","has_dot","num","pred","read_while","next_token","valid","parseInt","parseFloat","parse_js_number","isNaN","read_escaped_char","strict_hex","String","fromCharCode","hex_bytes","result","strict_octal","read_octal_escape_sequence","digit","read_string","with_eof_error","quote_char","tok","read_template_characters","begin","content","tmp","skip_line_comment","find_eol","skip_multiline_comment","surrogates","get_full_char_length","read_name","escaped","read_escaped_identifier_char","read_regexp","source","prev_backslash","in_class","mods","regexp","raw_source","read_operator","grow","op","bigger","handle_slash","eof_error","cont","ex","force_regexp","context","nc","add_directive","directive","undefined","push_directives_stack","pop_directives_stack","UNARY_PREFIX","ASSIGNMENT","PRECEDENCE","ATOMIC_START_TOKEN","options","bare_returns","ecma","module","strict","toplevel","input","peeked","in_function","in_async","in_generator","in_directives","in_loop","labels","is","ctx","token_error","unexpected","expect_token","expect","punc","has_newline_before","comment","can_insert_semicolon","is_in_generator","is_in_async","semicolon","optional","parenthesised","exp","embed_tokens","parser","expr","handle_regexp","statement","is_export_default","is_for_body","is_if_body","stat","simple_statement","function_","as_symbol","map_names","mod_str","import_","l","ref","labeled_statement","block_","break_cont","for_await_error","await_tok","var_","let_","const_","is_in","is_of","is_assignable","to_destructuring","for_in","is_await","lhs","await","for_of","regular_for","for_","class_","cond","belse","if_","switch_body_","parameter","try_","export_","ldef","arrow_function","is_async","_function_body","is_generator_property","in_statement","track_used_binding_identifiers","is_parameter","parameters","duplicate","default_assignment","spread","strict_mode","tracker","add_parameter","check_strict","mark_default_assignment","mark_spread","mark_strict_mode","is_strict","used_parameters","symbol_type","param","expand","binding_element","expand_token","first","is_expand","first_token","property_token","as_property_name","block","generator","loop","current_generator","current_async","params","_verify_symbol","cur","branch","vardefs","no_in","kind","sym_type","as_atom_node","_make_symbol","to_fun_args","_","__","default_seen_above","insert_default","default_value","expr_atom","allow_calls","allow_arrows","subscripts","newexp","expr_list","mark_pure","new_","exprs","maybe_sequence","spread_token","invalid_sequence","trailing_comma","params_or_seq_","unshift","comments_before_length","array_","object_or_destructuring_","cls","tagged","closing","allow_trailing_comma","allow_empty","create_accessor","concise","concise_method_or_getset","KindOfClass","class_name","extends_","is_class","get_ast","is_static","map_name","is_import","make_symbol","foreign_type","map_nameAsterisk","sym","noerror","comments","pure","call_args","maybe_unary","make_unary","expr_op","min_prec","prec","maybe_conditional","expr_ops","yes","maybe_assign","star","has_expression","_yield_expression","commas","before","after","SymbolDef","orig","eliminated","replaced","global","export","mangled_name","undeclared","id","next_id","tw","in_list","y","do_list","list","MASK_EXPORT_DONT_MANGLE","MASK_EXPORT_WANT_MANGLE","next_mangled","base54","reserved","unmangleable","eval","keep_fnames","keep_classnames","mangle","cache","ie8","redefined","defun","safari10","in_destructuring","for_scopes","save_scope","init_scope_vars","save_defun","save_labels","def_function","mark_export","def_variable","destructuring","mark_enclosed","find_variable","reference","level","exported","def_global","definition","refs","g","d","symbol","mangled_names","tricky_def","tricky_name","isArray","_default_mangler_options","lname","to_mangle","collect","save_nesting","avoid","to_avoid","add_def","reset","find_colliding_names","rename","next_name","print","stream","force_parens","_print","consider","skip_string","tail_node","print_to_string","chars","frequency","leading","digits","compare","delta","EXPECT_DIRECTIVE","is_some_comments","OutputStream","readonly","ascii_only","beautify","braces","indent_level","indent_start","inline_script","keep_quoted_props","max_line_len","preamble","quote_keys","quote_style","semicolons","shorthand","source_map","webkit","width","wrap_iife","comment_filter","regex_pos","lastIndexOf","indentation","current_col","current_line","current_pos","OUTPUT","to_utf8","identifier","toString","encode_string","dq","sq","quote_single","quote_double","make_string","make_indent","back","repeat_string","mapping_token","mapping_name","has_parens","might_need_space","might_need_semicolon","might_add_newline","need_newline_indented","need_space","newline_insert","mappings","do_add_mapping","mapping","cline","ccol","ensure_line_len","requireSemicolonChars","indent","space","half","with_indent","next_indent","save_indentation","newline","force_semicolon","has_nlb","current_width","should_break","comma","colon","print_name","make_name","print_string","escape_directive","encoded","print_template_string_chars","with_block","with_parens","with_square","add_mapping","option","opt","prepend_comments","_dumped","shift","filter","last_nlb","c","append_comments","tail","insert","push_node","pop_node","Compressor","false_by_default","arrows","booleans","booleans_as_integers","collapse_vars","comparisons","computed_props","conditionals","dead_code","drop_console","drop_debugger","evaluate","global_defs","hoist_funs","hoist_props","hoist_vars","if_return","inline","join_vars","keep_fargs","keep_infinity","loops","negate_iife","passes","pure_getters","pure_funcs","reduce_funcs","reduce_vars","sequences","side_effects","switches","top_retain","typeofs","unsafe","unsafe_arrows","unsafe_comps","unsafe_Function","unsafe_math","unsafe_methods","unsafe_proto","unsafe_regexp","unsafe_undefined","unused","warnings","funcs","vars","sequences_limit","warnings_produced","reserve_quoted_keys","ast","addStrings","mangle_properties","builtins","debug","keep_quoted","only_cache","regex","objects","global_ref","new_global","Number","Boolean","Date","Symbol","ArrayBuffer","DataView","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","EvalError","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","isFinite","Map","Promise","Proxy","RangeError","ReferenceError","Reflect","Set","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakSet","getOwnPropertyNames","find_builtins","debug_name_suffix","names_to_mangle","root","mangleStrings","can_mangle","should_mangle","mangled","debug_mangled","DEFPRINT","nodetype","in_directive","active_scope","use_asm","PARENS","display_body","is_toplevel","output","allow_directives","stmt","print_braced_empty","print_braced","parenthesize_for_noin","noin","parens","print_property_name","make_num","force_statement","make_block","need_constructor_parens","toLowerCase","exec","best","best_of","DEFMAP","_codegen","add_source_map","needs_parens","po","pp","so","sp","p1","_do_print_body","nokeyword","arg","_do_print","tag","parenthesize_tag","is_tagged","make_then","get_name","allowShortHand","_print_getter_setter","exposed","in_boolean_context","compress","resolve_defines","process_expression","min_count","stopping","pass","figure_out_scope","reset_opt_flags","info","clear_warnings","_squeezed","was_scope","hoist_properties","hoist_declarations","optimize","drop_unused","OPT","optimizer","compressor","_optimized","read_property","get_value","make_node_from_constant","fixed_value","is_modified","immutable","is_lhs","is_expr_pure","contains_this","is_func_expr","is_lhs_read_only","is_immutable","is_ref_of","make_node","make_sequence","reduce","merge_sequence","maintain_this_binding","as_statement_array","thing","is_empty","can_be_evicted_from_block","loop_body","is_iife_call","is_undeclared_ref","tt","drop_side_effect_free","reset_def","assignments","chained","direct_access","fixed","recursive_refs","should_replace","single_use","reset_variables","safe_ids","mark","loop_ids","reset_block_variables","safe","safe_to_read","safe_to_assign","mark_escaped","depth","is_constant","is_constant_expression","lazy_op","suppressor","mark_def_node","inlined","save_ids","mark_func_expr","iife","eq","saved_loop","has_break_or_continue","recursive_ref","ref_once","_top","global_names","unary_bool","binary_bool","identifier_atom","is_identifier_atom","tighten_body","statements","in_try","find_loop_scope_try","CHANGED","max_iter","eliminate_spurious_blocks","eliminate_dead_code","handle_if_return","sequencesize","sequencesize_2","join_consecutive_vars","collapse","candidates","stat_index","scanner","abort","hit","hit_stack","hit_index","handle_custom_scan_order","stop_after","find_stop","write_only","lvalues","equivalent_to","replace_all","is_declared","stop_if_hit","lhs_local","can_replace","value_def","candidate","funarg","may_modify","may_throw_on_access","may_throw","has_side_effects","side_effects_external","multi_replacer","extract_args","extract_candidates","get_lhs","get_lvalues","is_lhs_local","value_has_side_effects","replace_all_symbols","remove_candidate","has_overlapping_symbol","fn_strict","found","scan_this","referenced","var_def","mangleable_var","get_rvalue","min","seen_dirs","multiple_if_returns","has_multiple_if_returns","in_lambda","next_index","ab","can_merge_flow","aborts","negate","as_statement_array_with_return","extract_functions","prev_index","lct","declarations_only","has_quit","extract_declarations_from_unreachable_code","seq","push_seq","to_simple_statement","decls","cons_seq","alt","join_object_assignments","defn","trimmed","diff","extract_object_assignments","target","remove_initializers","is_undefined","_dot_throw","is_boolean","unary","binary","is_number","is_string","unary_side_effects","best_of_expression","ast1","ast2","convert_to_predicate","_find_defs","child","suffix","defines","to_node","object_fns","native_fns","static_fns","_eval","unaryPrefix","element","non_converting_unary","non_converting_binary","pow","global_objs","static_values","aa","first_arg","basic_negation","negated","global_pure_fns","fns","any","is_call_pure","all_refs_local","scope_def","block_aborts","opt_AST_Lambda","retain_top_func","drop_funcs","drop_vars","assign_as_unused","in_use","in_use_ids","fixed_ids","var_defs_by_id","initializations","destructuring_value","node_def","in_export","destructuring_cache","scan_ref_scoped","trim","__unused","unreferenced","template","drop_block","head","is_destructure","var_defs","assign","dirs","hoisted","vars_found","var_decl","to_assignments","var_names","_var_names","defs_by_id","make_sym","new_var","make_var_name","nodes","changed","values","if_break_in_loop","is_break","drop_it","rest","self_condition_length","negated_length","negated_is_best","default_branch","exact_match","decl","eliminate_branch","default_index","has_break","varDef","simple_args","is_func","EXIT","separator","consts","fun","comp","compute_char_frequency","mangle_names","is_regular_func","can_inline","return_value","can_flatten_body","block_scoped","variable","safe_to_inject","can_inject_vars","can_inject_args","is_reachable","can_inject_symbols","append_var","flatten_args","lines","flatten_vars","flatten_fn","ev","trim_right_for_undefined","lift_sequences","commutativeOperators","is_atomic","reachable","find_ref","scan_scope","reversible","is_strict_comparison","combined","ll","rr","truthy","falsy","lr","associative","reversed","within_array_or_object_literal","defun_def","lambda_def","value_length","has_symbol_ref","name_length","overhead","undef","ASSIGN_OPS","ASSIGN_OPS_COMMUTATIVE","safe_to_flatten","literals_in_boolean_context","lift_key","evaluateRight","arg_index","single_arg_diff","in_bool","is_true","is_false","booleanize","OPT_ARGUMENTS","sub","flatten_object","retValue","FLATTEN","flatten","k","has_special_symbol","segment","arrow","ancestors","is_destructuring_export_decl","keep","elem","should_retain","normalize_directives","MOZ_TO_ME","Program","M","my_start_token","my_end_token","from_moz","ArrayPattern","elm","ObjectPattern","AssignmentPattern","SpreadElement","argument","RestElement","TemplateElement","cooked","TemplateLiteral","quasis","TaggedTemplateExpression","quasi","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression","ExpressionStatement","TryStatement","handlers","handler","guardedHandlers","finalizer","Property","computed","MethodDefinition","ArrayExpression","ObjectExpression","SequenceExpression","MemberExpression","SwitchCase","VariableDeclaration","declarations","ImportDeclaration","specifiers","specifier","imported","local","ExportAllDeclaration","ExportNamedDeclaration","declaration","ExportDefaultDeclaration","Literal","rx","pattern","flags","MetaProperty","meta","Identifier","FROM_MOZ_STACK","raw_token","moznode","loc","range","column","moztype","mytype","propmap","moz_to_me","me_to_moz","moz","how","my","to_moz","to_moz_block","to_moz_scope","def_to_moz","UpdateExpression","UnaryExpression","ClassDeclaration","ClassExpression","superClass","to_moz_in_destructuring","guard","name_mapping","isComputed","string_or_num","match","to_mozilla_ast","mynode","from_mozilla_ast","save_stack","TO_MOZ_STACK","to_ascii","atob","b64","Buffer","from","Errror","to_base64","btoa","set_shorthand","keys","init_cache","to_json","files","quoted_props","timings","enclose","nameCache","sourceMap","wrap","now","includeSources","url","warning","orig_line_diff","dest_line_diff","require","SourceMapGenerator","sourceRoot","orig_map","SourceMapConsumer","sources","_sources","toArray","sourceContent","sourceContentFor","setSourceContent","gen_line","gen_col","orig_line","orig_col","originalPositionFor","addMapping","generated","original","toJSON","SourceMap","total","error"],"mappings":"aAAA,IAAIA,EAAW,CACX,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,SACA,aACA,YACA,SACA,oBACA,iBACA,kBACA,WACA,2BACA,2BACA,uBACA,UACA,QACA,aACA,WACA,SACA,WACA,0BACA,eACA,uBACA,mBACA,iBACA,YACA,oBACA,eACA,iBACA,qBACA,mBACA,6BACA,QACA,cACA,OACA,QACA,cACA,wBACA,eACA,uBACA,gBACA,YACA,aACA,uBACA,mBACA,yBACA,OACA,yBACA,WACA,QACA,cACA,kBACA,gBACA,iBACA,uBACA,qBACA,kBACA,gBACA,YACA,OACA,OACA,eACA,YACA,YACA,YACA,OACA,wBACA,iBACA,cACA,eACA,OACA,oBACA,UACA,WACA,iBACA,kBACA,oBACA,mBACA,OACA,YACA,UACA,kBACA,MACA,eACA,qBACA,SACA,eACA,WACA,gBACA,QACA,SACA,UACA,oBACA,mBACA,oBACA,kBACA,eACA,iBACA,gCACA,gCACA,gCACA,+BACA,6BACA,aACA,iBACA,iBACA,iBACA,qBACA,eACA,qBACA,MACA,iBACA,iBACA,mBACA,sBACA,kBACA,2BACA,kBACA,gBACA,kBACA,mBACA,eACA,qBACA,mBACA,cACA,oBACA,UACA,cACA,sBACA,eACA,gBACA,kBACA,iBACA,WACA,eACA,0BACA,mBACA,kBACA,WACA,SACA,cACA,aACA,UACA,gBACA,UACA,UACA,kBACA,wBACA,sBACA,oBACA,yBACA,uBACA,wBACA,oBACA,qBACA,uBACA,sBACA,mBACA,WACA,SACA,YACA,SACA,cACA,UACA,aACA,eACA,SACA,SACA,aACA,SACA,iBACA,kBACA,sBACA,SACA,SACA,UACA,WACA,eACA,aACA,eACA,cACA,cACA,cACA,QACA,YACA,cACA,aACA,aACA,aACA,WACA,YACA,YACA,aACA,gBACA,kBACA,iBACA,iBACA,iBACA,cACA,UACA,iBACA,SACA,WACA,WACA,SACA,YACA,iBACA,kBACA,wBACA,SACA,KACA,iBACA,gBACA,2BACA,gBACA,oBACA,sBACA,gBACA,aACA,iBACA,YACA,iBACA,aACA,WACA,eACA,UACA,mBACA,UACA,cACA,gBACA,UACA,SACA,YACA,cACA,eACA,iBACA,WACA,WACA,OACA,YACA,gBACA,mBACA,aACA,mBACA,oBACA,kBACA,oBACA,aACA,cACA,gBACA,2BACA,aACA,kBACA,iBACA,iBACA,kBACA,eACA,WACA,uBACA,SACA,yBACA,gBACA,iCACA,6BACA,iCACA,8BACA,4CACA,8BACA,qBACA,YACA,WACA,eACA,oBACA,sBACA,YACA,oBACA,YACA,WACA,mBACA,UACA,UACA,cACA,kBACA,aACA,qBACA,uBACA,gBACA,eACA,eACA,sBACA,iBACA,iBACA,kBACA,wBACA,+BACA,uBACA,4BACA,8BACA,0BACA,yBACA,0BACA,2BACA,yBACA,4BACA,wBACA,0BACA,0BACA,yBACA,4BACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,gBACA,aACA,aACA,eACA,mBACA,kBACA,YACA,cACA,WACA,mBACA,oBACA,oBACA,oBACA,WACA,gBACA,mBACA,oBACA,eACA,uBACA,6BACA,qBACA,eACA,eACA,sBACA,iBACA,iBACA,eACA,cACA,WACA,iBACA,gBACA,gBACA,gBACA,sBACA,cACA,WACA,cACA,aACA,eACA,gBACA,eACA,gBACA,qBACA,iBACA,eACA,WACA,YACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,YACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,YACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,YACA,YACA,YACA,YACA,YACA,YACA,eACA,eACA,WACA,sBACA,WACA,gBACA,eACA,cACA,cACA,mBACA,cACA,sBACA,WACA,gBACA,WACA,eACA,WACA,cACA,eACA,WACA,cACA,kBACA,mBACA,WACA,cACA,oBACA,kBACA,WACA,oBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,kBACA,WACA,eACA,iBACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,mBACA,mBACA,oBACA,kBACA,sBACA,4BACA,oBACA,WACA,aACA,kBACA,gBACA,mBACA,iBACA,eACA,iBACA,gBACA,cACA,cACA,cACA,eACA,qBACA,oBACA,oBACA,WACA,uBACA,eACA,WACA,cACA,gBACA,eACA,WACA,qBACA,gBACA,mBACA,mBACA,eACA,eACA,eACA,eACA,kBACA,WACA,aACA,eACA,WACA,oBACA,cACA,iBACA,YACA,WACA,qBACA,qBACA,mBACA,WACA,aACA,gBACA,oBACA,uBACA,sBACA,sBACA,sBACA,yBACA,uBACA,sBACA,uBACA,sBACA,wBACA,0BACA,yBACA,4BACA,yBACA,4BACA,sBACA,qBACA,qBACA,qBACA,uBACA,wBACA,WACA,6BACA,iCACA,kCACA,kCACA,8BACA,mCACA,4BACA,2BACA,2BACA,4BACA,2BACA,2BACA,mCACA,kCACA,6BACA,6BACA,6BACA,2BACA,qBACA,qBACA,6BACA,wBACA,qBACA,0BACA,qBACA,kCACA,2BACA,yBACA,mBACA,sBACA,0BACA,gCACA,qBACA,oBACA,4BACA,wBACA,0BACA,oBACA,sBACA,sBACA,yBACA,0BACA,wBACA,wBACA,2BACA,8BACA,qBACA,mBACA,sBACA,0BACA,wBACA,0BACA,0BACA,wBACA,oCACA,kCACA,iCACA,wBACA,wBACA,wBACA,wBACA,wBACA,wBACA,wBACA,wBACA,wBACA,wBACA,yBACA,yBACA,yBACA,yBACA,yBACA,yBACA,2BACA,wBACA,qBACA,6BACA,uBACA,wBACA,qBACA,wBACA,wBACA,0BACA,oCACA,kCACA,sBACA,4BACA,yBACA,oBACA,qBACA,4BACA,qBACA,yBACA,uBACA,sBACA,sBACA,yBACA,2BACA,0BACA,oBACA,wBACA,uBACA,sBACA,4BACA,6BACA,0BACA,+BACA,4BACA,4BACA,qBACA,6BACA,6BACA,4BACA,0BACA,uBACA,qBACA,qBACA,sBACA,6BACA,wBACA,sBACA,qBACA,yBACA,wBACA,wBACA,0BACA,yBACA,qBACA,sBACA,yBACA,2BACA,uBACA,wBACA,wBACA,wBACA,oBACA,4BACA,sBACA,qBACA,wBACA,wBACA,6BACA,qBACA,qBACA,oBACA,qBACA,uBACA,wBACA,yBACA,WACA,WACA,cACA,OACA,YACA,cACA,WACA,YACA,YACA,eACA,cACA,eACA,mBACA,uBACA,WACA,OACA,iBACA,YACA,sBACA,4BACA,mBACA,oBACA,yBACA,uBACA,gBACA,2BACA,WACA,mBACA,eACA,YACA,yBACA,IACA,uBACA,+BACA,eACA,QACA,eACA,QACA,aACA,eACA,cACA,wBACA,UACA,QACA,aACA,QACA,uBACA,UACA,eACA,SACA,kBACA,QACA,aACA,YACA,QACA,iBACA,cACA,cACA,WACA,UACA,UACA,gBACA,mBACA,gBACA,cACA,iBACA,0BACA,QACA,aACA,aACA,aACA,aACA,aACA,aACA,QACA,iBACA,2BACA,kBACA,sCACA,cACA,qCACA,qCACA,+CACA,uCACA,sBACA,uBACA,oCACA,oCACA,4CACA,0BACA,QACA,iBACA,aACA,WACA,wBACA,gBACA,OACA,YACA,OACA,YACA,WACA,aACA,aACA,eACA,eACA,aACA,WACA,WACA,WACA,uBACA,SACA,UACA,aACA,WACA,UACA,gBACA,eACA,eACA,oBACA,mBACA,mBACA,gBACA,eACA,mBACA,SACA,wBACA,WACA,YACA,aACA,WACA,aACA,kBACA,OACA,oBACA,oBACA,oBACA,kBACA,mBACA,gBACA,kBACA,sBACA,wBACA,kBACA,oBACA,oBACA,iBACA,qBACA,qBACA,mBACA,kBACA,sBACA,qBACA,oBACA,uBACA,iBACA,eACA,cACA,mBACA,sBACA,kBACA,6BACA,kBACA,mBACA,sBACA,gBACA,kBACA,qBACA,kBACA,oBACA,mBACA,mBACA,qBACA,oBACA,gBACA,mBACA,oBACA,kBACA,iBACA,qBACA,mBACA,kBACA,sBACA,kBACA,mBACA,iBACA,mBACA,oBACA,sBACA,oBACA,wBACA,oBACA,uBACA,mBACA,qBACA,iBACA,sBACA,2BACA,mBACA,oBACA,oBACA,oBACA,oBACA,kBACA,mBACA,0BACA,uBACA,sBACA,mBACA,sBACA,0BACA,sBACA,sBACA,kBACA,mBACA,mBACA,mBACA,qBACA,mBACA,kBACA,UACA,UACA,eACA,aACA,gBACA,gBACA,aACA,gBACA,cACA,YACA,qBACA,cACA,uBACA,aACA,gBACA,iBACA,WACA,cACA,iBACA,iBACA,mBACA,aACA,iBACA,wBACA,OACA,mCACA,iCACA,cACA,OACA,YACA,iBACA,MACA,WACA,WACA,WACA,sBACA,qBACA,wBACA,eACA,yBACA,gCACA,2BACA,wBACA,oBACA,oBACA,gBACA,mBACA,SACA,eACA,QACA,cACA,YACA,WACA,aACA,qBACA,iBACA,aACA,aACA,YACA,SACA,gBACA,OACA,4BACA,WACA,OACA,OACA,UACA,iBACA,gBACA,WACA,QACA,WACA,gBACA,uBACA,gCACA,uBACA,SACA,OACA,SACA,kBACA,uBACA,wBACA,QACA,YACA,aACA,aACA,cACA,OACA,OACA,MACA,SACA,UACA,SACA,QACA,UACA,WACA,YACA,UACA,cACA,iBACA,YACA,kBACA,mBACA,WACA,mCACA,4BACA,+BACA,wBACA,mBACA,0BACA,iCACA,mBACA,YACA,sBACA,qBACA,iCACA,6BACA,oBACA,oBACA,mBACA,sBACA,oBACA,8BACA,sBACA,sBACA,8BACA,sBACA,uBACA,uBACA,aACA,eACA,aACA,YACA,mBACA,YACA,kBACA,oBACA,mBACA,eACA,YACA,YACA,YACA,WACA,YACA,UACA,qBACA,oBACA,oBACA,oBACA,sBACA,mBACA,iBACA,mBACA,qBACA,uBACA,wBACA,qBACA,yBACA,sBACA,uBACA,qBACA,uBACA,2CACA,kCACA,qCACA,iCACA,gCACA,8BACA,2BACA,6BACA,+BACA,kCACA,kCACA,iCACA,gCACA,kCACA,kCACA,gCACA,yBACA,yBACA,yBACA,iCACA,yBACA,0BACA,0BACA,MACA,OACA,kBACA,eACA,8BACA,sBACA,aACA,gBACA,gBACA,uBACA,sBACA,kBACA,oBACA,uBACA,YACA,YACA,iBACA,sBACA,gBACA,cACA,cACA,kCACA,6BACA,mBACA,mBACA,wBACA,iBACA,eACA,cACA,UACA,WACA,gBACA,aACA,mBACA,eACA,oBACA,wBACA,uBACA,uBACA,6BACA,mBACA,wBACA,6BACA,gBACA,wBACA,aACA,wBACA,eACA,oBACA,oBACA,oBACA,iBACA,sBACA,uBACA,iBACA,sBACA,sBACA,sBACA,qBACA,cACA,kBACA,aACA,qBACA,eACA,aACA,eACA,qBACA,sBACA,iBACA,gBACA,eACA,gBACA,qBACA,qBACA,qBACA,iBACA,aACA,wBACA,eACA,yBACA,0BACA,0BACA,aACA,iBACA,eACA,iBACA,cACA,gBACA,yBACA,sBACA,YACA,mBACA,6BACA,8BACA,0BACA,2BACA,gBACA,kBACA,iBACA,uBACA,kBACA,mBACA,cACA,gBACA,iBACA,aACA,mBACA,yBACA,wBACA,yBACA,oBACA,eACA,qBACA,oBACA,gBACA,qBACA,wBACA,wBACA,8BACA,eACA,eACA,gBACA,gBACA,oBACA,kBACA,gBACA,mBACA,iBACA,gBACA,iBACA,UACA,wBACA,yBACA,oBACA,gBACA,cACA,eACA,iBACA,kBACA,oBACA,QACA,MACA,OACA,oBACA,SACA,aACA,cACA,wBACA,cACA,OACA,oBACA,gBACA,QACA,WACA,kBACA,gBACA,mBACA,oBACA,sBACA,SACA,WACA,8BACA,cACA,iCACA,MACA,eACA,YACA,cACA,qBACA,OACA,aACA,eACA,WACA,WACA,eACA,mBACA,SACA,eACA,WACA,MACA,2BACA,2BACA,sBACA,sBACA,sBACA,sBACA,OACA,SACA,UACA,6BACA,6BACA,gBACA,SACA,8BACA,sBACA,sBACA,SACA,iBACA,gBACA,iBACA,YACA,YACA,kBACA,kBACA,oBACA,4BACA,4BACA,mCACA,mCACA,gCACA,gCACA,uCACA,uCACA,qBACA,gCACA,gCACA,qBACA,8BACA,8BACA,qBACA,qBACA,kBACA,kBACA,UACA,oBACA,aACA,KACA,gBACA,SACA,wBACA,sBACA,uBACA,uBACA,oBACA,OACA,oBACA,8BACA,kBACA,sBACA,eACA,mBACA,aACA,SACA,cACA,mBACA,kBACA,qBACA,wBACA,4BACA,oBACA,eACA,SACA,cACA,gBACA,oBACA,wBACA,gBACA,UACA,mBACA,QACA,cACA,mBACA,IACA,YACA,qBACA,iBACA,YACA,gBACA,aACA,WACA,UACA,eACA,0BACA,uBACA,yBACA,0BACA,0BACA,sBACA,+BACA,wBACA,4BACA,qBACA,WACA,yCACA,wBACA,8BACA,yCACA,8BACA,2BACA,SACA,UACA,MACA,SACA,UACA,OACA,QACA,WACA,qBACA,4BACA,sBACA,kBACA,4BACA,iBACA,eACA,wBACA,iBACA,gBACA,QACA,aACA,iBACA,mBACA,OACA,iBACA,SACA,UACA,WACA,aACA,eACA,UACA,2BACA,iBACA,kBACA,yBACA,wBACA,WACA,kBACA,cACA,eACA,mBACA,iBACA,aACA,YACA,eACA,eACA,SACA,gBACA,iBACA,uBACA,mBACA,kBACA,cACA,2BACA,aACA,QACA,UACA,WACA,iBACA,qBACA,eACA,gBACA,yBACA,qBACA,eACA,cACA,wBACA,gBACA,8BACA,YACA,OACA,aACA,eACA,UACA,QACA,SACA,YACA,qBACA,YACA,eACA,iBACA,cACA,qBACA,oBACA,oBACA,+BACA,+BACA,mBACA,0BACA,yBACA,eACA,qBACA,sBACA,eACA,eACA,gBACA,iBACA,0BACA,0BACA,cACA,eACA,qBACA,oBACA,cACA,cACA,aACA,gBACA,gBACA,cACA,wBACA,qBACA,yBACA,WACA,yBACA,oBACA,0BACA,6BACA,mBACA,qBACA,yBACA,qBACA,oBACA,wBACA,oBACA,wBACA,iCACA,kBACA,oBACA,2BACA,sBACA,mBACA,qBACA,WACA,sCACA,mBACA,iBACA,iBACA,oBACA,cACA,aACA,qBACA,yBACA,oBACA,eACA,oBACA,0BACA,gCACA,wBACA,6BACA,8BACA,8BACA,2BACA,yBACA,oBACA,oBACA,oBACA,oBACA,oBACA,2BACA,oBACA,oBACA,wBACA,yBACA,qBACA,yBACA,+BACA,wBACA,mBACA,yBACA,mBACA,iBACA,qBACA,2BACA,yBACA,wBACA,wBACA,0BACA,cACA,qBACA,kBACA,qBACA,qBACA,qBACA,kBACA,kBACA,YACA,gBACA,iBACA,2BACA,kBACA,mBACA,iBACA,YACA,qBACA,yBACA,YACA,gBACA,WACA,iBACA,aACA,mBACA,mBACA,sBACA,4BACA,4BACA,kCACA,kCACA,gCACA,gCACA,sCACA,sCACA,sBACA,gCACA,gCACA,sBACA,8BACA,8BACA,iBACA,sBACA,sBACA,oBACA,WACA,eACA,oBACA,qBACA,yBACA,2BACA,UACA,iBACA,qBACA,gBACA,mBACA,gBACA,iBACA,gBACA,kBACA,mBACA,mBACA,iBACA,kBACA,wBACA,iBACA,qBACA,4BACA,kBACA,eACA,mBACA,eACA,gBACA,kBACA,iBACA,cACA,gBACA,eACA,oBACA,qBACA,oBACA,wBACA,4BACA,gBACA,gBACA,gBACA,gBACA,sBACA,6BACA,yBACA,kCACA,wBACA,yBACA,oBACA,uBACA,oBACA,yBACA,8BACA,+BACA,0BACA,8BACA,6BACA,8BACA,uBACA,2BACA,8BACA,4BACA,0BACA,2BACA,8BACA,0BACA,8BACA,2BACA,mCACA,0CACA,gCACA,kCACA,iCACA,wCACA,qCACA,wCACA,sCACA,qCACA,uCACA,sCACA,gCACA,8BACA,+BACA,gCACA,mCACA,+BACA,wBACA,oBACA,qBACA,qBACA,oBACA,oBACA,wBACA,oBACA,4BACA,oBACA,oBACA,yBACA,8BACA,0BACA,iCACA,0BACA,yBACA,4BACA,qBACA,yBACA,4BACA,uBACA,wBACA,0BACA,iCACA,gCACA,kCACA,6BACA,qBACA,yBACA,kCACA,wBACA,oBACA,iCACA,yBACA,6BACA,sCACA,+BACA,kCACA,mCACA,mCACA,mCACA,mCACA,mCACA,mCACA,mCACA,mCACA,mCACA,uBACA,2BACA,0BACA,2BACA,0BACA,wBACA,yBACA,uBACA,uBACA,sBACA,sBACA,sBACA,0BACA,wBACA,mCACA,iCACA,8BACA,kCACA,wBACA,+BACA,qBACA,yBACA,yBACA,yBACA,aACA,aACA,SACA,oBACA,SACA,sBACA,kBACA,+BACA,YACA,gBACA,yBACA,4BACA,qBACA,MACA,aACA,eACA,qBACA,uBACA,2BACA,gBACA,UACA,eACA,SACA,aACA,iBACA,eACA,SACA,cACA,YACA,4BACA,8BACA,8BACA,4BACA,6BACA,+BACA,UACA,WACA,WACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,WACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,WACA,YACA,YACA,WACA,WACA,WACA,WACA,WACA,WACA,aACA,qBACA,2BACA,mBACA,8BACA,8BACA,8BACA,8BACA,8BACA,8BACA,qBACA,6BACA,qBACA,iBACA,iBACA,YACA,UACA,cACA,gBACA,2BACA,WACA,YACA,eACA,iBACA,oBACA,WACA,oBACA,gBACA,cACA,gBACA,OACA,cACA,cACA,YACA,cACA,YACA,eACA,mBACA,gBACA,YACA,aACA,QACA,aACA,YACA,aACA,kBACA,aACA,YACA,UACA,WACA,cACA,eACA,0BACA,wBACA,+BACA,+BACA,mBACA,qCACA,sBACA,iCACA,oBACA,SACA,gBACA,eACA,iBACA,yBACA,yBACA,uBACA,6BACA,cACA,WACA,MACA,kBACA,eACA,mBACA,MACA,cACA,cACA,aACA,oBACA,qBACA,+BACA,qBACA,kBACA,iBACA,iBACA,SACA,UACA,iBACA,cACA,qCACA,oCACA,8BACA,iCACA,8BACA,2BACA,6BACA,2BACA,gBACA,WACA,gBACA,UACA,WACA,gBACA,SACA,YACA,gBACA,mBACA,qBACA,wBACA,uBACA,qBACA,qBACA,iBACA,UACA,UACA,kBACA,cACA,oBACA,mBACA,eACA,oBACA,wBACA,cACA,6BACA,eACA,uBACA,mBACA,uBACA,oBACA,sBACA,uBACA,wBACA,yBACA,kBACA,sBACA,0BACA,gBACA,gBACA,sBACA,6BACA,wBACA,kBACA,oBACA,yBACA,kBACA,wCACA,cACA,mBACA,qBACA,yBACA,wBACA,YACA,aACA,SACA,SACA,cACA,iBACA,4BACA,0BACA,8BACA,uBACA,gBACA,qCACA,iBACA,iBACA,kBACA,kBACA,cACA,gBACA,OACA,SACA,SACA,mBACA,mBACA,mBACA,mBACA,UACA,YACA,gBACA,IACA,QACA,OACA,QACA,MACA,WACA,eACA,+BACA,cACA,SACA,gBACA,aACA,YACA,iBACA,WACA,OACA,QACA,SACA,YACA,SACA,aACA,gBACA,sBACA,oBACA,gBACA,MACA,cACA,eACA,eACA,SACA,aACA,mBACA,YACA,gBACA,aACA,kBACA,YACA,cACA,WACA,cACA,UACA,aACA,WACA,YACA,UACA,kBACA,kBACA,YACA,eACA,WACA,sBACA,aACA,iBACA,kBACA,SACA,YACA,MACA,UACA,QACA,YACA,QACA,gBACA,cACA,aACA,eACA,aACA,YACA,oBACA,aACA,MACA,kBACA,oBACA,QACA,MACA,cACA,UACA,SACA,UACA,WACA,mBACA,YACA,kBACA,SACA,aACA,eACA,UACA,QACA,UACA,UACA,uBACA,gCACA,sBACA,iBACA,YACA,kBACA,sBACA,qBACA,sBACA,4BACA,iBACA,uBACA,4BACA,iBACA,qBACA,oBACA,oBACA,0BACA,gBACA,qBACA,qBACA,0BACA,mBACA,cACA,MACA,cACA,kBACA,UACA,mBACA,aACA,SACA,eACA,cACA,aACA,aACA,eACA,cACA,aACA,eACA,kBACA,oBACA,UACA,mBACA,QACA,eACA,MACA,QACA,UACA,QACA,YACA,cACA,OACA,QACA,SACA,SACA,QACA,QACA,OACA,QACA,QACA,OACA,cACA,eACA,cACA,SACA,aACA,WACA,gBACA,qBACA,aACA,cACA,gBACA,aACA,iBACA,eACA,cACA,YACA,WACA,cACA,YACA,WACA,aACA,eACA,YACA,WACA,OACA,OACA,UACA,IACA,OACA,sBACA,qBACA,aACA,wBACA,wBACA,kBACA,mBACA,mBACA,oBACA,sBACA,oBACA,kBACA,uBACA,sBACA,iBACA,kBACA,kBACA,mBACA,qBACA,sBACA,sBACA,mBACA,iBACA,WACA,UACA,iBACA,iBACA,WACA,aACA,UACA,UACA,gBACA,UACA,OACA,eACA,iBACA,YACA,WACA,iBACA,eACA,eACA,OACA,gBACA,UACA,eACA,OACA,MACA,aACA,OACA,qBACA,aACA,kBACA,mBACA,cACA,aACA,gBACA,wBACA,YACA,oBACA,QACA,OACA,iBACA,OACA,OACA,OACA,WACA,OACA,YACA,eACA,SACA,gBACA,sBACA,4BACA,6BACA,sBACA,sBACA,kBACA,eACA,eACA,sBACA,sBACA,qBACA,sBACA,qBACA,cACA,oBACA,oBACA,oBACA,gBACA,eACA,qBACA,qBACA,qBACA,iBACA,eACA,aACA,mBACA,yBACA,0BACA,mBACA,mBACA,eACA,eACA,oBACA,yBACA,0BACA,oBACA,oBACA,iBACA,cACA,kBACA,mBACA,cACA,oBACA,oBACA,mBACA,oBACA,mBACA,aACA,kBACA,kBACA,kBACA,eACA,cACA,mBACA,mBACA,mBACA,gBACA,cACA,YACA,iBACA,sBACA,uBACA,iBACA,iBACA,cACA,SACA,eACA,QACA,gBACA,qBACA,iBACA,eACA,cACA,gBACA,SACA,uBACA,aACA,aACA,qBACA,YACA,YACA,aACA,cACA,cACA,kBACA,OACA,UACA,SACA,aACA,cACA,aACA,gBACA,WACA,iBACA,UACA,cACA,SACA,WACA,UACA,aACA,aACA,IACA,OACA,SACA,iBACA,eACA,cACA,kBACA,cACA,cACA,SACA,uBACA,eACA,wBACA,aACA,YACA,SACA,UACA,eACA,cACA,gBACA,oBACA,yBACA,sBACA,OACA,QACA,WACA,OACA,KACA,OACA,YACA,cACA,cACA,QACA,KACA,QACA,QACA,YACA,iBACA,UACA,eACA,mBACA,wBACA,OACA,SACA,WACA,aACA,YACA,eACA,WACA,eACA,UACA,iBACA,yBACA,oBACA,gBACA,UACA,oBACA,aACA,WACA,SACA,aACA,OACA,YACA,YACA,UACA,QACA,kBACA,aACA,YACA,aACA,iBACA,gBACA,aACA,gBACA,kBACA,YACA,uBACA,cACA,eACA,eACA,aACA,QACA,aACA,eACA,oBACA,aACA,aACA,cACA,YACA,cACA,UACA,UACA,OACA,YACA,YACA,aACA,WACA,WACA,gBACA,YACA,WACA,UACA,gBACA,QACA,gBACA,YACA,aACA,QACA,YACA,SACA,UACA,MACA,QACA,MACA,OACA,WACA,cACA,WACA,UACA,WACA,gBACA,kBACA,YACA,UACA,QACA,QACA,sBACA,8BACA,aACA,qBACA,4BACA,YACA,YACA,OACA,cACA,aACA,YACA,eACA,aACA,kBACA,kBACA,kBACA,aACA,cACA,UACA,UACA,oBACA,0BACA,UACA,wBACA,0BACA,mBACA,cACA,eACA,aACA,aACA,UACA,gBACA,WACA,qBACA,uBACA,yBACA,uBACA,0BACA,SACA,gBACA,iBACA,iBACA,gBACA,UACA,qBACA,uCACA,kCACA,UACA,aACA,eACA,YACA,aACA,kBACA,UACA,cACA,qBACA,cACA,YACA,WACA,eACA,UACA,kBACA,kBACA,kBACA,oBACA,mBACA,cACA,gBACA,UACA,cACA,cACA,WACA,aACA,UACA,aACA,WACA,0BACA,SACA,gBACA,SACA,kBACA,iBACA,oBACA,gBACA,aACA,uBACA,0BACA,MACA,OACA,QACA,oBACA,gBACA,mBACA,eACA,WACA,kBACA,SACA,iBACA,eACA,kBACA,oBACA,qBACA,eACA,qBACA,qBACA,sBACA,gBACA,sBACA,wBACA,gBACA,2BACA,qBACA,kBACA,mBACA,oBACA,cACA,kBACA,iBACA,yBACA,qBACA,2BACA,gBACA,kBACA,wBACA,cACA,oBACA,mBACA,oBACA,iBACA,aACA,iBACA,qBACA,oBACA,kBACA,cACA,uBACA,uBACA,2BACA,kBACA,+BACA,0BACA,oBACA,mBACA,qBACA,qBACA,oBACA,kBACA,cACA,mBACA,eACA,gBACA,qBACA,cACA,8BACA,gBACA,uBACA,cACA,wBACA,qBACA,iBACA,kBACA,kBACA,kBACA,yBACA,yBACA,4BACA,kCACA,kCACA,wCACA,wCACA,sCACA,sCACA,4CACA,4CACA,4BACA,sCACA,sCACA,4BACA,oCACA,oCACA,4BACA,4BACA,iBACA,gBACA,qBACA,+BACA,wBACA,gBACA,eACA,mBACA,qBACA,mBACA,cACA,cACA,cACA,iBACA,kBACA,gBACA,cACA,kBACA,mBACA,mBACA,eACA,cACA,SACA,MACA,WACA,WACA,UACA,eACA,UACA,WACA,OACA,WACA,cACA,cACA,eACA,gBACA,aACA,eACA,eACA,gBACA,cACA,mBACA,cACA,SACA,QACA,cACA,KACA,KACA,IACA,OACA,UACA,eACA,eACA,UACA,eACA,WACA,UACA,WACA,KACA,QACA,kBACA,UACA,SACA,kBACA,YACA,qBACA,UACA,UACA,iBACA,iBACA,eACA,sBACA,mBACA,kBACA,gBACA,aACA,eACA,cACA,gBACA,QACA,sBACA,sBACA,mBACA,iBACA,YACA,SACA,eACA,gBACA,aACA,iBACA,aACA,iBACA,oBACA,qBACA,cACA,eACA,oBACA,gBACA,qBACA,YACA,aACA,eACA,cACA,cACA,gBACA,uBACA,WACA,eACA,iBACA,oBACA,QACA,YACA,SACA,SACA,SACA,YACA,YACA,aACA,aACA,YACA,cACA,cACA,aACA,cACA,iBACA,SACA,cACA,eACA,SACA,SACA,mBACA,aACA,aACA,kBACA,SACA,aACA,MACA,UACA,YACA,SACA,UACA,2BACA,WACA,kBACA,aACA,gBACA,UACA,gBACA,UACA,SACA,WACA,WACA,aACA,WACA,UACA,WACA,kBACA,eACA,cACA,UACA,oBACA,cACA,cACA,cACA,2BACA,6BACA,iBACA,aACA,SACA,kBACA,oBACA,oBACA,mBACA,OACA,gBACA,WACA,WACA,YACA,aACA,2BACA,sBACA,eACA,6BACA,oBACA,YACA,oBACA,sBACA,sBACA,qBACA,aACA,qBACA,WACA,OACA,YACA,WACA,SACA,QACA,KACA,KACA,SACA,IACA,WACA,gBACA,cACA,mBACA,WACA,YACA,UACA,QACA,SACA,QACA,cACA,aACA,SACA,mBACA,0BACA,0BACA,UACA,gBACA,SACA,YACA,qBACA,WACA,UACA,UACA,MACA,eACA,aACA,eACA,cACA,YACA,UACA,QACA,WACA,WACA,UACA,YACA,YACA,oBACA,QACA,YACA,SACA,OACA,WACA,QACA,aACA,QACA,YACA,OACA,cACA,sBACA,aACA,iBACA,kBACA,MACA,SACA,yBACA,UACA,YACA,aACA,yBACA,QACA,WACA,+BACA,YACA,SACA,aACA,aACA,eACA,WACA,4BACA,kBACA,cACA,IACA,OACA,eACA,WACA,aACA,0BACA,WACA,QACA,QACA,aACA,UACA,UACA,kBACA,aACA,mBACA,WACA,WACA,kBACA,WACA,QACA,OACA,eACA,YACA,cACA,WACA,WACA,YACA,WACA,SACA,aACA,aACA,cACA,UACA,OACA,YACA,WACA,WACA,SACA,YACA,aACA,oBACA,YACA,QACA,OACA,aACA,iBACA,YACA,YACA,cACA,YACA,YACA,gBACA,WACA,WACA,aACA,WACA,QACA,QACA,QACA,cACA,gBACA,aACA,eACA,QACA,QACA,QACA,YACA,cACA,OACA,cACA,wBACA,eACA,yBACA,YACA,mBACA,eACA,aACA,iBACA,eACA,0BACA,oBACA,0BACA,yBACA,uBACA,wBACA,cACA,aACA,sBACA,cACA,uBACA,WACA,iBACA,uBACA,cACA,YACA,gBACA,cACA,wBACA,kBACA,uBACA,uBACA,qBACA,sBACA,aACA,YACA,QACA,WACA,MACA,UACA,cACA,OACA,aACA,cACA,aACA,iBACA,aACA,SACA,QACA,UACA,KACA,QACA,cACA,eACA,eACA,0BACA,uBACA,SACA,YACA,SACA,YACA,oBACA,OACA,eACA,gBACA,cACA,YACA,SACA,aACA,oBACA,oBACA,KACA,KACA,OACA,UACA,QACA,iBACA,cACA,iBACA,kBACA,cACA,gBACA,MACA,kBACA,mBACA,kBACA,SACA,wBACA,YACA,cACA,qBACA,oBACA,eACA,iBACA,mBACA,qBACA,iBACA,UACA,aACA,UACA,cACA,wBACA,qBACA,uBACA,wBACA,sBACA,SACA,+BACA,iBACA,uBACA,gBACA,iBACA,6BACA,mBACA,wBACA,mBACA,aACA,uBACA,kBACA,eACA,aACA,qBACA,iBACA,UACA,mBACA,UACA,SACA,0BACA,gCACA,sBACA,cACA,iBACA,yBACA,oBACA,uBACA,yBACA,mBACA,uBACA,aACA,mBACA,mBACA,WACA,eACA,kBACA,aACA,UACA,aACA,aACA,wBACA,yBACA,gBACA,oCACA,uBACA,cACA,cACA,WACA,eACA,WACA,WACA,UACA,sBACA,UACA,WACA,SACA,cACA,kBACA,WACA,qBACA,cACA,cACA,kBACA,aACA,mBACA,WACA,eACA,iBACA,cACA,mBACA,mCACA,mBACA,2BACA,sBACA,wBACA,eACA,qBACA,mBACA,gBACA,uBACA,2BACA,oBACA,oBACA,sBACA,sBACA,sBACA,uBACA,mBACA,iBACA,mBACA,kBACA,aACA,eACA,eACA,kBACA,mBACA,2BACA,oBACA,UACA,oBACA,iBACA,eACA,aACA,eACA,aACA,mBACA,qBACA,2BACA,kBACA,oBACA,eACA,aACA,2BACA,yBACA,eACA,WACA,oBACA,gBACA,iBACA,qBACA,kBACA,yBACA,kBACA,UACA,oBACA,iBACA,eACA,YACA,wBACA,aACA,YACA,iBACA,cACA,qBACA,gBACA,cACA,gBACA,YACA,YACA,WACA,aACA,qBACA,eACA,YACA,aACA,mBACA,kBACA,wBACA,0BACA,iBACA,mBACA,UACA,YACA,SACA,cACA,2BACA,6BACA,2BACA,WACA,KACA,oBACA,gBACA,WACA,QACA,QACA,iBACA,WACA,sBACA,MACA,eACA,iBACA,gBACA,gBACA,iBACA,eACA,aACA,WACA,YACA,iBACA,OACA,OACA,UACA,UACA,SACA,SACA,OACA,YACA,OACA,OACA,UACA,kBACA,kBACA,qBACA,OACA,WACA,OACA,WACA,SACA,wBACA,UACA,WACA,YACA,cACA,QACA,QACA,qBACA,oBACA,OACA,KACA,aACA,WACA,YACA,aACA,oBACA,kBACA,mBACA,iBACA,SACA,WACA,UACA,iBACA,YACA,aACA,mBACA,UACA,OACA,OACA,MACA,MACA,kCACA,UACA,WACA,cACA,gBACA,QACA,aACA,UACA,YACA,sBACA,sBACA,OACA,OACA,qBACA,sBACA,qBACA,iBACA,mBACA,uBACA,kBACA,WACA,wBACA,6BACA,gBACA,iBACA,YACA,iBACA,mBACA,sBACA,eACA,oBACA,0BACA,mBACA,iBACA,uBACA,sBACA,oBACA,mBACA,oBACA,gBACA,0BACA,mBACA,oBACA,oBACA,sBACA,yBACA,mBACA,gBACA,gBACA,iBACA,sBACA,cACA,2BACA,4BACA,uBACA,iBACA,cACA,aACA,gBACA,QACA,YACA,cACA,YACA,aACA,QACA,cACA,gBACA,cACA,wBACA,qBACA,qBACA,eACA,aACA,aACA,mBACA,aACA,YACA,aACA,eACA,YACA,iBACA,iBACA,iBACA,WACA,uBACA,UACA,aACA,KACA,OACA,cACA,UACA,6BACA,WACA,2BACA,SACA,cACA,cACA,oBACA,6BACA,gBACA,qBACA,aACA,YACA,UACA,cACA,eACA,WACA,gBACA,WACA,cACA,OACA,aACA,YACA,QACA,cACA,QACA,SACA,gBACA,gBACA,iBACA,kBACA,kBACA,YACA,YACA,qBACA,8BACA,gBACA,iBACA,gBACA,aACA,WACA,WACA,cACA,aACA,YACA,YACA,kBACA,SACA,YACA,UACA,OACA,SACA,WACA,UACA,YACA,WACA,YACA,cACA,WACA,cACA,WACA,OACA,OACA,kBACA,iBACA,KACA,KACA,KACA,KACA,eACA,oBACA,oBACA,UACA,MACA,UACA,SACA,gBACA,kBACA,cACA,UACA,YACA,UACA,WACA,OACA,UACA,OACA,OACA,QACA,SACA,OACA,WACA,YACA,eACA,YACA,mBACA,cACA,YACA,cACA,YACA,qBACA,kBACA,eACA,mBACA,WACA,YACA,YACA,oBACA,WACA,SACA,SACA,aACA,aACA,iBACA,iBACA,iBACA,iBACA,SACA,OACA,cACA,aACA,SACA,eACA,mBACA,iBACA,gBACA,QACA,iBACA,gBACA,oBACA,OACA,cACA,YACA,YACA,UACA,iBACA,aACA,WACA,aACA,SACA,YACA,0BACA,SACA,OACA,YACA,cACA,QACA,OACA,aACA,mBACA,sBACA,kBACA,YACA,iBACA,oBACA,gBACA,WACA,OACA,eACA,iBACA,YACA,SACA,mBACA,YACA,eACA,SACA,gBACA,WACA,cACA,OACA,aACA,MACA,QACA,QACA,OACA,cACA,cACA,WACA,YACA,qBACA,eACA,OACA,UACA,YACA,UACA,MACA,QACA,aACA,YACA,SACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,WACA,MACA,UACA,SACA,gBACA,cACA,eACA,aACA,eACA,eACA,aACA,cACA,YACA,cACA,OACA,SACA,aACA,aACA,gBACA,eACA,YACA,eACA,YACA,eACA,cACA,cACA,cACA,QACA,OACA,YACA,mBACA,WACA,YACA,QACA,aACA,cACA,UACA,SACA,kBACA,MACA,aACA,YACA,kBACA,kBACA,0BACA,cACA,cACA,YACA,YACA,iBACA,WACA,WACA,UACA,cACA,QACA,eACA,eACA,aACA,YACA,YACA,cACA,SACA,UACA,kBACA,UACA,eACA,kBACA,UACA,SACA,WACA,YACA,MACA,aACA,YACA,cACA,YACA,WACA,WACA,aACA,iBACA,eACA,OACA,SACA,QACA,OACA,SACA,UACA,YACA,gBACA,gBACA,iBACA,cACA,WACA,UACA,YACA,SACA,iBACA,oBACA,cACA,SACA,wBACA,UACA,UACA,mBACA,sBACA,qBACA,0BACA,sBACA,iCACA,mBACA,6BACA,iBACA,aACA,cACA,sBACA,sBACA,6BACA,YACA,UACA,gBACA,mBACA,qBACA,cACA,iBACA,gBACA,gBACA,uBACA,uBACA,YACA,gBACA,eACA,eACA,iBACA,kBACA,cACA,aACA,YACA,2BACA,eACA,kBACA,kBACA,iBACA,iBACA,UACA,eACA,WACA,YACA,qBACA,qBACA,eACA,eACA,YACA,iBACA,gBACA,mBACA,kBACA,SACA,wBACA,qBACA,oBACA,cACA,mBACA,qBACA,uBACA,2BACA,YACA,2BACA,uBACA,wBACA,eACA,qBACA,gBACA,eACA,YACA,eACA,eACA,aACA,uBACA,mBACA,qBACA,cACA,mBACA,uBACA,sBACA,sBACA,4BACA,kBACA,uBACA,uBACA,4BACA,uBACA,qBACA,6BACA,YACA,mBACA,gCACA,uBACA,mBACA,UACA,wBACA,sBACA,qBACA,wBACA,wBACA,oBACA,0BACA,wBACA,mBACA,eACA,WACA,eACA,sBACA,qBACA,mBACA,iBACA,aACA,eACA,SACA,cACA,kBACA,aACA,kBACA,iBACA,iBACA,cACA,aACA,iBACA,sBACA,aACA,aACA,aACA,wBACA,sBACA,sBACA,oBACA,qBACA,2BACA,wBACA,eACA,oBACA,mBACA,gBACA,YACA,iBACA,gBACA,aACA,WACA,uBACA,wBACA,wBACA,uBACA,YACA,0BACA,aACA,cACA,sBACA,iBACA,cACA,SACA,cACA,oBACA,6BACA,eACA,oBACA,mBACA,gBACA,kBACA,gBACA,sBACA,mBACA,6BACA,kBACA,mBACA,mBACA,0BACA,0BACA,sBACA,aACA,mBACA,mBACA,gBACA,oBACA,oBACA,oBACA,oBACA,gBACA,sBACA,sBACA,mBACA,gBACA,gBACA,sBACA,iBACA,iBACA,sBACA,0BACA,mBACA,WACA,gBACA,gBACA,gCACA,+BACA,iCACA,gCACA,cACA,oBACA,mBACA,eACA,oBACA,uBACA,uBACA,6BACA,sBACA,gCACA,eACA,oBACA,aACA,eACA,gBACA,sBACA,SACA,WACA,KACA,aACA,oBACA,YACA,WACA,WACA,eACA,cACA,QACA,IACA,OACA,WACA,YACA,iBACA,QACA,eACA,aACA,gBACA,eACA,WACA,aACA,iBACA,kBACA,YACA,OACA,yBACA,WACA,WACA,eACA,WACA,eACA,SACA,WACA,yBACA,aACA,UACA,OACA,qBACA,WACA,WACA,cACA,WACA,SACA,WACA,UACA,aACA,SACA,WACA,WACA,YACA,YACA,wBACA,eACA,YACA,OACA,cACA,UACA,SACA,MACA,aACA,SACA,mBACA,iBACA,gBACA,kBACA,cACA,mBACA,SACA,aACA,kBACA,YACA,iBACA,cACA,mBACA,UACA,KACA,qBACA,SACA,eACA,aACA,aACA,eACA,YACA,cACA,UACA,UACA,KACA,SACA,WACA,aACA,kBACA,SACA,UACA,aACA,WACA,cACA,aACA,eACA,uBACA,gBACA,aACA,iBACA,eACA,iBACA,sBACA,mBACA,eACA,cACA,qBACA,oBACA,gBACA,gBACA,wBACA,iBACA,iBACA,YACA,SACA,WACA,aACA,WACA,WACA,wBACA,wBACA,0BACA,YACA,mBACA,eACA,WACA,mBACA,uBACA,aACA,UACA,UACA,4BACA,aACA,gBACA,kBACA,SACA,cACA,QACA,kBACA,gBACA,mBACA,oBACA,aACA,eACA,gBACA,iBACA,sBACA,oBACA,0BACA,YACA,gBACA,SACA,YACA,cACA,cACA,aACA,cACA,SACA,mBACA,YACA,cACA,QACA,UACA,UACA,UACA,gBACA,SACA,iBACA,WACA,UACA,YACA,aACA,qBACA,oBACA,kBACA,eACA,iBACA,sBACA,eACA,SACA,iBACA,6BACA,aACA,UACA,YACA,YACA,aACA,UACA,mBACA,mBACA,gBACA,SACA,eACA,mBACA,YACA,cACA,gBACA,uBACA,OACA,SACA,YACA,cACA,eACA,eACA,cACA,aACA,cACA,YACA,eACA,SACA,YACA,cACA,wBACA,uBACA,yBACA,yBACA,wBACA,kBACA,uBACA,sBACA,oBACA,uBACA,iBACA,kBACA,mBACA,iBACA,wBACA,mBACA,yBACA,+BACA,cACA,wBACA,oBACA,kBACA,mBACA,mBACA,mBACA,kBACA,iBACA,kBACA,gBACA,kCACA,qBACA,sBACA,YACA,aACA,aACA,YACA,WACA,SACA,sBACA,eACA,aACA,aACA,UACA,UACA,SACA,YACA,sBACA,kBACA,gBACA,iBACA,iBACA,sBACA,qBACA,gBACA,eACA,gBACA,cACA,aACA,aACA,mBACA,eACA,qBACA,iBACA,gBACA,UACA,WACA,cACA,gBACA,6BACA,WACA,WACA,aACA,YACA,eACA,iBACA,WACA,WACA,WACA,YACA,WACA,oBACA,gBACA,SACA,yBACA,aACA,eACA,cACA,gBACA,YACA,UACA,gBACA,SACA,YACA,kBACA,WACA,YACA,YACA,cACA,YACA,eACA,WACA,gBACA,aACA,cACA,eACA,kBACA,WACA,gBACA,kBACA,kBACA,kBACA,kBACA,iBACA,YACA,YACA,uBACA,6BACA,yBACA,iDACA,2BACA,0BACA,mBACA,mBACA,qBACA,kBACA,4BACA,4CACA,4BACA,2BACA,mCACA,wBACA,UACA,SACA,UACA,OACA,aACA,eACA,gBACA,SACA,QACA,gBACA,WACA,MACA,UACA,UACA,QACA,SACA,SACA,UACA,MACA,SACA,cACA,aACA,cACA,SACA,iBACA,UACA,QACA,YACA,cACA,YACA,aACA,UACA,gBACA,iBACA,gBACA,gBACA,eACA,gBACA,eACA,eACA,eACA,WACA,aACA,aACA,YACA,YACA,mBACA,aACA,gBACA,eACA,YACA,YACA,kBACA,gBACA,KACA,KACA,KACA,KACA,MACA,UACA,iBACA,eACA,gBACA,cACA,gBACA,cACA,eACA,aACA,OACA,mBACA,oBACA,oBACA,iBACA,kBACA,kBACA,YACA,QACA,cACA,QACA,cACA,QACA,cACA,aACA,gBACA,YACA,UACA,eACA,SACA,gBACA,aACA,aACA,mBACA,iBACA,eACA,QACA,aACA,kBACA,WACA,eACA,WACA,YACA,OACA,aACA,cACA,cACA,sBACA,WACA,UACA,sBACA,kBACA,mBACA,eACA,QACA,kBACA,cACA,SACA,UACA,cACA,aACA,YACA,cACA,cACA,qBACA,oBACA,qBACA,oBACA,QACA,OACA,QACA,cACA,aACA,cACA,YACA,aACA,cACA,WACA,yBACA,yBACA,aACA,cACA,WACA,OACA,eACA,gBACA,eACA,SACA,UACA,cACA,QACA,iBACA,6BACA,iBACA,gBACA,YACA,qBACA,cACA,SACA,YACA,YACA,YACA,gBACA,MACA,sBACA,kBACA,iBACA,OACA,QACA,QACA,QACA,YACA,YACA,UACA,WACA,SACA,WACA,WACA,gBACA,YACA,cACA,SACA,MACA,WACA,kBACA,YACA,yBACA,yBACA,SACA,UACA,gBACA,sBACA,4BACA,UACA,WACA,YACA,iBACA,oBACA,yBACA,eACA,eACA,gBACA,kBACA,oBACA,aACA,gBACA,iBACA,aACA,QACA,aACA,0BACA,UACA,oBACA,UACA,aACA,UACA,aACA,WACA,SACA,aACA,uBACA,eACA,WACA,eACA,YACA,cACA,gBACA,WACA,YACA,YACA,OACA,mBACA,YACA,MACA,eACA,mBACA,YACA,sBACA,uBACA,oBACA,wBACA,mBACA,oBACA,gBACA,mBACA,QACA,SACA,IACA,KACA,KACA,OACA,aACA,UACA,UACA,SACA,QACA,aACA,WACA,WACA,cACA,gBACA,cACA,iBACA,OACA,QACA,MACA,OACA,oBACA,qBACA,aACA,gBACA,aACA,WACA,aACA,sBACA,aACA,SACA,SACA,WACA,YACA,eACA,YACA,OACA,MACA,gBACA,cACA,gBACA,SACA,cACA,YACA,cACA,OACA,OACA,gBACA,WACA,UACA,SACA,gBACA,gBACA,WACA,UACA,WACA,yBACA,kBACA,0BACA,SACA,MACA,UACA,cACA,gBACA,UACA,iBACA,gBACA,wBACA,wBACA,WACA,SACA,iBACA,oBACA,SACA,kBACA,kBACA,oBACA,sBACA,iBACA,cACA,YACA,sBACA,eACA,eACA,aACA,iBACA,kBACA,oBACA,aACA,kBACA,iBACA,cACA,eACA,aACA,sCACA,qBACA,eACA,cACA,iBACA,yBACA,iCACA,eACA,sBACA,iBACA,gBACA,SACA,UACA,sBACA,eACA,cACA,YACA,cACA,cACA,eACA,eACA,mBACA,iBACA,wBACA,sBACA,cACA,oBACA,8BACA,oBACA,qBACA,eACA,mBACA,WACA,qBACA,mBACA,QACA,iBACA,SACA,WACA,WACA,UACA,WACA,eACA,cACA,gBACA,eACA,eACA,cACA,cACA,UACA,SACA,aACA,SACA,cACA,MACA,UACA,WACA,YACA,kBACA,WACA,QACA,eACA,cACA,gBACA,OACA,cACA,SACA,kBACA,sBACA,mBACA,uBACA,aACA,WACA,eACA,QACA,WACA,UACA,OACA,YACA,eACA,eACA,QACA,UACA,eACA,KACA,KACA,SACA,iBACA,aACA,UACA,OACA,QACA,UACA,cACA,kBACA,sBACA,YACA,SACA,UACA,QACA,YACA,SACA,SACA,mBACA,gBACA,aACA,2BACA,2BACA,YACA,UACA,UACA,UACA,SACA,kBACA,eACA,iBACA,WACA,gBACA,gBACA,cACA,eACA,iBACA,yBACA,aACA,gBACA,aACA,aACA,WACA,YACA,eACA,cACA,UACA,UACA,wBACA,sBACA,qBACA,2BACA,qBACA,0BACA,uBACA,sBACA,aACA,YACA,MACA,gBACA,SACA,OACA,SACA,YACA,uBACA,eACA,kBACA,wBACA,WACA,OACA,WACA,UACA,SACA,oBACA,aACA,qBACA,cACA,mBACA,kBACA,WACA,gBACA,kBACA,wBACA,wBACA,YACA,qBACA,eACA,iBACA,WACA,eACA,OACA,OACA,eACA,aACA,SACA,gBACA,YACA,oBACA,gBACA,YACA,iBACA,MACA,YACA,WACA,eACA,iBACA,mBACA,qBACA,mBACA,8BACA,aACA,WACA,wBACA,iBACA,oBACA,UACA,UACA,eACA,SACA,cACA,eACA,cACA,eACA,eACA,aACA,aACA,gBACA,cACA,WACA,eACA,WACA,WACA,UACA,cACA,UACA,aACA,cACA,cACA,eACA,sBACA,YACA,iBACA,eACA,kBACA,aACA,gBACA,WACA,eACA,iBACA,2BACA,mBACA,kBACA,iBACA,mCACA,WACA,eACA,kBACA,oBACA,cACA,gBACA,cACA,iBACA,cACA,sBACA,YACA,eACA,uBACA,mBACA,eACA,8BACA,YACA,WACA,aACA,oBACA,uBACA,YACA,WACA,WACA,WACA,gBACA,iBACA,kBACA,iBACA,iBACA,mBACA,kBACA,uBACA,UACA,aACA,eACA,eACA,aACA,iBACA,cACA,qBACA,gBACA,cACA,gBACA,YACA,YACA,WACA,SACA,iBACA,sBACA,cACA,cACA,aACA,UACA,cACA,eACA,MACA,eACA,aACA,cACA,gBACA,gBACA,aACA,QACA,kBACA,iBACA,QACA,QACA,WACA,YACA,OACA,WACA,YACA,kBACA,qBACA,mBACA,UACA,OACA,iBACA,MACA,kBACA,OACA,OACA,gBACA,QACA,QACA,YACA,QACA,YACA,QACA,QACA,QACA,OACA,wBACA,cACA,eACA,iBACA,OACA,OACA,SACA,eACA,gBACA,cACA,UACA,OACA,UACA,WACA,YACA,mBACA,mBACA,kBACA,QACA,eACA,aACA,SACA,QACA,YACA,eACA,OACA,MACA,aACA,YACA,SACA,SACA,UACA,SACA,QACA,kBACA,aACA,aACA,UACA,QACA,iBACA,WACA,cACA,iBACA,YACA,aACA,QACA,SACA,gBACA,aACA,YACA,gBACA,gBACA,cACA,sBACA,cACA,sBACA,YACA,oBACA,OACA,WACA,eACA,SACA,SACA,cACA,OACA,aACA,eACA,YACA,2BACA,cACA,kBACA,cACA,cACA,gBACA,qCACA,gCACA,aACA,SACA,SACA,cACA,YACA,SACA,mBACA,oBACA,iBACA,kBACA,oBACA,iBACA,eACA,kBACA,mBACA,gBACA,iBACA,mBACA,gBACA,aACA,cACA,aACA,cACA,QACA,aACA,aACA,aACA,iBACA,cACA,MACA,WACA,UACA,SACA,YACA,SACA,YACA,gBACA,SACA,SACA,WACA,UACA,MACA,WACA,eACA,mBACA,UACA,gBACA,YACA,WACA,YACA,UACA,SACA,aACA,WACA,iBACA,aACA,aACA,UACA,QACA,QACA,WACA,QACA,eACA,cACA,cACA,MACA,UACA,SACA,OACA,eACA,cACA,MACA,OACA,SACA,gBACA,gBACA,UACA,UACA,MACA,YACA,OACA,aACA,gBACA,gBACA,gBACA,OACA,aACA,cACA,kBACA,wBACA,uBACA,wBACA,cACA,gBACA,iBACA,cACA,iBACA,YACA,gBACA,aACA,gBACA,eACA,cACA,iBACA,sBACA,sBACA,qBACA,4BACA,qBACA,yBACA,sBACA,0BACA,aACA,cACA,kBACA,cACA,mBACA,aACA,eACA,gBACA,aACA,aACA,gBACA,wBACA,OACA,WACA,YACA,QACA,QACA,OACA,UACA,YACA,UACA,YACA,kBACA,SACA,QACA,UACA,SACA,YACA,eACA,YACA,gBACA,UACA,iBACA,iBACA,cACA,cACA,SACA,qBACA,iBACA,oBACA,iBACA,qBACA,oBACA,cACA,WACA,cACA,QACA,WACA,eACA,WACA,cACA,eACA,cACA,cACA,SACA,yBACA,UACA,UACA,MACA,YACA,QACA,kBACA,mBACA,cACA,UACA,QACA,QACA,cACA,eACA,YACA,mBACA,kBACA,kBACA,iBACA,kBACA,iBACA,sBACA,sBACA,aACA,mBACA,sBACA,sBACA,6BACA,kBACA,qBACA,qBACA,2BACA,YACA,gBACA,eACA,eACA,OACA,WACA,YACA,YACA,QACA,WACA,OACA,aACA,eACA,gBACA,QACA,SACA,YACA,WACA,SACA,eACA,cACA,YACA,aACA,YACA,aACA,YACA,aACA,YACA,aACA,YACA,aACA,YACA,aACA,YACA,aACA,YACA,aACA,mBACA,mBACA,mBACA,SACA,WACA,eACA,WACA,QACA,iBACA,mBACA,SACA,UACA,YACA,UACA,oBACA,cACA,aACA,2BACA,4BACA,cACA,eACA,UACA,cACA,kBACA,qBACA,UACA,YACA,SACA,iBACA,YACA,iBACA,iBACA,UACA,WACA,SACA,QACA,aACA,YACA,MACA,MACA,MACA,OACA,SACA,iBACA,SACA,aACA,YACA,YACA,eACA,WACA,kBACA,SACA,QACA,QACA,kBACA,oBACA,WACA,QACA,cACA,gBACA,gBACA,wBACA,eACA,UACA,YACA,YACA,SACA,gBACA,eACA,kBACA,oBACA,YACA,YACA,SACA,YACA,SACA,UACA,iBACA,kBACA,iBACA,kBACA,iBACA,kBACA,iBACA,kBACA,2BACA,sBACA,WACA,iBACA,gBACA,mBACA,UACA,cACA,cACA,aACA,OACA,UACA,gBACA,aACA,mBACA,WACA,kBACA,kBACA,kBACA,aACA,kBACA,UACA,aACA,QACA,SACA,OACA,SACA,IACA,OACA,OACA,WACA,QACA,gBACA,YACA,eACA,kBACA,uBACA,2BACA,0BACA,0BACA,gCACA,sBACA,2BACA,gCACA,mBACA,qBACA,8BACA,wBACA,2BACA,mBACA,6BACA,uBACA,wBACA,wBACA,yBACA,2BACA,4BACA,4BACA,yBACA,uBACA,+BACA,oBACA,0BACA,0BACA,yBACA,0BACA,yBACA,iBACA,qBACA,gBACA,wBACA,kBACA,gBACA,kBACA,6BACA,yBACA,yBACA,oCACA,6BACA,8BACA,mCACA,mCACA,yBACA,iCACA,wCACA,oCACA,6BACA,wBACA,wBACA,uBACA,uBACA,wBACA,uCACA,0BACA,0BACA,2BACA,mBACA,yBACA,mBACA,yBACA,yBACA,sBACA,oBACA,uBACA,sBACA,4BACA,qBACA,0BACA,eACA,kBACA,oBACA,yBACA,6BACA,mBACA,iBACA,oBACA,uBACA,mBACA,uBACA,8BACA,kBACA,yBACA,qBACA,aACA,uBACA,wBACA,wBACA,oBACA,sBACA,4BACA,oBACA,yBACA,0BACA,2BACA,oBACA,uBACA,uBACA,0BACA,sBACA,8BACA,0BACA,0BACA,0BACA,2BACA,kCACA,qBACA,oCACA,mBACA,iCACA,cACA,sBACA,0BACA,0BACA,+BACA,+BACA,oBACA,2BACA,yBACA,uBACA,kBACA,wBACA,mBACA,wBACA,2BACA,2BACA,iCACA,YACA,0BACA,mBACA,8BACA,wBACA,sCACA,iBACA,WACA,SACA,aACA,aACA,cACA,cACA,QACA,cACA,aACA,YACA,SACA,QACA,cACA,aACA,eACA,SACA,kBACA,aACA,eACA,YACA,YACA,cACA,WACA,OACA,UACA,QACA,UACA,cACA,IACA,KACA,KACA,mBACA,cACA,gBACA,aACA,UACA,UACA,WACA,IACA,KACA,KACA,mBACA,SACA,IACA,UACA,SACA,OACA,aACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACp7KJ,aAEA,SAASC,EAAWC,GAChB,OAAOA,EAAIC,MAAM,IAGrB,SAASC,EAAOC,EAAMC,GAClB,OAAOA,EAAMC,QAAQF,IAAS,EAGlC,SAASG,EAAQC,EAAMH,GACnB,IAAK,IAAII,EAAI,EAAGC,EAAIL,EAAMM,OAAQF,EAAIC,IAAKD,EACvC,GAAID,EAAKH,EAAMI,IACX,OAAOJ,EAAMI,GAazB,SAASG,EAAsBC,GAC3BC,OAAOC,eAAeF,EAAGG,UAAW,QAAS,CACzCC,IAAK,WACD,IAAIC,EAAM,IAAIC,MAAMC,KAAKC,SACzBH,EAAId,KAAOgB,KAAKhB,KAChB,IACI,MAAMc,EACR,MAAMI,GACJ,OAAOA,EAAEC,UAMzB,SAASC,EAAcC,EAAKC,GACxBN,KAAKC,QAAUI,EACfL,KAAKM,KAAOA,EAWhB,SAASC,EAASC,EAAMF,EAAMG,IACb,IAATD,IACAA,EAAO,IACX,IAAIE,EAAMF,GAAQ,GAClB,GAAIC,EAAO,IAAK,IAAIpB,KAAKqB,EAASC,EAAID,EAAKrB,KAAOsB,EAAIL,EAAMjB,IACxDe,EAAcK,MAAM,IAAMpB,EAAI,8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5nC,MAAQ4nC,EAAQ3b,UAC1CjsB,MAAO,MAAQ4nC,EAAQxuB,OAASwuB,EAAQ5nC,OACxCoZ,OAAQ,MAAQwuB,EAAQvoC,WAAauoC,EAAQxuB,QAC7C/Z,WAAY,MAAQuoC,EAAQle,OAASke,EAAQvoC,YAC7CqqB,OAAQ,MAAQke,EAAQ5wC,IAAM4wC,EAAQle,QACtCkgB,MAAO,MAAQhC,EAAQ5wC,IAAM4wC,EAAQ7wC,SAGzCuuB,EAASn4B,SACTmc,EAAOgc,SAAWA,GAEfhc,EACT,MAAOkC,GACL,MAAO,CAAEq+B,MAAOr+B,GAClB,QACE5W,EAASyC,cAAgBA,IC/PjC3B,EAAe,MAAI2E,GACnB3E,EAAmB,UAAIjF,EACvBiF,EAAsB,aAAIqnB,GAC1BrnB,EAAyB,gBAAIkB,GAC7BlB,EAAoB,WAAI6C,GACxB7C,EAAyB,gBAAI/E,EAC7B+E,EAAoB,WAAIgtB,GACxBhtB,EAAkB,SAAIvH,EACtBuH,EAAgB,OAAIojB,GACpBpjB,EAA2B,kBAAIowB,GAC/BpwB,EAA6B,oBAAIiwB,GACjCjwB,EAAkB,SAAIoxC","sourcesContent":["var domprops = [\n \"$&\",\n \"$'\",\n \"$*\",\n \"$+\",\n \"$1\",\n \"$2\",\n \"$3\",\n \"$4\",\n \"$5\",\n \"$6\",\n \"$7\",\n \"$8\",\n \"$9\",\n \"$_\",\n \"$`\",\n \"$input\",\n \"@@iterator\",\n \"ABORT_ERR\",\n \"ACTIVE\",\n \"ACTIVE_ATTRIBUTES\",\n \"ACTIVE_TEXTURE\",\n \"ACTIVE_UNIFORMS\",\n \"ADDITION\",\n \"ALIASED_LINE_WIDTH_RANGE\",\n \"ALIASED_POINT_SIZE_RANGE\",\n \"ALLOW_KEYBOARD_INPUT\",\n \"ALLPASS\",\n \"ALPHA\",\n \"ALPHA_BITS\",\n \"ALT_MASK\",\n \"ALWAYS\",\n \"ANY_TYPE\",\n \"ANY_UNORDERED_NODE_TYPE\",\n \"ARRAY_BUFFER\",\n \"ARRAY_BUFFER_BINDING\",\n \"ATTACHED_SHADERS\",\n \"ATTRIBUTE_NODE\",\n \"AT_TARGET\",\n \"AddSearchProvider\",\n \"AnalyserNode\",\n \"AnimationEvent\",\n \"AnonXMLHttpRequest\",\n \"ApplicationCache\",\n \"ApplicationCacheErrorEvent\",\n \"Array\",\n \"ArrayBuffer\",\n \"Attr\",\n \"Audio\",\n \"AudioBuffer\",\n \"AudioBufferSourceNode\",\n \"AudioContext\",\n \"AudioDestinationNode\",\n \"AudioListener\",\n \"AudioNode\",\n \"AudioParam\",\n \"AudioProcessingEvent\",\n \"AudioStreamTrack\",\n \"AutocompleteErrorEvent\",\n \"BACK\",\n \"BAD_BOUNDARYPOINTS_ERR\",\n \"BANDPASS\",\n \"BLEND\",\n \"BLEND_COLOR\",\n \"BLEND_DST_ALPHA\",\n \"BLEND_DST_RGB\",\n \"BLEND_EQUATION\",\n \"BLEND_EQUATION_ALPHA\",\n \"BLEND_EQUATION_RGB\",\n \"BLEND_SRC_ALPHA\",\n \"BLEND_SRC_RGB\",\n \"BLUE_BITS\",\n \"BLUR\",\n \"BOOL\",\n \"BOOLEAN_TYPE\",\n \"BOOL_VEC2\",\n \"BOOL_VEC3\",\n \"BOOL_VEC4\",\n \"BOTH\",\n \"BROWSER_DEFAULT_WEBGL\",\n \"BUBBLING_PHASE\",\n \"BUFFER_SIZE\",\n \"BUFFER_USAGE\",\n \"BYTE\",\n \"BYTES_PER_ELEMENT\",\n \"BarProp\",\n \"BaseHref\",\n \"BatteryManager\",\n \"BeforeLoadEvent\",\n \"BeforeUnloadEvent\",\n \"BiquadFilterNode\",\n \"Blob\",\n \"BlobEvent\",\n \"Boolean\",\n \"CAPTURING_PHASE\",\n \"CCW\",\n \"CDATASection\",\n \"CDATA_SECTION_NODE\",\n \"CHANGE\",\n \"CHARSET_RULE\",\n \"CHECKING\",\n \"CLAMP_TO_EDGE\",\n \"CLICK\",\n \"CLOSED\",\n \"CLOSING\",\n \"COLOR_ATTACHMENT0\",\n \"COLOR_BUFFER_BIT\",\n \"COLOR_CLEAR_VALUE\",\n \"COLOR_WRITEMASK\",\n \"COMMENT_NODE\",\n \"COMPILE_STATUS\",\n \"COMPRESSED_RGBA_S3TC_DXT1_EXT\",\n \"COMPRESSED_RGBA_S3TC_DXT3_EXT\",\n \"COMPRESSED_RGBA_S3TC_DXT5_EXT\",\n \"COMPRESSED_RGB_S3TC_DXT1_EXT\",\n \"COMPRESSED_TEXTURE_FORMATS\",\n \"CONNECTING\",\n \"CONSTANT_ALPHA\",\n \"CONSTANT_COLOR\",\n \"CONSTRAINT_ERR\",\n \"CONTEXT_LOST_WEBGL\",\n \"CONTROL_MASK\",\n \"COUNTER_STYLE_RULE\",\n \"CSS\",\n \"CSS2Properties\",\n \"CSSCharsetRule\",\n \"CSSConditionRule\",\n \"CSSCounterStyleRule\",\n \"CSSFontFaceRule\",\n \"CSSFontFeatureValuesRule\",\n \"CSSGroupingRule\",\n \"CSSImportRule\",\n \"CSSKeyframeRule\",\n \"CSSKeyframesRule\",\n \"CSSMediaRule\",\n \"CSSMozDocumentRule\",\n \"CSSNameSpaceRule\",\n \"CSSPageRule\",\n \"CSSPrimitiveValue\",\n \"CSSRule\",\n \"CSSRuleList\",\n \"CSSStyleDeclaration\",\n \"CSSStyleRule\",\n \"CSSStyleSheet\",\n \"CSSSupportsRule\",\n \"CSSUnknownRule\",\n \"CSSValue\",\n \"CSSValueList\",\n \"CSSVariablesDeclaration\",\n \"CSSVariablesRule\",\n \"CSSViewportRule\",\n \"CSS_ATTR\",\n \"CSS_CM\",\n \"CSS_COUNTER\",\n \"CSS_CUSTOM\",\n \"CSS_DEG\",\n \"CSS_DIMENSION\",\n \"CSS_EMS\",\n \"CSS_EXS\",\n \"CSS_FILTER_BLUR\",\n \"CSS_FILTER_BRIGHTNESS\",\n \"CSS_FILTER_CONTRAST\",\n \"CSS_FILTER_CUSTOM\",\n \"CSS_FILTER_DROP_SHADOW\",\n \"CSS_FILTER_GRAYSCALE\",\n \"CSS_FILTER_HUE_ROTATE\",\n \"CSS_FILTER_INVERT\",\n \"CSS_FILTER_OPACITY\",\n \"CSS_FILTER_REFERENCE\",\n \"CSS_FILTER_SATURATE\",\n \"CSS_FILTER_SEPIA\",\n \"CSS_GRAD\",\n \"CSS_HZ\",\n \"CSS_IDENT\",\n \"CSS_IN\",\n \"CSS_INHERIT\",\n \"CSS_KHZ\",\n \"CSS_MATRIX\",\n \"CSS_MATRIX3D\",\n \"CSS_MM\",\n \"CSS_MS\",\n \"CSS_NUMBER\",\n \"CSS_PC\",\n \"CSS_PERCENTAGE\",\n \"CSS_PERSPECTIVE\",\n \"CSS_PRIMITIVE_VALUE\",\n \"CSS_PT\",\n \"CSS_PX\",\n \"CSS_RAD\",\n \"CSS_RECT\",\n \"CSS_RGBCOLOR\",\n \"CSS_ROTATE\",\n \"CSS_ROTATE3D\",\n \"CSS_ROTATEX\",\n \"CSS_ROTATEY\",\n \"CSS_ROTATEZ\",\n \"CSS_S\",\n \"CSS_SCALE\",\n \"CSS_SCALE3D\",\n \"CSS_SCALEX\",\n \"CSS_SCALEY\",\n \"CSS_SCALEZ\",\n \"CSS_SKEW\",\n \"CSS_SKEWX\",\n \"CSS_SKEWY\",\n \"CSS_STRING\",\n \"CSS_TRANSLATE\",\n \"CSS_TRANSLATE3D\",\n \"CSS_TRANSLATEX\",\n \"CSS_TRANSLATEY\",\n \"CSS_TRANSLATEZ\",\n \"CSS_UNKNOWN\",\n \"CSS_URI\",\n \"CSS_VALUE_LIST\",\n \"CSS_VH\",\n \"CSS_VMAX\",\n \"CSS_VMIN\",\n \"CSS_VW\",\n \"CULL_FACE\",\n \"CULL_FACE_MODE\",\n \"CURRENT_PROGRAM\",\n \"CURRENT_VERTEX_ATTRIB\",\n \"CUSTOM\",\n \"CW\",\n \"CanvasGradient\",\n \"CanvasPattern\",\n \"CanvasRenderingContext2D\",\n \"CaretPosition\",\n \"ChannelMergerNode\",\n \"ChannelSplitterNode\",\n \"CharacterData\",\n \"ClientRect\",\n \"ClientRectList\",\n \"Clipboard\",\n \"ClipboardEvent\",\n \"CloseEvent\",\n \"Collator\",\n \"CommandEvent\",\n \"Comment\",\n \"CompositionEvent\",\n \"Console\",\n \"Controllers\",\n \"ConvolverNode\",\n \"Counter\",\n \"Crypto\",\n \"CryptoKey\",\n \"CustomEvent\",\n \"DATABASE_ERR\",\n \"DATA_CLONE_ERR\",\n \"DATA_ERR\",\n \"DBLCLICK\",\n \"DECR\",\n \"DECR_WRAP\",\n \"DELETE_STATUS\",\n \"DEPTH_ATTACHMENT\",\n \"DEPTH_BITS\",\n \"DEPTH_BUFFER_BIT\",\n \"DEPTH_CLEAR_VALUE\",\n \"DEPTH_COMPONENT\",\n \"DEPTH_COMPONENT16\",\n \"DEPTH_FUNC\",\n \"DEPTH_RANGE\",\n \"DEPTH_STENCIL\",\n \"DEPTH_STENCIL_ATTACHMENT\",\n \"DEPTH_TEST\",\n \"DEPTH_WRITEMASK\",\n \"DIRECTION_DOWN\",\n \"DIRECTION_LEFT\",\n \"DIRECTION_RIGHT\",\n \"DIRECTION_UP\",\n \"DISABLED\",\n \"DISPATCH_REQUEST_ERR\",\n \"DITHER\",\n \"DOCUMENT_FRAGMENT_NODE\",\n \"DOCUMENT_NODE\",\n \"DOCUMENT_POSITION_CONTAINED_BY\",\n \"DOCUMENT_POSITION_CONTAINS\",\n \"DOCUMENT_POSITION_DISCONNECTED\",\n \"DOCUMENT_POSITION_FOLLOWING\",\n \"DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC\",\n \"DOCUMENT_POSITION_PRECEDING\",\n \"DOCUMENT_TYPE_NODE\",\n \"DOMCursor\",\n \"DOMError\",\n \"DOMException\",\n \"DOMImplementation\",\n \"DOMImplementationLS\",\n \"DOMMatrix\",\n \"DOMMatrixReadOnly\",\n \"DOMParser\",\n \"DOMPoint\",\n \"DOMPointReadOnly\",\n \"DOMQuad\",\n \"DOMRect\",\n \"DOMRectList\",\n \"DOMRectReadOnly\",\n \"DOMRequest\",\n \"DOMSTRING_SIZE_ERR\",\n \"DOMSettableTokenList\",\n \"DOMStringList\",\n \"DOMStringMap\",\n \"DOMTokenList\",\n \"DOMTransactionEvent\",\n \"DOM_DELTA_LINE\",\n \"DOM_DELTA_PAGE\",\n \"DOM_DELTA_PIXEL\",\n \"DOM_INPUT_METHOD_DROP\",\n \"DOM_INPUT_METHOD_HANDWRITING\",\n \"DOM_INPUT_METHOD_IME\",\n \"DOM_INPUT_METHOD_KEYBOARD\",\n \"DOM_INPUT_METHOD_MULTIMODAL\",\n \"DOM_INPUT_METHOD_OPTION\",\n \"DOM_INPUT_METHOD_PASTE\",\n \"DOM_INPUT_METHOD_SCRIPT\",\n \"DOM_INPUT_METHOD_UNKNOWN\",\n \"DOM_INPUT_METHOD_VOICE\",\n \"DOM_KEY_LOCATION_JOYSTICK\",\n \"DOM_KEY_LOCATION_LEFT\",\n \"DOM_KEY_LOCATION_MOBILE\",\n \"DOM_KEY_LOCATION_NUMPAD\",\n \"DOM_KEY_LOCATION_RIGHT\",\n \"DOM_KEY_LOCATION_STANDARD\",\n \"DOM_VK_0\",\n \"DOM_VK_1\",\n \"DOM_VK_2\",\n \"DOM_VK_3\",\n \"DOM_VK_4\",\n \"DOM_VK_5\",\n \"DOM_VK_6\",\n \"DOM_VK_7\",\n \"DOM_VK_8\",\n \"DOM_VK_9\",\n \"DOM_VK_A\",\n \"DOM_VK_ACCEPT\",\n \"DOM_VK_ADD\",\n \"DOM_VK_ALT\",\n \"DOM_VK_ALTGR\",\n \"DOM_VK_AMPERSAND\",\n \"DOM_VK_ASTERISK\",\n \"DOM_VK_AT\",\n \"DOM_VK_ATTN\",\n \"DOM_VK_B\",\n \"DOM_VK_BACKSPACE\",\n \"DOM_VK_BACK_QUOTE\",\n \"DOM_VK_BACK_SLASH\",\n \"DOM_VK_BACK_SPACE\",\n \"DOM_VK_C\",\n \"DOM_VK_CANCEL\",\n \"DOM_VK_CAPS_LOCK\",\n \"DOM_VK_CIRCUMFLEX\",\n \"DOM_VK_CLEAR\",\n \"DOM_VK_CLOSE_BRACKET\",\n \"DOM_VK_CLOSE_CURLY_BRACKET\",\n \"DOM_VK_CLOSE_PAREN\",\n \"DOM_VK_COLON\",\n \"DOM_VK_COMMA\",\n \"DOM_VK_CONTEXT_MENU\",\n \"DOM_VK_CONTROL\",\n \"DOM_VK_CONVERT\",\n \"DOM_VK_CRSEL\",\n \"DOM_VK_CTRL\",\n \"DOM_VK_D\",\n \"DOM_VK_DECIMAL\",\n \"DOM_VK_DELETE\",\n \"DOM_VK_DIVIDE\",\n \"DOM_VK_DOLLAR\",\n \"DOM_VK_DOUBLE_QUOTE\",\n \"DOM_VK_DOWN\",\n \"DOM_VK_E\",\n \"DOM_VK_EISU\",\n \"DOM_VK_END\",\n \"DOM_VK_ENTER\",\n \"DOM_VK_EQUALS\",\n \"DOM_VK_EREOF\",\n \"DOM_VK_ESCAPE\",\n \"DOM_VK_EXCLAMATION\",\n \"DOM_VK_EXECUTE\",\n \"DOM_VK_EXSEL\",\n \"DOM_VK_F\",\n \"DOM_VK_F1\",\n \"DOM_VK_F10\",\n \"DOM_VK_F11\",\n \"DOM_VK_F12\",\n \"DOM_VK_F13\",\n \"DOM_VK_F14\",\n \"DOM_VK_F15\",\n \"DOM_VK_F16\",\n \"DOM_VK_F17\",\n \"DOM_VK_F18\",\n \"DOM_VK_F19\",\n \"DOM_VK_F2\",\n \"DOM_VK_F20\",\n \"DOM_VK_F21\",\n \"DOM_VK_F22\",\n \"DOM_VK_F23\",\n \"DOM_VK_F24\",\n \"DOM_VK_F25\",\n \"DOM_VK_F26\",\n \"DOM_VK_F27\",\n \"DOM_VK_F28\",\n \"DOM_VK_F29\",\n \"DOM_VK_F3\",\n \"DOM_VK_F30\",\n \"DOM_VK_F31\",\n \"DOM_VK_F32\",\n \"DOM_VK_F33\",\n \"DOM_VK_F34\",\n \"DOM_VK_F35\",\n \"DOM_VK_F36\",\n \"DOM_VK_F4\",\n \"DOM_VK_F5\",\n \"DOM_VK_F6\",\n \"DOM_VK_F7\",\n \"DOM_VK_F8\",\n \"DOM_VK_F9\",\n \"DOM_VK_FINAL\",\n \"DOM_VK_FRONT\",\n \"DOM_VK_G\",\n \"DOM_VK_GREATER_THAN\",\n \"DOM_VK_H\",\n \"DOM_VK_HANGUL\",\n \"DOM_VK_HANJA\",\n \"DOM_VK_HASH\",\n \"DOM_VK_HELP\",\n \"DOM_VK_HK_TOGGLE\",\n \"DOM_VK_HOME\",\n \"DOM_VK_HYPHEN_MINUS\",\n \"DOM_VK_I\",\n \"DOM_VK_INSERT\",\n \"DOM_VK_J\",\n \"DOM_VK_JUNJA\",\n \"DOM_VK_K\",\n \"DOM_VK_KANA\",\n \"DOM_VK_KANJI\",\n \"DOM_VK_L\",\n \"DOM_VK_LEFT\",\n \"DOM_VK_LEFT_TAB\",\n \"DOM_VK_LESS_THAN\",\n \"DOM_VK_M\",\n \"DOM_VK_META\",\n \"DOM_VK_MODECHANGE\",\n \"DOM_VK_MULTIPLY\",\n \"DOM_VK_N\",\n \"DOM_VK_NONCONVERT\",\n \"DOM_VK_NUMPAD0\",\n \"DOM_VK_NUMPAD1\",\n \"DOM_VK_NUMPAD2\",\n \"DOM_VK_NUMPAD3\",\n \"DOM_VK_NUMPAD4\",\n \"DOM_VK_NUMPAD5\",\n \"DOM_VK_NUMPAD6\",\n \"DOM_VK_NUMPAD7\",\n \"DOM_VK_NUMPAD8\",\n \"DOM_VK_NUMPAD9\",\n \"DOM_VK_NUM_LOCK\",\n \"DOM_VK_O\",\n \"DOM_VK_OEM_1\",\n \"DOM_VK_OEM_102\",\n \"DOM_VK_OEM_2\",\n \"DOM_VK_OEM_3\",\n \"DOM_VK_OEM_4\",\n \"DOM_VK_OEM_5\",\n \"DOM_VK_OEM_6\",\n \"DOM_VK_OEM_7\",\n \"DOM_VK_OEM_8\",\n \"DOM_VK_OEM_COMMA\",\n \"DOM_VK_OEM_MINUS\",\n \"DOM_VK_OEM_PERIOD\",\n \"DOM_VK_OEM_PLUS\",\n \"DOM_VK_OPEN_BRACKET\",\n \"DOM_VK_OPEN_CURLY_BRACKET\",\n \"DOM_VK_OPEN_PAREN\",\n \"DOM_VK_P\",\n \"DOM_VK_PA1\",\n \"DOM_VK_PAGEDOWN\",\n \"DOM_VK_PAGEUP\",\n \"DOM_VK_PAGE_DOWN\",\n \"DOM_VK_PAGE_UP\",\n \"DOM_VK_PAUSE\",\n \"DOM_VK_PERCENT\",\n \"DOM_VK_PERIOD\",\n \"DOM_VK_PIPE\",\n \"DOM_VK_PLAY\",\n \"DOM_VK_PLUS\",\n \"DOM_VK_PRINT\",\n \"DOM_VK_PRINTSCREEN\",\n \"DOM_VK_PROCESSKEY\",\n \"DOM_VK_PROPERITES\",\n \"DOM_VK_Q\",\n \"DOM_VK_QUESTION_MARK\",\n \"DOM_VK_QUOTE\",\n \"DOM_VK_R\",\n \"DOM_VK_REDO\",\n \"DOM_VK_RETURN\",\n \"DOM_VK_RIGHT\",\n \"DOM_VK_S\",\n \"DOM_VK_SCROLL_LOCK\",\n \"DOM_VK_SELECT\",\n \"DOM_VK_SEMICOLON\",\n \"DOM_VK_SEPARATOR\",\n \"DOM_VK_SHIFT\",\n \"DOM_VK_SLASH\",\n \"DOM_VK_SLEEP\",\n \"DOM_VK_SPACE\",\n \"DOM_VK_SUBTRACT\",\n \"DOM_VK_T\",\n \"DOM_VK_TAB\",\n \"DOM_VK_TILDE\",\n \"DOM_VK_U\",\n \"DOM_VK_UNDERSCORE\",\n \"DOM_VK_UNDO\",\n \"DOM_VK_UNICODE\",\n \"DOM_VK_UP\",\n \"DOM_VK_V\",\n \"DOM_VK_VOLUME_DOWN\",\n \"DOM_VK_VOLUME_MUTE\",\n \"DOM_VK_VOLUME_UP\",\n \"DOM_VK_W\",\n \"DOM_VK_WIN\",\n \"DOM_VK_WINDOW\",\n \"DOM_VK_WIN_ICO_00\",\n \"DOM_VK_WIN_ICO_CLEAR\",\n \"DOM_VK_WIN_ICO_HELP\",\n \"DOM_VK_WIN_OEM_ATTN\",\n \"DOM_VK_WIN_OEM_AUTO\",\n \"DOM_VK_WIN_OEM_BACKTAB\",\n \"DOM_VK_WIN_OEM_CLEAR\",\n \"DOM_VK_WIN_OEM_COPY\",\n \"DOM_VK_WIN_OEM_CUSEL\",\n \"DOM_VK_WIN_OEM_ENLW\",\n \"DOM_VK_WIN_OEM_FINISH\",\n \"DOM_VK_WIN_OEM_FJ_JISHO\",\n \"DOM_VK_WIN_OEM_FJ_LOYA\",\n \"DOM_VK_WIN_OEM_FJ_MASSHOU\",\n \"DOM_VK_WIN_OEM_FJ_ROYA\",\n \"DOM_VK_WIN_OEM_FJ_TOUROKU\",\n \"DOM_VK_WIN_OEM_JUMP\",\n \"DOM_VK_WIN_OEM_PA1\",\n \"DOM_VK_WIN_OEM_PA2\",\n \"DOM_VK_WIN_OEM_PA3\",\n \"DOM_VK_WIN_OEM_RESET\",\n \"DOM_VK_WIN_OEM_WSCTRL\",\n \"DOM_VK_X\",\n \"DOM_VK_XF86XK_ADD_FAVORITE\",\n \"DOM_VK_XF86XK_APPLICATION_LEFT\",\n \"DOM_VK_XF86XK_APPLICATION_RIGHT\",\n \"DOM_VK_XF86XK_AUDIO_CYCLE_TRACK\",\n \"DOM_VK_XF86XK_AUDIO_FORWARD\",\n \"DOM_VK_XF86XK_AUDIO_LOWER_VOLUME\",\n \"DOM_VK_XF86XK_AUDIO_MEDIA\",\n \"DOM_VK_XF86XK_AUDIO_MUTE\",\n \"DOM_VK_XF86XK_AUDIO_NEXT\",\n \"DOM_VK_XF86XK_AUDIO_PAUSE\",\n \"DOM_VK_XF86XK_AUDIO_PLAY\",\n \"DOM_VK_XF86XK_AUDIO_PREV\",\n \"DOM_VK_XF86XK_AUDIO_RAISE_VOLUME\",\n \"DOM_VK_XF86XK_AUDIO_RANDOM_PLAY\",\n \"DOM_VK_XF86XK_AUDIO_RECORD\",\n \"DOM_VK_XF86XK_AUDIO_REPEAT\",\n \"DOM_VK_XF86XK_AUDIO_REWIND\",\n \"DOM_VK_XF86XK_AUDIO_STOP\",\n \"DOM_VK_XF86XK_AWAY\",\n \"DOM_VK_XF86XK_BACK\",\n \"DOM_VK_XF86XK_BACK_FORWARD\",\n \"DOM_VK_XF86XK_BATTERY\",\n \"DOM_VK_XF86XK_BLUE\",\n \"DOM_VK_XF86XK_BLUETOOTH\",\n \"DOM_VK_XF86XK_BOOK\",\n \"DOM_VK_XF86XK_BRIGHTNESS_ADJUST\",\n \"DOM_VK_XF86XK_CALCULATOR\",\n \"DOM_VK_XF86XK_CALENDAR\",\n \"DOM_VK_XF86XK_CD\",\n \"DOM_VK_XF86XK_CLOSE\",\n \"DOM_VK_XF86XK_COMMUNITY\",\n \"DOM_VK_XF86XK_CONTRAST_ADJUST\",\n \"DOM_VK_XF86XK_COPY\",\n \"DOM_VK_XF86XK_CUT\",\n \"DOM_VK_XF86XK_CYCLE_ANGLE\",\n \"DOM_VK_XF86XK_DISPLAY\",\n \"DOM_VK_XF86XK_DOCUMENTS\",\n \"DOM_VK_XF86XK_DOS\",\n \"DOM_VK_XF86XK_EJECT\",\n \"DOM_VK_XF86XK_EXCEL\",\n \"DOM_VK_XF86XK_EXPLORER\",\n \"DOM_VK_XF86XK_FAVORITES\",\n \"DOM_VK_XF86XK_FINANCE\",\n \"DOM_VK_XF86XK_FORWARD\",\n \"DOM_VK_XF86XK_FRAME_BACK\",\n \"DOM_VK_XF86XK_FRAME_FORWARD\",\n \"DOM_VK_XF86XK_GAME\",\n \"DOM_VK_XF86XK_GO\",\n \"DOM_VK_XF86XK_GREEN\",\n \"DOM_VK_XF86XK_HIBERNATE\",\n \"DOM_VK_XF86XK_HISTORY\",\n \"DOM_VK_XF86XK_HOME_PAGE\",\n \"DOM_VK_XF86XK_HOT_LINKS\",\n \"DOM_VK_XF86XK_I_TOUCH\",\n \"DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN\",\n \"DOM_VK_XF86XK_KBD_BRIGHTNESS_UP\",\n \"DOM_VK_XF86XK_KBD_LIGHT_ON_OFF\",\n \"DOM_VK_XF86XK_LAUNCH0\",\n \"DOM_VK_XF86XK_LAUNCH1\",\n \"DOM_VK_XF86XK_LAUNCH2\",\n \"DOM_VK_XF86XK_LAUNCH3\",\n \"DOM_VK_XF86XK_LAUNCH4\",\n \"DOM_VK_XF86XK_LAUNCH5\",\n \"DOM_VK_XF86XK_LAUNCH6\",\n \"DOM_VK_XF86XK_LAUNCH7\",\n \"DOM_VK_XF86XK_LAUNCH8\",\n \"DOM_VK_XF86XK_LAUNCH9\",\n \"DOM_VK_XF86XK_LAUNCH_A\",\n \"DOM_VK_XF86XK_LAUNCH_B\",\n \"DOM_VK_XF86XK_LAUNCH_C\",\n \"DOM_VK_XF86XK_LAUNCH_D\",\n \"DOM_VK_XF86XK_LAUNCH_E\",\n \"DOM_VK_XF86XK_LAUNCH_F\",\n \"DOM_VK_XF86XK_LIGHT_BULB\",\n \"DOM_VK_XF86XK_LOG_OFF\",\n \"DOM_VK_XF86XK_MAIL\",\n \"DOM_VK_XF86XK_MAIL_FORWARD\",\n \"DOM_VK_XF86XK_MARKET\",\n \"DOM_VK_XF86XK_MEETING\",\n \"DOM_VK_XF86XK_MEMO\",\n \"DOM_VK_XF86XK_MENU_KB\",\n \"DOM_VK_XF86XK_MENU_PB\",\n \"DOM_VK_XF86XK_MESSENGER\",\n \"DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN\",\n \"DOM_VK_XF86XK_MON_BRIGHTNESS_UP\",\n \"DOM_VK_XF86XK_MUSIC\",\n \"DOM_VK_XF86XK_MY_COMPUTER\",\n \"DOM_VK_XF86XK_MY_SITES\",\n \"DOM_VK_XF86XK_NEW\",\n \"DOM_VK_XF86XK_NEWS\",\n \"DOM_VK_XF86XK_OFFICE_HOME\",\n \"DOM_VK_XF86XK_OPEN\",\n \"DOM_VK_XF86XK_OPEN_URL\",\n \"DOM_VK_XF86XK_OPTION\",\n \"DOM_VK_XF86XK_PASTE\",\n \"DOM_VK_XF86XK_PHONE\",\n \"DOM_VK_XF86XK_PICTURES\",\n \"DOM_VK_XF86XK_POWER_DOWN\",\n \"DOM_VK_XF86XK_POWER_OFF\",\n \"DOM_VK_XF86XK_RED\",\n \"DOM_VK_XF86XK_REFRESH\",\n \"DOM_VK_XF86XK_RELOAD\",\n \"DOM_VK_XF86XK_REPLY\",\n \"DOM_VK_XF86XK_ROCKER_DOWN\",\n \"DOM_VK_XF86XK_ROCKER_ENTER\",\n \"DOM_VK_XF86XK_ROCKER_UP\",\n \"DOM_VK_XF86XK_ROTATE_WINDOWS\",\n \"DOM_VK_XF86XK_ROTATION_KB\",\n \"DOM_VK_XF86XK_ROTATION_PB\",\n \"DOM_VK_XF86XK_SAVE\",\n \"DOM_VK_XF86XK_SCREEN_SAVER\",\n \"DOM_VK_XF86XK_SCROLL_CLICK\",\n \"DOM_VK_XF86XK_SCROLL_DOWN\",\n \"DOM_VK_XF86XK_SCROLL_UP\",\n \"DOM_VK_XF86XK_SEARCH\",\n \"DOM_VK_XF86XK_SEND\",\n \"DOM_VK_XF86XK_SHOP\",\n \"DOM_VK_XF86XK_SPELL\",\n \"DOM_VK_XF86XK_SPLIT_SCREEN\",\n \"DOM_VK_XF86XK_STANDBY\",\n \"DOM_VK_XF86XK_START\",\n \"DOM_VK_XF86XK_STOP\",\n \"DOM_VK_XF86XK_SUBTITLE\",\n \"DOM_VK_XF86XK_SUPPORT\",\n \"DOM_VK_XF86XK_SUSPEND\",\n \"DOM_VK_XF86XK_TASK_PANE\",\n \"DOM_VK_XF86XK_TERMINAL\",\n \"DOM_VK_XF86XK_TIME\",\n \"DOM_VK_XF86XK_TOOLS\",\n \"DOM_VK_XF86XK_TOP_MENU\",\n \"DOM_VK_XF86XK_TO_DO_LIST\",\n \"DOM_VK_XF86XK_TRAVEL\",\n \"DOM_VK_XF86XK_USER1KB\",\n \"DOM_VK_XF86XK_USER2KB\",\n \"DOM_VK_XF86XK_USER_PB\",\n \"DOM_VK_XF86XK_UWB\",\n \"DOM_VK_XF86XK_VENDOR_HOME\",\n \"DOM_VK_XF86XK_VIDEO\",\n \"DOM_VK_XF86XK_VIEW\",\n \"DOM_VK_XF86XK_WAKE_UP\",\n \"DOM_VK_XF86XK_WEB_CAM\",\n \"DOM_VK_XF86XK_WHEEL_BUTTON\",\n \"DOM_VK_XF86XK_WLAN\",\n \"DOM_VK_XF86XK_WORD\",\n \"DOM_VK_XF86XK_WWW\",\n \"DOM_VK_XF86XK_XFER\",\n \"DOM_VK_XF86XK_YELLOW\",\n \"DOM_VK_XF86XK_ZOOM_IN\",\n \"DOM_VK_XF86XK_ZOOM_OUT\",\n \"DOM_VK_Y\",\n \"DOM_VK_Z\",\n \"DOM_VK_ZOOM\",\n \"DONE\",\n \"DONT_CARE\",\n \"DOWNLOADING\",\n \"DRAGDROP\",\n \"DST_ALPHA\",\n \"DST_COLOR\",\n \"DYNAMIC_DRAW\",\n \"DataChannel\",\n \"DataTransfer\",\n \"DataTransferItem\",\n \"DataTransferItemList\",\n \"DataView\",\n \"Date\",\n \"DateTimeFormat\",\n \"DelayNode\",\n \"DesktopNotification\",\n \"DesktopNotificationCenter\",\n \"DeviceLightEvent\",\n \"DeviceMotionEvent\",\n \"DeviceOrientationEvent\",\n \"DeviceProximityEvent\",\n \"DeviceStorage\",\n \"DeviceStorageChangeEvent\",\n \"Document\",\n \"DocumentFragment\",\n \"DocumentType\",\n \"DragEvent\",\n \"DynamicsCompressorNode\",\n \"E\",\n \"ELEMENT_ARRAY_BUFFER\",\n \"ELEMENT_ARRAY_BUFFER_BINDING\",\n \"ELEMENT_NODE\",\n \"EMPTY\",\n \"ENCODING_ERR\",\n \"ENDED\",\n \"END_TO_END\",\n \"END_TO_START\",\n \"ENTITY_NODE\",\n \"ENTITY_REFERENCE_NODE\",\n \"EPSILON\",\n \"EQUAL\",\n \"EQUALPOWER\",\n \"ERROR\",\n \"EXPONENTIAL_DISTANCE\",\n \"Element\",\n \"ElementQuery\",\n \"Entity\",\n \"EntityReference\",\n \"Error\",\n \"ErrorEvent\",\n \"EvalError\",\n \"Event\",\n \"EventException\",\n \"EventSource\",\n \"EventTarget\",\n \"External\",\n \"FASTEST\",\n \"FIDOSDK\",\n \"FILTER_ACCEPT\",\n \"FILTER_INTERRUPT\",\n \"FILTER_REJECT\",\n \"FILTER_SKIP\",\n \"FINISHED_STATE\",\n \"FIRST_ORDERED_NODE_TYPE\",\n \"FLOAT\",\n \"FLOAT_MAT2\",\n \"FLOAT_MAT3\",\n \"FLOAT_MAT4\",\n \"FLOAT_VEC2\",\n \"FLOAT_VEC3\",\n \"FLOAT_VEC4\",\n \"FOCUS\",\n \"FONT_FACE_RULE\",\n \"FONT_FEATURE_VALUES_RULE\",\n \"FRAGMENT_SHADER\",\n \"FRAGMENT_SHADER_DERIVATIVE_HINT_OES\",\n \"FRAMEBUFFER\",\n \"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\",\n \"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\",\n \"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\",\n \"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\",\n \"FRAMEBUFFER_BINDING\",\n \"FRAMEBUFFER_COMPLETE\",\n \"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\",\n \"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\",\n \"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\",\n \"FRAMEBUFFER_UNSUPPORTED\",\n \"FRONT\",\n \"FRONT_AND_BACK\",\n \"FRONT_FACE\",\n \"FUNC_ADD\",\n \"FUNC_REVERSE_SUBTRACT\",\n \"FUNC_SUBTRACT\",\n \"Feed\",\n \"FeedEntry\",\n \"File\",\n \"FileError\",\n \"FileList\",\n \"FileReader\",\n \"FindInPage\",\n \"Float32Array\",\n \"Float64Array\",\n \"FocusEvent\",\n \"FontFace\",\n \"FormData\",\n \"Function\",\n \"GENERATE_MIPMAP_HINT\",\n \"GEQUAL\",\n \"GREATER\",\n \"GREEN_BITS\",\n \"GainNode\",\n \"Gamepad\",\n \"GamepadButton\",\n \"GamepadEvent\",\n \"GestureEvent\",\n \"HAVE_CURRENT_DATA\",\n \"HAVE_ENOUGH_DATA\",\n \"HAVE_FUTURE_DATA\",\n \"HAVE_METADATA\",\n \"HAVE_NOTHING\",\n \"HEADERS_RECEIVED\",\n \"HIDDEN\",\n \"HIERARCHY_REQUEST_ERR\",\n \"HIGHPASS\",\n \"HIGHSHELF\",\n \"HIGH_FLOAT\",\n \"HIGH_INT\",\n \"HORIZONTAL\",\n \"HORIZONTAL_AXIS\",\n \"HRTF\",\n \"HTMLAllCollection\",\n \"HTMLAnchorElement\",\n \"HTMLAppletElement\",\n \"HTMLAreaElement\",\n \"HTMLAudioElement\",\n \"HTMLBRElement\",\n \"HTMLBaseElement\",\n \"HTMLBaseFontElement\",\n \"HTMLBlockquoteElement\",\n \"HTMLBodyElement\",\n \"HTMLButtonElement\",\n \"HTMLCanvasElement\",\n \"HTMLCollection\",\n \"HTMLCommandElement\",\n \"HTMLContentElement\",\n \"HTMLDListElement\",\n \"HTMLDataElement\",\n \"HTMLDataListElement\",\n \"HTMLDetailsElement\",\n \"HTMLDialogElement\",\n \"HTMLDirectoryElement\",\n \"HTMLDivElement\",\n \"HTMLDocument\",\n \"HTMLElement\",\n \"HTMLEmbedElement\",\n \"HTMLFieldSetElement\",\n \"HTMLFontElement\",\n \"HTMLFormControlsCollection\",\n \"HTMLFormElement\",\n \"HTMLFrameElement\",\n \"HTMLFrameSetElement\",\n \"HTMLHRElement\",\n \"HTMLHeadElement\",\n \"HTMLHeadingElement\",\n \"HTMLHtmlElement\",\n \"HTMLIFrameElement\",\n \"HTMLImageElement\",\n \"HTMLInputElement\",\n \"HTMLIsIndexElement\",\n \"HTMLKeygenElement\",\n \"HTMLLIElement\",\n \"HTMLLabelElement\",\n \"HTMLLegendElement\",\n \"HTMLLinkElement\",\n \"HTMLMapElement\",\n \"HTMLMarqueeElement\",\n \"HTMLMediaElement\",\n \"HTMLMenuElement\",\n \"HTMLMenuItemElement\",\n \"HTMLMetaElement\",\n \"HTMLMeterElement\",\n \"HTMLModElement\",\n \"HTMLOListElement\",\n \"HTMLObjectElement\",\n \"HTMLOptGroupElement\",\n \"HTMLOptionElement\",\n \"HTMLOptionsCollection\",\n \"HTMLOutputElement\",\n \"HTMLParagraphElement\",\n \"HTMLParamElement\",\n \"HTMLPictureElement\",\n \"HTMLPreElement\",\n \"HTMLProgressElement\",\n \"HTMLPropertiesCollection\",\n \"HTMLQuoteElement\",\n \"HTMLScriptElement\",\n \"HTMLSelectElement\",\n \"HTMLShadowElement\",\n \"HTMLSourceElement\",\n \"HTMLSpanElement\",\n \"HTMLStyleElement\",\n \"HTMLTableCaptionElement\",\n \"HTMLTableCellElement\",\n \"HTMLTableColElement\",\n \"HTMLTableElement\",\n \"HTMLTableRowElement\",\n \"HTMLTableSectionElement\",\n \"HTMLTemplateElement\",\n \"HTMLTextAreaElement\",\n \"HTMLTimeElement\",\n \"HTMLTitleElement\",\n \"HTMLTrackElement\",\n \"HTMLUListElement\",\n \"HTMLUnknownElement\",\n \"HTMLVideoElement\",\n \"HashChangeEvent\",\n \"Headers\",\n \"History\",\n \"ICE_CHECKING\",\n \"ICE_CLOSED\",\n \"ICE_COMPLETED\",\n \"ICE_CONNECTED\",\n \"ICE_FAILED\",\n \"ICE_GATHERING\",\n \"ICE_WAITING\",\n \"IDBCursor\",\n \"IDBCursorWithValue\",\n \"IDBDatabase\",\n \"IDBDatabaseException\",\n \"IDBFactory\",\n \"IDBFileHandle\",\n \"IDBFileRequest\",\n \"IDBIndex\",\n \"IDBKeyRange\",\n \"IDBMutableFile\",\n \"IDBObjectStore\",\n \"IDBOpenDBRequest\",\n \"IDBRequest\",\n \"IDBTransaction\",\n \"IDBVersionChangeEvent\",\n \"IDLE\",\n \"IMPLEMENTATION_COLOR_READ_FORMAT\",\n \"IMPLEMENTATION_COLOR_READ_TYPE\",\n \"IMPORT_RULE\",\n \"INCR\",\n \"INCR_WRAP\",\n \"INDEX_SIZE_ERR\",\n \"INT\",\n \"INT_VEC2\",\n \"INT_VEC3\",\n \"INT_VEC4\",\n \"INUSE_ATTRIBUTE_ERR\",\n \"INVALID_ACCESS_ERR\",\n \"INVALID_CHARACTER_ERR\",\n \"INVALID_ENUM\",\n \"INVALID_EXPRESSION_ERR\",\n \"INVALID_FRAMEBUFFER_OPERATION\",\n \"INVALID_MODIFICATION_ERR\",\n \"INVALID_NODE_TYPE_ERR\",\n \"INVALID_OPERATION\",\n \"INVALID_STATE_ERR\",\n \"INVALID_VALUE\",\n \"INVERSE_DISTANCE\",\n \"INVERT\",\n \"IceCandidate\",\n \"Image\",\n \"ImageBitmap\",\n \"ImageData\",\n \"Infinity\",\n \"InputEvent\",\n \"InputMethodContext\",\n \"InstallTrigger\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"Intent\",\n \"InternalError\",\n \"Intl\",\n \"IsSearchProviderInstalled\",\n \"Iterator\",\n \"JSON\",\n \"KEEP\",\n \"KEYDOWN\",\n \"KEYFRAMES_RULE\",\n \"KEYFRAME_RULE\",\n \"KEYPRESS\",\n \"KEYUP\",\n \"KeyEvent\",\n \"KeyboardEvent\",\n \"LENGTHADJUST_SPACING\",\n \"LENGTHADJUST_SPACINGANDGLYPHS\",\n \"LENGTHADJUST_UNKNOWN\",\n \"LEQUAL\",\n \"LESS\",\n \"LINEAR\",\n \"LINEAR_DISTANCE\",\n \"LINEAR_MIPMAP_LINEAR\",\n \"LINEAR_MIPMAP_NEAREST\",\n \"LINES\",\n \"LINE_LOOP\",\n \"LINE_STRIP\",\n \"LINE_WIDTH\",\n \"LINK_STATUS\",\n \"LIVE\",\n \"LN10\",\n \"LN2\",\n \"LOADED\",\n \"LOADING\",\n \"LOG10E\",\n \"LOG2E\",\n \"LOWPASS\",\n \"LOWSHELF\",\n \"LOW_FLOAT\",\n \"LOW_INT\",\n \"LSException\",\n \"LSParserFilter\",\n \"LUMINANCE\",\n \"LUMINANCE_ALPHA\",\n \"LocalMediaStream\",\n \"Location\",\n \"MAX_COMBINED_TEXTURE_IMAGE_UNITS\",\n \"MAX_CUBE_MAP_TEXTURE_SIZE\",\n \"MAX_FRAGMENT_UNIFORM_VECTORS\",\n \"MAX_RENDERBUFFER_SIZE\",\n \"MAX_SAFE_INTEGER\",\n \"MAX_TEXTURE_IMAGE_UNITS\",\n \"MAX_TEXTURE_MAX_ANISOTROPY_EXT\",\n \"MAX_TEXTURE_SIZE\",\n \"MAX_VALUE\",\n \"MAX_VARYING_VECTORS\",\n \"MAX_VERTEX_ATTRIBS\",\n \"MAX_VERTEX_TEXTURE_IMAGE_UNITS\",\n \"MAX_VERTEX_UNIFORM_VECTORS\",\n \"MAX_VIEWPORT_DIMS\",\n \"MEDIA_ERR_ABORTED\",\n \"MEDIA_ERR_DECODE\",\n \"MEDIA_ERR_ENCRYPTED\",\n \"MEDIA_ERR_NETWORK\",\n \"MEDIA_ERR_SRC_NOT_SUPPORTED\",\n \"MEDIA_KEYERR_CLIENT\",\n \"MEDIA_KEYERR_DOMAIN\",\n \"MEDIA_KEYERR_HARDWARECHANGE\",\n \"MEDIA_KEYERR_OUTPUT\",\n \"MEDIA_KEYERR_SERVICE\",\n \"MEDIA_KEYERR_UNKNOWN\",\n \"MEDIA_RULE\",\n \"MEDIUM_FLOAT\",\n \"MEDIUM_INT\",\n \"META_MASK\",\n \"MIN_SAFE_INTEGER\",\n \"MIN_VALUE\",\n \"MIRRORED_REPEAT\",\n \"MODE_ASYNCHRONOUS\",\n \"MODE_SYNCHRONOUS\",\n \"MODIFICATION\",\n \"MOUSEDOWN\",\n \"MOUSEDRAG\",\n \"MOUSEMOVE\",\n \"MOUSEOUT\",\n \"MOUSEOVER\",\n \"MOUSEUP\",\n \"MOZ_KEYFRAMES_RULE\",\n \"MOZ_KEYFRAME_RULE\",\n \"MOZ_SOURCE_CURSOR\",\n \"MOZ_SOURCE_ERASER\",\n \"MOZ_SOURCE_KEYBOARD\",\n \"MOZ_SOURCE_MOUSE\",\n \"MOZ_SOURCE_PEN\",\n \"MOZ_SOURCE_TOUCH\",\n \"MOZ_SOURCE_UNKNOWN\",\n \"MSGESTURE_FLAG_BEGIN\",\n \"MSGESTURE_FLAG_CANCEL\",\n \"MSGESTURE_FLAG_END\",\n \"MSGESTURE_FLAG_INERTIA\",\n \"MSGESTURE_FLAG_NONE\",\n \"MSPOINTER_TYPE_MOUSE\",\n \"MSPOINTER_TYPE_PEN\",\n \"MSPOINTER_TYPE_TOUCH\",\n \"MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE\",\n \"MS_ASYNC_CALLBACK_STATUS_CANCEL\",\n \"MS_ASYNC_CALLBACK_STATUS_CHOOSEANY\",\n \"MS_ASYNC_CALLBACK_STATUS_ERROR\",\n \"MS_ASYNC_CALLBACK_STATUS_JOIN\",\n \"MS_ASYNC_OP_STATUS_CANCELED\",\n \"MS_ASYNC_OP_STATUS_ERROR\",\n \"MS_ASYNC_OP_STATUS_SUCCESS\",\n \"MS_MANIPULATION_STATE_ACTIVE\",\n \"MS_MANIPULATION_STATE_CANCELLED\",\n \"MS_MANIPULATION_STATE_COMMITTED\",\n \"MS_MANIPULATION_STATE_DRAGGING\",\n \"MS_MANIPULATION_STATE_INERTIA\",\n \"MS_MANIPULATION_STATE_PRESELECT\",\n \"MS_MANIPULATION_STATE_SELECTING\",\n \"MS_MANIPULATION_STATE_STOPPED\",\n \"MS_MEDIA_ERR_ENCRYPTED\",\n \"MS_MEDIA_KEYERR_CLIENT\",\n \"MS_MEDIA_KEYERR_DOMAIN\",\n \"MS_MEDIA_KEYERR_HARDWARECHANGE\",\n \"MS_MEDIA_KEYERR_OUTPUT\",\n \"MS_MEDIA_KEYERR_SERVICE\",\n \"MS_MEDIA_KEYERR_UNKNOWN\",\n \"Map\",\n \"Math\",\n \"MediaController\",\n \"MediaDevices\",\n \"MediaElementAudioSourceNode\",\n \"MediaEncryptedEvent\",\n \"MediaError\",\n \"MediaKeyError\",\n \"MediaKeyEvent\",\n \"MediaKeyMessageEvent\",\n \"MediaKeyNeededEvent\",\n \"MediaKeySession\",\n \"MediaKeyStatusMap\",\n \"MediaKeySystemAccess\",\n \"MediaKeys\",\n \"MediaList\",\n \"MediaQueryList\",\n \"MediaQueryListEvent\",\n \"MediaRecorder\",\n \"MediaSource\",\n \"MediaStream\",\n \"MediaStreamAudioDestinationNode\",\n \"MediaStreamAudioSourceNode\",\n \"MediaStreamEvent\",\n \"MediaStreamTrack\",\n \"MediaStreamTrackEvent\",\n \"MessageChannel\",\n \"MessageEvent\",\n \"MessagePort\",\n \"Methods\",\n \"MimeType\",\n \"MimeTypeArray\",\n \"MouseEvent\",\n \"MouseScrollEvent\",\n \"MozAnimation\",\n \"MozAnimationDelay\",\n \"MozAnimationDirection\",\n \"MozAnimationDuration\",\n \"MozAnimationFillMode\",\n \"MozAnimationIterationCount\",\n \"MozAnimationName\",\n \"MozAnimationPlayState\",\n \"MozAnimationTimingFunction\",\n \"MozAppearance\",\n \"MozBackfaceVisibility\",\n \"MozBinding\",\n \"MozBorderBottomColors\",\n \"MozBorderEnd\",\n \"MozBorderEndColor\",\n \"MozBorderEndStyle\",\n \"MozBorderEndWidth\",\n \"MozBorderImage\",\n \"MozBorderLeftColors\",\n \"MozBorderRightColors\",\n \"MozBorderStart\",\n \"MozBorderStartColor\",\n \"MozBorderStartStyle\",\n \"MozBorderStartWidth\",\n \"MozBorderTopColors\",\n \"MozBoxAlign\",\n \"MozBoxDirection\",\n \"MozBoxFlex\",\n \"MozBoxOrdinalGroup\",\n \"MozBoxOrient\",\n \"MozBoxPack\",\n \"MozBoxSizing\",\n \"MozCSSKeyframeRule\",\n \"MozCSSKeyframesRule\",\n \"MozColumnCount\",\n \"MozColumnFill\",\n \"MozColumnGap\",\n \"MozColumnRule\",\n \"MozColumnRuleColor\",\n \"MozColumnRuleStyle\",\n \"MozColumnRuleWidth\",\n \"MozColumnWidth\",\n \"MozColumns\",\n \"MozContactChangeEvent\",\n \"MozFloatEdge\",\n \"MozFontFeatureSettings\",\n \"MozFontLanguageOverride\",\n \"MozForceBrokenImageIcon\",\n \"MozHyphens\",\n \"MozImageRegion\",\n \"MozMarginEnd\",\n \"MozMarginStart\",\n \"MozMmsEvent\",\n \"MozMmsMessage\",\n \"MozMobileMessageThread\",\n \"MozOSXFontSmoothing\",\n \"MozOrient\",\n \"MozOutlineRadius\",\n \"MozOutlineRadiusBottomleft\",\n \"MozOutlineRadiusBottomright\",\n \"MozOutlineRadiusTopleft\",\n \"MozOutlineRadiusTopright\",\n \"MozPaddingEnd\",\n \"MozPaddingStart\",\n \"MozPerspective\",\n \"MozPerspectiveOrigin\",\n \"MozPowerManager\",\n \"MozSettingsEvent\",\n \"MozSmsEvent\",\n \"MozSmsMessage\",\n \"MozStackSizing\",\n \"MozTabSize\",\n \"MozTextAlignLast\",\n \"MozTextDecorationColor\",\n \"MozTextDecorationLine\",\n \"MozTextDecorationStyle\",\n \"MozTextSizeAdjust\",\n \"MozTransform\",\n \"MozTransformOrigin\",\n \"MozTransformStyle\",\n \"MozTransition\",\n \"MozTransitionDelay\",\n \"MozTransitionDuration\",\n \"MozTransitionProperty\",\n \"MozTransitionTimingFunction\",\n \"MozUserFocus\",\n \"MozUserInput\",\n \"MozUserModify\",\n \"MozUserSelect\",\n \"MozWindowDragging\",\n \"MozWindowShadow\",\n \"MutationEvent\",\n \"MutationObserver\",\n \"MutationRecord\",\n \"NAMESPACE_ERR\",\n \"NAMESPACE_RULE\",\n \"NEAREST\",\n \"NEAREST_MIPMAP_LINEAR\",\n \"NEAREST_MIPMAP_NEAREST\",\n \"NEGATIVE_INFINITY\",\n \"NETWORK_EMPTY\",\n \"NETWORK_ERR\",\n \"NETWORK_IDLE\",\n \"NETWORK_LOADED\",\n \"NETWORK_LOADING\",\n \"NETWORK_NO_SOURCE\",\n \"NEVER\",\n \"NEW\",\n \"NEXT\",\n \"NEXT_NO_DUPLICATE\",\n \"NICEST\",\n \"NODE_AFTER\",\n \"NODE_BEFORE\",\n \"NODE_BEFORE_AND_AFTER\",\n \"NODE_INSIDE\",\n \"NONE\",\n \"NON_TRANSIENT_ERR\",\n \"NOTATION_NODE\",\n \"NOTCH\",\n \"NOTEQUAL\",\n \"NOT_ALLOWED_ERR\",\n \"NOT_FOUND_ERR\",\n \"NOT_READABLE_ERR\",\n \"NOT_SUPPORTED_ERR\",\n \"NO_DATA_ALLOWED_ERR\",\n \"NO_ERR\",\n \"NO_ERROR\",\n \"NO_MODIFICATION_ALLOWED_ERR\",\n \"NUMBER_TYPE\",\n \"NUM_COMPRESSED_TEXTURE_FORMATS\",\n \"NaN\",\n \"NamedNodeMap\",\n \"Navigator\",\n \"NearbyLinks\",\n \"NetworkInformation\",\n \"Node\",\n \"NodeFilter\",\n \"NodeIterator\",\n \"NodeList\",\n \"Notation\",\n \"Notification\",\n \"NotifyPaintEvent\",\n \"Number\",\n \"NumberFormat\",\n \"OBSOLETE\",\n \"ONE\",\n \"ONE_MINUS_CONSTANT_ALPHA\",\n \"ONE_MINUS_CONSTANT_COLOR\",\n \"ONE_MINUS_DST_ALPHA\",\n \"ONE_MINUS_DST_COLOR\",\n \"ONE_MINUS_SRC_ALPHA\",\n \"ONE_MINUS_SRC_COLOR\",\n \"OPEN\",\n \"OPENED\",\n \"OPENING\",\n \"ORDERED_NODE_ITERATOR_TYPE\",\n \"ORDERED_NODE_SNAPSHOT_TYPE\",\n \"OUT_OF_MEMORY\",\n \"Object\",\n \"OfflineAudioCompletionEvent\",\n \"OfflineAudioContext\",\n \"OfflineResourceList\",\n \"Option\",\n \"OscillatorNode\",\n \"OverflowEvent\",\n \"PACK_ALIGNMENT\",\n \"PAGE_RULE\",\n \"PARSE_ERR\",\n \"PATHSEG_ARC_ABS\",\n \"PATHSEG_ARC_REL\",\n \"PATHSEG_CLOSEPATH\",\n \"PATHSEG_CURVETO_CUBIC_ABS\",\n \"PATHSEG_CURVETO_CUBIC_REL\",\n \"PATHSEG_CURVETO_CUBIC_SMOOTH_ABS\",\n \"PATHSEG_CURVETO_CUBIC_SMOOTH_REL\",\n \"PATHSEG_CURVETO_QUADRATIC_ABS\",\n \"PATHSEG_CURVETO_QUADRATIC_REL\",\n \"PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS\",\n \"PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL\",\n \"PATHSEG_LINETO_ABS\",\n \"PATHSEG_LINETO_HORIZONTAL_ABS\",\n \"PATHSEG_LINETO_HORIZONTAL_REL\",\n \"PATHSEG_LINETO_REL\",\n \"PATHSEG_LINETO_VERTICAL_ABS\",\n \"PATHSEG_LINETO_VERTICAL_REL\",\n \"PATHSEG_MOVETO_ABS\",\n \"PATHSEG_MOVETO_REL\",\n \"PATHSEG_UNKNOWN\",\n \"PATH_EXISTS_ERR\",\n \"PEAKING\",\n \"PERMISSION_DENIED\",\n \"PERSISTENT\",\n \"PI\",\n \"PLAYING_STATE\",\n \"POINTS\",\n \"POLYGON_OFFSET_FACTOR\",\n \"POLYGON_OFFSET_FILL\",\n \"POLYGON_OFFSET_UNITS\",\n \"POSITION_UNAVAILABLE\",\n \"POSITIVE_INFINITY\",\n \"PREV\",\n \"PREV_NO_DUPLICATE\",\n \"PROCESSING_INSTRUCTION_NODE\",\n \"PageChangeEvent\",\n \"PageTransitionEvent\",\n \"PaintRequest\",\n \"PaintRequestList\",\n \"PannerNode\",\n \"Path2D\",\n \"Performance\",\n \"PerformanceEntry\",\n \"PerformanceMark\",\n \"PerformanceMeasure\",\n \"PerformanceNavigation\",\n \"PerformanceResourceTiming\",\n \"PerformanceTiming\",\n \"PeriodicWave\",\n \"Plugin\",\n \"PluginArray\",\n \"PopStateEvent\",\n \"PopupBlockedEvent\",\n \"ProcessingInstruction\",\n \"ProgressEvent\",\n \"Promise\",\n \"PropertyNodeList\",\n \"Proxy\",\n \"PushManager\",\n \"PushSubscription\",\n \"Q\",\n \"QUOTA_ERR\",\n \"QUOTA_EXCEEDED_ERR\",\n \"QueryInterface\",\n \"READ_ONLY\",\n \"READ_ONLY_ERR\",\n \"READ_WRITE\",\n \"RED_BITS\",\n \"REMOVAL\",\n \"RENDERBUFFER\",\n \"RENDERBUFFER_ALPHA_SIZE\",\n \"RENDERBUFFER_BINDING\",\n \"RENDERBUFFER_BLUE_SIZE\",\n \"RENDERBUFFER_DEPTH_SIZE\",\n \"RENDERBUFFER_GREEN_SIZE\",\n \"RENDERBUFFER_HEIGHT\",\n \"RENDERBUFFER_INTERNAL_FORMAT\",\n \"RENDERBUFFER_RED_SIZE\",\n \"RENDERBUFFER_STENCIL_SIZE\",\n \"RENDERBUFFER_WIDTH\",\n \"RENDERER\",\n \"RENDERING_INTENT_ABSOLUTE_COLORIMETRIC\",\n \"RENDERING_INTENT_AUTO\",\n \"RENDERING_INTENT_PERCEPTUAL\",\n \"RENDERING_INTENT_RELATIVE_COLORIMETRIC\",\n \"RENDERING_INTENT_SATURATION\",\n \"RENDERING_INTENT_UNKNOWN\",\n \"REPEAT\",\n \"REPLACE\",\n \"RGB\",\n \"RGB565\",\n \"RGB5_A1\",\n \"RGBA\",\n \"RGBA4\",\n \"RGBColor\",\n \"ROTATION_CLOCKWISE\",\n \"ROTATION_COUNTERCLOCKWISE\",\n \"RTCDataChannelEvent\",\n \"RTCIceCandidate\",\n \"RTCPeerConnectionIceEvent\",\n \"RTCRtpReceiver\",\n \"RTCRtpSender\",\n \"RTCSessionDescription\",\n \"RTCStatsReport\",\n \"RadioNodeList\",\n \"Range\",\n \"RangeError\",\n \"RangeException\",\n \"RecordErrorEvent\",\n \"Rect\",\n \"ReferenceError\",\n \"RegExp\",\n \"Request\",\n \"Response\",\n \"SAMPLER_2D\",\n \"SAMPLER_CUBE\",\n \"SAMPLES\",\n \"SAMPLE_ALPHA_TO_COVERAGE\",\n \"SAMPLE_BUFFERS\",\n \"SAMPLE_COVERAGE\",\n \"SAMPLE_COVERAGE_INVERT\",\n \"SAMPLE_COVERAGE_VALUE\",\n \"SAWTOOTH\",\n \"SCHEDULED_STATE\",\n \"SCISSOR_BOX\",\n \"SCISSOR_TEST\",\n \"SCROLL_PAGE_DOWN\",\n \"SCROLL_PAGE_UP\",\n \"SDP_ANSWER\",\n \"SDP_OFFER\",\n \"SDP_PRANSWER\",\n \"SECURITY_ERR\",\n \"SELECT\",\n \"SERIALIZE_ERR\",\n \"SEVERITY_ERROR\",\n \"SEVERITY_FATAL_ERROR\",\n \"SEVERITY_WARNING\",\n \"SHADER_COMPILER\",\n \"SHADER_TYPE\",\n \"SHADING_LANGUAGE_VERSION\",\n \"SHIFT_MASK\",\n \"SHORT\",\n \"SHOWING\",\n \"SHOW_ALL\",\n \"SHOW_ATTRIBUTE\",\n \"SHOW_CDATA_SECTION\",\n \"SHOW_COMMENT\",\n \"SHOW_DOCUMENT\",\n \"SHOW_DOCUMENT_FRAGMENT\",\n \"SHOW_DOCUMENT_TYPE\",\n \"SHOW_ELEMENT\",\n \"SHOW_ENTITY\",\n \"SHOW_ENTITY_REFERENCE\",\n \"SHOW_NOTATION\",\n \"SHOW_PROCESSING_INSTRUCTION\",\n \"SHOW_TEXT\",\n \"SINE\",\n \"SOUNDFIELD\",\n \"SQLException\",\n \"SQRT1_2\",\n \"SQRT2\",\n \"SQUARE\",\n \"SRC_ALPHA\",\n \"SRC_ALPHA_SATURATE\",\n \"SRC_COLOR\",\n \"START_TO_END\",\n \"START_TO_START\",\n \"STATIC_DRAW\",\n \"STENCIL_ATTACHMENT\",\n \"STENCIL_BACK_FAIL\",\n \"STENCIL_BACK_FUNC\",\n \"STENCIL_BACK_PASS_DEPTH_FAIL\",\n \"STENCIL_BACK_PASS_DEPTH_PASS\",\n \"STENCIL_BACK_REF\",\n \"STENCIL_BACK_VALUE_MASK\",\n \"STENCIL_BACK_WRITEMASK\",\n \"STENCIL_BITS\",\n \"STENCIL_BUFFER_BIT\",\n \"STENCIL_CLEAR_VALUE\",\n \"STENCIL_FAIL\",\n \"STENCIL_FUNC\",\n \"STENCIL_INDEX\",\n \"STENCIL_INDEX8\",\n \"STENCIL_PASS_DEPTH_FAIL\",\n \"STENCIL_PASS_DEPTH_PASS\",\n \"STENCIL_REF\",\n \"STENCIL_TEST\",\n \"STENCIL_VALUE_MASK\",\n \"STENCIL_WRITEMASK\",\n \"STREAM_DRAW\",\n \"STRING_TYPE\",\n \"STYLE_RULE\",\n \"SUBPIXEL_BITS\",\n \"SUPPORTS_RULE\",\n \"SVGAElement\",\n \"SVGAltGlyphDefElement\",\n \"SVGAltGlyphElement\",\n \"SVGAltGlyphItemElement\",\n \"SVGAngle\",\n \"SVGAnimateColorElement\",\n \"SVGAnimateElement\",\n \"SVGAnimateMotionElement\",\n \"SVGAnimateTransformElement\",\n \"SVGAnimatedAngle\",\n \"SVGAnimatedBoolean\",\n \"SVGAnimatedEnumeration\",\n \"SVGAnimatedInteger\",\n \"SVGAnimatedLength\",\n \"SVGAnimatedLengthList\",\n \"SVGAnimatedNumber\",\n \"SVGAnimatedNumberList\",\n \"SVGAnimatedPreserveAspectRatio\",\n \"SVGAnimatedRect\",\n \"SVGAnimatedString\",\n \"SVGAnimatedTransformList\",\n \"SVGAnimationElement\",\n \"SVGCircleElement\",\n \"SVGClipPathElement\",\n \"SVGColor\",\n \"SVGComponentTransferFunctionElement\",\n \"SVGCursorElement\",\n \"SVGDefsElement\",\n \"SVGDescElement\",\n \"SVGDiscardElement\",\n \"SVGDocument\",\n \"SVGElement\",\n \"SVGElementInstance\",\n \"SVGElementInstanceList\",\n \"SVGEllipseElement\",\n \"SVGException\",\n \"SVGFEBlendElement\",\n \"SVGFEColorMatrixElement\",\n \"SVGFEComponentTransferElement\",\n \"SVGFECompositeElement\",\n \"SVGFEConvolveMatrixElement\",\n \"SVGFEDiffuseLightingElement\",\n \"SVGFEDisplacementMapElement\",\n \"SVGFEDistantLightElement\",\n \"SVGFEDropShadowElement\",\n \"SVGFEFloodElement\",\n \"SVGFEFuncAElement\",\n \"SVGFEFuncBElement\",\n \"SVGFEFuncGElement\",\n \"SVGFEFuncRElement\",\n \"SVGFEGaussianBlurElement\",\n \"SVGFEImageElement\",\n \"SVGFEMergeElement\",\n \"SVGFEMergeNodeElement\",\n \"SVGFEMorphologyElement\",\n \"SVGFEOffsetElement\",\n \"SVGFEPointLightElement\",\n \"SVGFESpecularLightingElement\",\n \"SVGFESpotLightElement\",\n \"SVGFETileElement\",\n \"SVGFETurbulenceElement\",\n \"SVGFilterElement\",\n \"SVGFontElement\",\n \"SVGFontFaceElement\",\n \"SVGFontFaceFormatElement\",\n \"SVGFontFaceNameElement\",\n \"SVGFontFaceSrcElement\",\n \"SVGFontFaceUriElement\",\n \"SVGForeignObjectElement\",\n \"SVGGElement\",\n \"SVGGeometryElement\",\n \"SVGGlyphElement\",\n \"SVGGlyphRefElement\",\n \"SVGGradientElement\",\n \"SVGGraphicsElement\",\n \"SVGHKernElement\",\n \"SVGImageElement\",\n \"SVGLength\",\n \"SVGLengthList\",\n \"SVGLineElement\",\n \"SVGLinearGradientElement\",\n \"SVGMPathElement\",\n \"SVGMarkerElement\",\n \"SVGMaskElement\",\n \"SVGMatrix\",\n \"SVGMetadataElement\",\n \"SVGMissingGlyphElement\",\n \"SVGNumber\",\n \"SVGNumberList\",\n \"SVGPaint\",\n \"SVGPathElement\",\n \"SVGPathSeg\",\n \"SVGPathSegArcAbs\",\n \"SVGPathSegArcRel\",\n \"SVGPathSegClosePath\",\n \"SVGPathSegCurvetoCubicAbs\",\n \"SVGPathSegCurvetoCubicRel\",\n \"SVGPathSegCurvetoCubicSmoothAbs\",\n \"SVGPathSegCurvetoCubicSmoothRel\",\n \"SVGPathSegCurvetoQuadraticAbs\",\n \"SVGPathSegCurvetoQuadraticRel\",\n \"SVGPathSegCurvetoQuadraticSmoothAbs\",\n \"SVGPathSegCurvetoQuadraticSmoothRel\",\n \"SVGPathSegLinetoAbs\",\n \"SVGPathSegLinetoHorizontalAbs\",\n \"SVGPathSegLinetoHorizontalRel\",\n \"SVGPathSegLinetoRel\",\n \"SVGPathSegLinetoVerticalAbs\",\n \"SVGPathSegLinetoVerticalRel\",\n \"SVGPathSegList\",\n \"SVGPathSegMovetoAbs\",\n \"SVGPathSegMovetoRel\",\n \"SVGPatternElement\",\n \"SVGPoint\",\n \"SVGPointList\",\n \"SVGPolygonElement\",\n \"SVGPolylineElement\",\n \"SVGPreserveAspectRatio\",\n \"SVGRadialGradientElement\",\n \"SVGRect\",\n \"SVGRectElement\",\n \"SVGRenderingIntent\",\n \"SVGSVGElement\",\n \"SVGScriptElement\",\n \"SVGSetElement\",\n \"SVGStopElement\",\n \"SVGStringList\",\n \"SVGStyleElement\",\n \"SVGSwitchElement\",\n \"SVGSymbolElement\",\n \"SVGTRefElement\",\n \"SVGTSpanElement\",\n \"SVGTextContentElement\",\n \"SVGTextElement\",\n \"SVGTextPathElement\",\n \"SVGTextPositioningElement\",\n \"SVGTitleElement\",\n \"SVGTransform\",\n \"SVGTransformList\",\n \"SVGUnitTypes\",\n \"SVGUseElement\",\n \"SVGVKernElement\",\n \"SVGViewElement\",\n \"SVGViewSpec\",\n \"SVGZoomAndPan\",\n \"SVGZoomEvent\",\n \"SVG_ANGLETYPE_DEG\",\n \"SVG_ANGLETYPE_GRAD\",\n \"SVG_ANGLETYPE_RAD\",\n \"SVG_ANGLETYPE_UNKNOWN\",\n \"SVG_ANGLETYPE_UNSPECIFIED\",\n \"SVG_CHANNEL_A\",\n \"SVG_CHANNEL_B\",\n \"SVG_CHANNEL_G\",\n \"SVG_CHANNEL_R\",\n \"SVG_CHANNEL_UNKNOWN\",\n \"SVG_COLORTYPE_CURRENTCOLOR\",\n \"SVG_COLORTYPE_RGBCOLOR\",\n \"SVG_COLORTYPE_RGBCOLOR_ICCCOLOR\",\n \"SVG_COLORTYPE_UNKNOWN\",\n \"SVG_EDGEMODE_DUPLICATE\",\n \"SVG_EDGEMODE_NONE\",\n \"SVG_EDGEMODE_UNKNOWN\",\n \"SVG_EDGEMODE_WRAP\",\n \"SVG_FEBLEND_MODE_COLOR\",\n \"SVG_FEBLEND_MODE_COLOR_BURN\",\n \"SVG_FEBLEND_MODE_COLOR_DODGE\",\n \"SVG_FEBLEND_MODE_DARKEN\",\n \"SVG_FEBLEND_MODE_DIFFERENCE\",\n \"SVG_FEBLEND_MODE_EXCLUSION\",\n \"SVG_FEBLEND_MODE_HARD_LIGHT\",\n \"SVG_FEBLEND_MODE_HUE\",\n \"SVG_FEBLEND_MODE_LIGHTEN\",\n \"SVG_FEBLEND_MODE_LUMINOSITY\",\n \"SVG_FEBLEND_MODE_MULTIPLY\",\n \"SVG_FEBLEND_MODE_NORMAL\",\n \"SVG_FEBLEND_MODE_OVERLAY\",\n \"SVG_FEBLEND_MODE_SATURATION\",\n \"SVG_FEBLEND_MODE_SCREEN\",\n \"SVG_FEBLEND_MODE_SOFT_LIGHT\",\n \"SVG_FEBLEND_MODE_UNKNOWN\",\n \"SVG_FECOLORMATRIX_TYPE_HUEROTATE\",\n \"SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA\",\n \"SVG_FECOLORMATRIX_TYPE_MATRIX\",\n \"SVG_FECOLORMATRIX_TYPE_SATURATE\",\n \"SVG_FECOLORMATRIX_TYPE_UNKNOWN\",\n \"SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE\",\n \"SVG_FECOMPONENTTRANSFER_TYPE_GAMMA\",\n \"SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY\",\n \"SVG_FECOMPONENTTRANSFER_TYPE_LINEAR\",\n \"SVG_FECOMPONENTTRANSFER_TYPE_TABLE\",\n \"SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN\",\n \"SVG_FECOMPOSITE_OPERATOR_ARITHMETIC\",\n \"SVG_FECOMPOSITE_OPERATOR_ATOP\",\n \"SVG_FECOMPOSITE_OPERATOR_IN\",\n \"SVG_FECOMPOSITE_OPERATOR_OUT\",\n \"SVG_FECOMPOSITE_OPERATOR_OVER\",\n \"SVG_FECOMPOSITE_OPERATOR_UNKNOWN\",\n \"SVG_FECOMPOSITE_OPERATOR_XOR\",\n \"SVG_INVALID_VALUE_ERR\",\n \"SVG_LENGTHTYPE_CM\",\n \"SVG_LENGTHTYPE_EMS\",\n \"SVG_LENGTHTYPE_EXS\",\n \"SVG_LENGTHTYPE_IN\",\n \"SVG_LENGTHTYPE_MM\",\n \"SVG_LENGTHTYPE_NUMBER\",\n \"SVG_LENGTHTYPE_PC\",\n \"SVG_LENGTHTYPE_PERCENTAGE\",\n \"SVG_LENGTHTYPE_PT\",\n \"SVG_LENGTHTYPE_PX\",\n \"SVG_LENGTHTYPE_UNKNOWN\",\n \"SVG_MARKERUNITS_STROKEWIDTH\",\n \"SVG_MARKERUNITS_UNKNOWN\",\n \"SVG_MARKERUNITS_USERSPACEONUSE\",\n \"SVG_MARKER_ORIENT_ANGLE\",\n \"SVG_MARKER_ORIENT_AUTO\",\n \"SVG_MARKER_ORIENT_UNKNOWN\",\n \"SVG_MASKTYPE_ALPHA\",\n \"SVG_MASKTYPE_LUMINANCE\",\n \"SVG_MATRIX_NOT_INVERTABLE\",\n \"SVG_MEETORSLICE_MEET\",\n \"SVG_MEETORSLICE_SLICE\",\n \"SVG_MEETORSLICE_UNKNOWN\",\n \"SVG_MORPHOLOGY_OPERATOR_DILATE\",\n \"SVG_MORPHOLOGY_OPERATOR_ERODE\",\n \"SVG_MORPHOLOGY_OPERATOR_UNKNOWN\",\n \"SVG_PAINTTYPE_CURRENTCOLOR\",\n \"SVG_PAINTTYPE_NONE\",\n \"SVG_PAINTTYPE_RGBCOLOR\",\n \"SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR\",\n \"SVG_PAINTTYPE_UNKNOWN\",\n \"SVG_PAINTTYPE_URI\",\n \"SVG_PAINTTYPE_URI_CURRENTCOLOR\",\n \"SVG_PAINTTYPE_URI_NONE\",\n \"SVG_PAINTTYPE_URI_RGBCOLOR\",\n \"SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR\",\n \"SVG_PRESERVEASPECTRATIO_NONE\",\n \"SVG_PRESERVEASPECTRATIO_UNKNOWN\",\n \"SVG_PRESERVEASPECTRATIO_XMAXYMAX\",\n \"SVG_PRESERVEASPECTRATIO_XMAXYMID\",\n \"SVG_PRESERVEASPECTRATIO_XMAXYMIN\",\n \"SVG_PRESERVEASPECTRATIO_XMIDYMAX\",\n \"SVG_PRESERVEASPECTRATIO_XMIDYMID\",\n \"SVG_PRESERVEASPECTRATIO_XMIDYMIN\",\n \"SVG_PRESERVEASPECTRATIO_XMINYMAX\",\n \"SVG_PRESERVEASPECTRATIO_XMINYMID\",\n \"SVG_PRESERVEASPECTRATIO_XMINYMIN\",\n \"SVG_SPREADMETHOD_PAD\",\n \"SVG_SPREADMETHOD_REFLECT\",\n \"SVG_SPREADMETHOD_REPEAT\",\n \"SVG_SPREADMETHOD_UNKNOWN\",\n \"SVG_STITCHTYPE_NOSTITCH\",\n \"SVG_STITCHTYPE_STITCH\",\n \"SVG_STITCHTYPE_UNKNOWN\",\n \"SVG_TRANSFORM_MATRIX\",\n \"SVG_TRANSFORM_ROTATE\",\n \"SVG_TRANSFORM_SCALE\",\n \"SVG_TRANSFORM_SKEWX\",\n \"SVG_TRANSFORM_SKEWY\",\n \"SVG_TRANSFORM_TRANSLATE\",\n \"SVG_TRANSFORM_UNKNOWN\",\n \"SVG_TURBULENCE_TYPE_FRACTALNOISE\",\n \"SVG_TURBULENCE_TYPE_TURBULENCE\",\n \"SVG_TURBULENCE_TYPE_UNKNOWN\",\n \"SVG_UNIT_TYPE_OBJECTBOUNDINGBOX\",\n \"SVG_UNIT_TYPE_UNKNOWN\",\n \"SVG_UNIT_TYPE_USERSPACEONUSE\",\n \"SVG_WRONG_TYPE_ERR\",\n \"SVG_ZOOMANDPAN_DISABLE\",\n \"SVG_ZOOMANDPAN_MAGNIFY\",\n \"SVG_ZOOMANDPAN_UNKNOWN\",\n \"SYNTAX_ERR\",\n \"SavedPages\",\n \"Screen\",\n \"ScreenOrientation\",\n \"Script\",\n \"ScriptProcessorNode\",\n \"ScrollAreaEvent\",\n \"SecurityPolicyViolationEvent\",\n \"Selection\",\n \"ServiceWorker\",\n \"ServiceWorkerContainer\",\n \"ServiceWorkerRegistration\",\n \"SessionDescription\",\n \"Set\",\n \"ShadowRoot\",\n \"SharedWorker\",\n \"SimpleGestureEvent\",\n \"SpeechSynthesisEvent\",\n \"SpeechSynthesisUtterance\",\n \"StopIteration\",\n \"Storage\",\n \"StorageEvent\",\n \"String\",\n \"StyleSheet\",\n \"StyleSheetList\",\n \"SubtleCrypto\",\n \"Symbol\",\n \"SyntaxError\",\n \"TEMPORARY\",\n \"TEXTPATH_METHODTYPE_ALIGN\",\n \"TEXTPATH_METHODTYPE_STRETCH\",\n \"TEXTPATH_METHODTYPE_UNKNOWN\",\n \"TEXTPATH_SPACINGTYPE_AUTO\",\n \"TEXTPATH_SPACINGTYPE_EXACT\",\n \"TEXTPATH_SPACINGTYPE_UNKNOWN\",\n \"TEXTURE\",\n \"TEXTURE0\",\n \"TEXTURE1\",\n \"TEXTURE10\",\n \"TEXTURE11\",\n \"TEXTURE12\",\n \"TEXTURE13\",\n \"TEXTURE14\",\n \"TEXTURE15\",\n \"TEXTURE16\",\n \"TEXTURE17\",\n \"TEXTURE18\",\n \"TEXTURE19\",\n \"TEXTURE2\",\n \"TEXTURE20\",\n \"TEXTURE21\",\n \"TEXTURE22\",\n \"TEXTURE23\",\n \"TEXTURE24\",\n \"TEXTURE25\",\n \"TEXTURE26\",\n \"TEXTURE27\",\n \"TEXTURE28\",\n \"TEXTURE29\",\n \"TEXTURE3\",\n \"TEXTURE30\",\n \"TEXTURE31\",\n \"TEXTURE4\",\n \"TEXTURE5\",\n \"TEXTURE6\",\n \"TEXTURE7\",\n \"TEXTURE8\",\n \"TEXTURE9\",\n \"TEXTURE_2D\",\n \"TEXTURE_BINDING_2D\",\n \"TEXTURE_BINDING_CUBE_MAP\",\n \"TEXTURE_CUBE_MAP\",\n \"TEXTURE_CUBE_MAP_NEGATIVE_X\",\n \"TEXTURE_CUBE_MAP_NEGATIVE_Y\",\n \"TEXTURE_CUBE_MAP_NEGATIVE_Z\",\n \"TEXTURE_CUBE_MAP_POSITIVE_X\",\n \"TEXTURE_CUBE_MAP_POSITIVE_Y\",\n \"TEXTURE_CUBE_MAP_POSITIVE_Z\",\n \"TEXTURE_MAG_FILTER\",\n \"TEXTURE_MAX_ANISOTROPY_EXT\",\n \"TEXTURE_MIN_FILTER\",\n \"TEXTURE_WRAP_S\",\n \"TEXTURE_WRAP_T\",\n \"TEXT_NODE\",\n \"TIMEOUT\",\n \"TIMEOUT_ERR\",\n \"TOO_LARGE_ERR\",\n \"TRANSACTION_INACTIVE_ERR\",\n \"TRIANGLE\",\n \"TRIANGLES\",\n \"TRIANGLE_FAN\",\n \"TRIANGLE_STRIP\",\n \"TYPE_BACK_FORWARD\",\n \"TYPE_ERR\",\n \"TYPE_MISMATCH_ERR\",\n \"TYPE_NAVIGATE\",\n \"TYPE_RELOAD\",\n \"TYPE_RESERVED\",\n \"Text\",\n \"TextDecoder\",\n \"TextEncoder\",\n \"TextEvent\",\n \"TextMetrics\",\n \"TextTrack\",\n \"TextTrackCue\",\n \"TextTrackCueList\",\n \"TextTrackList\",\n \"TimeEvent\",\n \"TimeRanges\",\n \"Touch\",\n \"TouchEvent\",\n \"TouchList\",\n \"TrackEvent\",\n \"TransitionEvent\",\n \"TreeWalker\",\n \"TypeError\",\n \"UIEvent\",\n \"UNCACHED\",\n \"UNKNOWN_ERR\",\n \"UNKNOWN_RULE\",\n \"UNMASKED_RENDERER_WEBGL\",\n \"UNMASKED_VENDOR_WEBGL\",\n \"UNORDERED_NODE_ITERATOR_TYPE\",\n \"UNORDERED_NODE_SNAPSHOT_TYPE\",\n \"UNPACK_ALIGNMENT\",\n \"UNPACK_COLORSPACE_CONVERSION_WEBGL\",\n \"UNPACK_FLIP_Y_WEBGL\",\n \"UNPACK_PREMULTIPLY_ALPHA_WEBGL\",\n \"UNSCHEDULED_STATE\",\n \"UNSENT\",\n \"UNSIGNED_BYTE\",\n \"UNSIGNED_INT\",\n \"UNSIGNED_SHORT\",\n \"UNSIGNED_SHORT_4_4_4_4\",\n \"UNSIGNED_SHORT_5_5_5_1\",\n \"UNSIGNED_SHORT_5_6_5\",\n \"UNSPECIFIED_EVENT_TYPE_ERR\",\n \"UPDATEREADY\",\n \"URIError\",\n \"URL\",\n \"URLSearchParams\",\n \"URLUnencoded\",\n \"URL_MISMATCH_ERR\",\n \"UTC\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"UserMessageHandler\",\n \"UserMessageHandlersNamespace\",\n \"UserProximityEvent\",\n \"VALIDATE_STATUS\",\n \"VALIDATION_ERR\",\n \"VARIABLES_RULE\",\n \"VENDOR\",\n \"VERSION\",\n \"VERSION_CHANGE\",\n \"VERSION_ERR\",\n \"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\",\n \"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE\",\n \"VERTEX_ATTRIB_ARRAY_ENABLED\",\n \"VERTEX_ATTRIB_ARRAY_NORMALIZED\",\n \"VERTEX_ATTRIB_ARRAY_POINTER\",\n \"VERTEX_ATTRIB_ARRAY_SIZE\",\n \"VERTEX_ATTRIB_ARRAY_STRIDE\",\n \"VERTEX_ATTRIB_ARRAY_TYPE\",\n \"VERTEX_SHADER\",\n \"VERTICAL\",\n \"VERTICAL_AXIS\",\n \"VER_ERR\",\n \"VIEWPORT\",\n \"VIEWPORT_RULE\",\n \"VTTCue\",\n \"VTTRegion\",\n \"ValidityState\",\n \"VideoStreamTrack\",\n \"WEBKIT_FILTER_RULE\",\n \"WEBKIT_KEYFRAMES_RULE\",\n \"WEBKIT_KEYFRAME_RULE\",\n \"WEBKIT_REGION_RULE\",\n \"WRONG_DOCUMENT_ERR\",\n \"WaveShaperNode\",\n \"WeakMap\",\n \"WeakSet\",\n \"WebGLActiveInfo\",\n \"WebGLBuffer\",\n \"WebGLContextEvent\",\n \"WebGLFramebuffer\",\n \"WebGLProgram\",\n \"WebGLRenderbuffer\",\n \"WebGLRenderingContext\",\n \"WebGLShader\",\n \"WebGLShaderPrecisionFormat\",\n \"WebGLTexture\",\n \"WebGLUniformLocation\",\n \"WebGLVertexArray\",\n \"WebKitAnimationEvent\",\n \"WebKitBlobBuilder\",\n \"WebKitCSSFilterRule\",\n \"WebKitCSSFilterValue\",\n \"WebKitCSSKeyframeRule\",\n \"WebKitCSSKeyframesRule\",\n \"WebKitCSSMatrix\",\n \"WebKitCSSRegionRule\",\n \"WebKitCSSTransformValue\",\n \"WebKitDataCue\",\n \"WebKitGamepad\",\n \"WebKitMediaKeyError\",\n \"WebKitMediaKeyMessageEvent\",\n \"WebKitMediaKeySession\",\n \"WebKitMediaKeys\",\n \"WebKitMediaSource\",\n \"WebKitMutationObserver\",\n \"WebKitNamespace\",\n \"WebKitPlaybackTargetAvailabilityEvent\",\n \"WebKitPoint\",\n \"WebKitShadowRoot\",\n \"WebKitSourceBuffer\",\n \"WebKitSourceBufferList\",\n \"WebKitTransitionEvent\",\n \"WebSocket\",\n \"WheelEvent\",\n \"Window\",\n \"Worker\",\n \"XMLDocument\",\n \"XMLHttpRequest\",\n \"XMLHttpRequestEventTarget\",\n \"XMLHttpRequestException\",\n \"XMLHttpRequestProgressEvent\",\n \"XMLHttpRequestUpload\",\n \"XMLSerializer\",\n \"XMLStylesheetProcessingInstruction\",\n \"XPathEvaluator\",\n \"XPathException\",\n \"XPathExpression\",\n \"XPathNSResolver\",\n \"XPathResult\",\n \"XSLTProcessor\",\n \"ZERO\",\n \"_XD0M_\",\n \"_YD0M_\",\n \"__defineGetter__\",\n \"__defineSetter__\",\n \"__lookupGetter__\",\n \"__lookupSetter__\",\n \"__opera\",\n \"__proto__\",\n \"_browserjsran\",\n \"a\",\n \"aLink\",\n \"abbr\",\n \"abort\",\n \"abs\",\n \"absolute\",\n \"acceleration\",\n \"accelerationIncludingGravity\",\n \"accelerator\",\n \"accept\",\n \"acceptCharset\",\n \"acceptNode\",\n \"accessKey\",\n \"accessKeyLabel\",\n \"accuracy\",\n \"acos\",\n \"acosh\",\n \"action\",\n \"actionURL\",\n \"active\",\n \"activeCues\",\n \"activeElement\",\n \"activeSourceBuffers\",\n \"activeSourceCount\",\n \"activeTexture\",\n \"add\",\n \"addBehavior\",\n \"addCandidate\",\n \"addColorStop\",\n \"addCue\",\n \"addElement\",\n \"addEventListener\",\n \"addFilter\",\n \"addFromString\",\n \"addFromUri\",\n \"addIceCandidate\",\n \"addImport\",\n \"addListener\",\n \"addNamed\",\n \"addPageRule\",\n \"addPath\",\n \"addPointer\",\n \"addRange\",\n \"addRegion\",\n \"addRule\",\n \"addSearchEngine\",\n \"addSourceBuffer\",\n \"addStream\",\n \"addTextTrack\",\n \"addTrack\",\n \"addWakeLockListener\",\n \"addedNodes\",\n \"additionalName\",\n \"additiveSymbols\",\n \"addons\",\n \"adoptNode\",\n \"adr\",\n \"advance\",\n \"alert\",\n \"algorithm\",\n \"align\",\n \"align-content\",\n \"align-items\",\n \"align-self\",\n \"alignContent\",\n \"alignItems\",\n \"alignSelf\",\n \"alignmentBaseline\",\n \"alinkColor\",\n \"all\",\n \"allowFullscreen\",\n \"allowedDirections\",\n \"alpha\",\n \"alt\",\n \"altGraphKey\",\n \"altHtml\",\n \"altKey\",\n \"altLeft\",\n \"altitude\",\n \"altitudeAccuracy\",\n \"amplitude\",\n \"ancestorOrigins\",\n \"anchor\",\n \"anchorNode\",\n \"anchorOffset\",\n \"anchors\",\n \"angle\",\n \"animVal\",\n \"animate\",\n \"animatedInstanceRoot\",\n \"animatedNormalizedPathSegList\",\n \"animatedPathSegList\",\n \"animatedPoints\",\n \"animation\",\n \"animation-delay\",\n \"animation-direction\",\n \"animation-duration\",\n \"animation-fill-mode\",\n \"animation-iteration-count\",\n \"animation-name\",\n \"animation-play-state\",\n \"animation-timing-function\",\n \"animationDelay\",\n \"animationDirection\",\n \"animationDuration\",\n \"animationFillMode\",\n \"animationIterationCount\",\n \"animationName\",\n \"animationPlayState\",\n \"animationStartTime\",\n \"animationTimingFunction\",\n \"animationsPaused\",\n \"anniversary\",\n \"app\",\n \"appCodeName\",\n \"appMinorVersion\",\n \"appName\",\n \"appNotifications\",\n \"appVersion\",\n \"append\",\n \"appendBuffer\",\n \"appendChild\",\n \"appendData\",\n \"appendItem\",\n \"appendMedium\",\n \"appendNamed\",\n \"appendRule\",\n \"appendStream\",\n \"appendWindowEnd\",\n \"appendWindowStart\",\n \"applets\",\n \"applicationCache\",\n \"apply\",\n \"applyElement\",\n \"arc\",\n \"arcTo\",\n \"archive\",\n \"areas\",\n \"arguments\",\n \"arrayBuffer\",\n \"asin\",\n \"asinh\",\n \"assert\",\n \"assign\",\n \"async\",\n \"atEnd\",\n \"atan\",\n \"atan2\",\n \"atanh\",\n \"atob\",\n \"attachEvent\",\n \"attachShader\",\n \"attachments\",\n \"attack\",\n \"attrChange\",\n \"attrName\",\n \"attributeName\",\n \"attributeNamespace\",\n \"attributes\",\n \"audioTracks\",\n \"autoIncrement\",\n \"autobuffer\",\n \"autocapitalize\",\n \"autocomplete\",\n \"autocorrect\",\n \"autofocus\",\n \"autoplay\",\n \"availHeight\",\n \"availLeft\",\n \"availTop\",\n \"availWidth\",\n \"availability\",\n \"available\",\n \"aversion\",\n \"axes\",\n \"axis\",\n \"azimuth\",\n \"b\",\n \"back\",\n \"backface-visibility\",\n \"backfaceVisibility\",\n \"background\",\n \"background-attachment\",\n \"background-blend-mode\",\n \"background-clip\",\n \"background-color\",\n \"background-image\",\n \"background-origin\",\n \"background-position\",\n \"background-repeat\",\n \"background-size\",\n \"backgroundAttachment\",\n \"backgroundBlendMode\",\n \"backgroundClip\",\n \"backgroundColor\",\n \"backgroundImage\",\n \"backgroundOrigin\",\n \"backgroundPosition\",\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n \"backgroundRepeat\",\n \"backgroundSize\",\n \"badInput\",\n \"balance\",\n \"baseFrequencyX\",\n \"baseFrequencyY\",\n \"baseNode\",\n \"baseOffset\",\n \"baseURI\",\n \"baseVal\",\n \"baselineShift\",\n \"battery\",\n \"bday\",\n \"beginElement\",\n \"beginElementAt\",\n \"beginPath\",\n \"behavior\",\n \"behaviorCookie\",\n \"behaviorPart\",\n \"behaviorUrns\",\n \"beta\",\n \"bezierCurveTo\",\n \"bgColor\",\n \"bgProperties\",\n \"bias\",\n \"big\",\n \"binaryType\",\n \"bind\",\n \"bindAttribLocation\",\n \"bindBuffer\",\n \"bindFramebuffer\",\n \"bindRenderbuffer\",\n \"bindTexture\",\n \"blendColor\",\n \"blendEquation\",\n \"blendEquationSeparate\",\n \"blendFunc\",\n \"blendFuncSeparate\",\n \"blink\",\n \"blob\",\n \"blockDirection\",\n \"blue\",\n \"blur\",\n \"body\",\n \"bodyUsed\",\n \"bold\",\n \"bookmarks\",\n \"booleanValue\",\n \"border\",\n \"border-bottom\",\n \"border-bottom-color\",\n \"border-bottom-left-radius\",\n \"border-bottom-right-radius\",\n \"border-bottom-style\",\n \"border-bottom-width\",\n \"border-collapse\",\n \"border-color\",\n \"border-image\",\n \"border-image-outset\",\n \"border-image-repeat\",\n \"border-image-slice\",\n \"border-image-source\",\n \"border-image-width\",\n \"border-left\",\n \"border-left-color\",\n \"border-left-style\",\n \"border-left-width\",\n \"border-radius\",\n \"border-right\",\n \"border-right-color\",\n \"border-right-style\",\n \"border-right-width\",\n \"border-spacing\",\n \"border-style\",\n \"border-top\",\n \"border-top-color\",\n \"border-top-left-radius\",\n \"border-top-right-radius\",\n \"border-top-style\",\n \"border-top-width\",\n \"border-width\",\n \"borderBottom\",\n \"borderBottomColor\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomStyle\",\n \"borderBottomWidth\",\n \"borderCollapse\",\n \"borderColor\",\n \"borderColorDark\",\n \"borderColorLight\",\n \"borderImage\",\n \"borderImageOutset\",\n \"borderImageRepeat\",\n \"borderImageSlice\",\n \"borderImageSource\",\n \"borderImageWidth\",\n \"borderLeft\",\n \"borderLeftColor\",\n \"borderLeftStyle\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderRight\",\n \"borderRightColor\",\n \"borderRightStyle\",\n \"borderRightWidth\",\n \"borderSpacing\",\n \"borderStyle\",\n \"borderTop\",\n \"borderTopColor\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderTopStyle\",\n \"borderTopWidth\",\n \"borderWidth\",\n \"bottom\",\n \"bottomMargin\",\n \"bound\",\n \"boundElements\",\n \"boundingClientRect\",\n \"boundingHeight\",\n \"boundingLeft\",\n \"boundingTop\",\n \"boundingWidth\",\n \"bounds\",\n \"box-decoration-break\",\n \"box-shadow\",\n \"box-sizing\",\n \"boxDecorationBreak\",\n \"boxShadow\",\n \"boxSizing\",\n \"breakAfter\",\n \"breakBefore\",\n \"breakInside\",\n \"browserLanguage\",\n \"btoa\",\n \"bubbles\",\n \"buffer\",\n \"bufferData\",\n \"bufferDepth\",\n \"bufferSize\",\n \"bufferSubData\",\n \"buffered\",\n \"bufferedAmount\",\n \"buildID\",\n \"buildNumber\",\n \"button\",\n \"buttonID\",\n \"buttons\",\n \"byteLength\",\n \"byteOffset\",\n \"c\",\n \"call\",\n \"caller\",\n \"canBeFormatted\",\n \"canBeMounted\",\n \"canBeShared\",\n \"canHaveChildren\",\n \"canHaveHTML\",\n \"canPlayType\",\n \"cancel\",\n \"cancelAnimationFrame\",\n \"cancelBubble\",\n \"cancelScheduledValues\",\n \"cancelable\",\n \"candidate\",\n \"canvas\",\n \"caption\",\n \"caption-side\",\n \"captionSide\",\n \"captureEvents\",\n \"captureStackTrace\",\n \"caretPositionFromPoint\",\n \"caretRangeFromPoint\",\n \"cast\",\n \"catch\",\n \"category\",\n \"cbrt\",\n \"cd\",\n \"ceil\",\n \"cellIndex\",\n \"cellPadding\",\n \"cellSpacing\",\n \"cells\",\n \"ch\",\n \"chOff\",\n \"chain\",\n \"challenge\",\n \"changedTouches\",\n \"channel\",\n \"channelCount\",\n \"channelCountMode\",\n \"channelInterpretation\",\n \"char\",\n \"charAt\",\n \"charCode\",\n \"charCodeAt\",\n \"charIndex\",\n \"characterSet\",\n \"charging\",\n \"chargingTime\",\n \"charset\",\n \"checkEnclosure\",\n \"checkFramebufferStatus\",\n \"checkIntersection\",\n \"checkValidity\",\n \"checked\",\n \"childElementCount\",\n \"childNodes\",\n \"children\",\n \"chrome\",\n \"ciphertext\",\n \"cite\",\n \"classList\",\n \"className\",\n \"classid\",\n \"clear\",\n \"clearAttributes\",\n \"clearColor\",\n \"clearData\",\n \"clearDepth\",\n \"clearImmediate\",\n \"clearInterval\",\n \"clearMarks\",\n \"clearMeasures\",\n \"clearParameters\",\n \"clearRect\",\n \"clearResourceTimings\",\n \"clearShadow\",\n \"clearStencil\",\n \"clearTimeout\",\n \"clearWatch\",\n \"click\",\n \"clickCount\",\n \"clientHeight\",\n \"clientInformation\",\n \"clientLeft\",\n \"clientRect\",\n \"clientRects\",\n \"clientTop\",\n \"clientWidth\",\n \"clientX\",\n \"clientY\",\n \"clip\",\n \"clip-path\",\n \"clip-rule\",\n \"clipBottom\",\n \"clipLeft\",\n \"clipPath\",\n \"clipPathUnits\",\n \"clipRight\",\n \"clipRule\",\n \"clipTop\",\n \"clipboardData\",\n \"clone\",\n \"cloneContents\",\n \"cloneNode\",\n \"cloneRange\",\n \"close\",\n \"closePath\",\n \"closed\",\n \"closest\",\n \"clz\",\n \"clz32\",\n \"cmp\",\n \"code\",\n \"codeBase\",\n \"codePointAt\",\n \"codeType\",\n \"colSpan\",\n \"collapse\",\n \"collapseToEnd\",\n \"collapseToStart\",\n \"collapsed\",\n \"collect\",\n \"colno\",\n \"color\",\n \"color-interpolation\",\n \"color-interpolation-filters\",\n \"colorDepth\",\n \"colorInterpolation\",\n \"colorInterpolationFilters\",\n \"colorMask\",\n \"colorType\",\n \"cols\",\n \"columnCount\",\n \"columnFill\",\n \"columnGap\",\n \"columnNumber\",\n \"columnRule\",\n \"columnRuleColor\",\n \"columnRuleStyle\",\n \"columnRuleWidth\",\n \"columnSpan\",\n \"columnWidth\",\n \"columns\",\n \"command\",\n \"commitPreferences\",\n \"commonAncestorContainer\",\n \"compact\",\n \"compareBoundaryPoints\",\n \"compareDocumentPosition\",\n \"compareEndPoints\",\n \"compareNode\",\n \"comparePoint\",\n \"compatMode\",\n \"compatible\",\n \"compile\",\n \"compileShader\",\n \"complete\",\n \"componentFromPoint\",\n \"compositionEndOffset\",\n \"compositionStartOffset\",\n \"compressedTexImage2D\",\n \"compressedTexSubImage2D\",\n \"concat\",\n \"conditionText\",\n \"coneInnerAngle\",\n \"coneOuterAngle\",\n \"coneOuterGain\",\n \"confirm\",\n \"confirmComposition\",\n \"confirmSiteSpecificTrackingException\",\n \"confirmWebWideTrackingException\",\n \"connect\",\n \"connectEnd\",\n \"connectStart\",\n \"connected\",\n \"connection\",\n \"connectionSpeed\",\n \"console\",\n \"consolidate\",\n \"constrictionActive\",\n \"constructor\",\n \"contactID\",\n \"contains\",\n \"containsNode\",\n \"content\",\n \"contentDocument\",\n \"contentEditable\",\n \"contentOverflow\",\n \"contentScriptType\",\n \"contentStyleType\",\n \"contentType\",\n \"contentWindow\",\n \"context\",\n \"contextMenu\",\n \"contextmenu\",\n \"continue\",\n \"continuous\",\n \"control\",\n \"controller\",\n \"controls\",\n \"convertToSpecifiedUnits\",\n \"cookie\",\n \"cookieEnabled\",\n \"coords\",\n \"copyFromChannel\",\n \"copyTexImage2D\",\n \"copyTexSubImage2D\",\n \"copyToChannel\",\n \"copyWithin\",\n \"correspondingElement\",\n \"correspondingUseElement\",\n \"cos\",\n \"cosh\",\n \"count\",\n \"counter-increment\",\n \"counter-reset\",\n \"counterIncrement\",\n \"counterReset\",\n \"cpuClass\",\n \"cpuSleepAllowed\",\n \"create\",\n \"createAnalyser\",\n \"createAnswer\",\n \"createAttribute\",\n \"createAttributeNS\",\n \"createBiquadFilter\",\n \"createBuffer\",\n \"createBufferSource\",\n \"createCDATASection\",\n \"createCSSStyleSheet\",\n \"createCaption\",\n \"createChannelMerger\",\n \"createChannelSplitter\",\n \"createComment\",\n \"createContextualFragment\",\n \"createControlRange\",\n \"createConvolver\",\n \"createDTMFSender\",\n \"createDataChannel\",\n \"createDelay\",\n \"createDelayNode\",\n \"createDocument\",\n \"createDocumentFragment\",\n \"createDocumentType\",\n \"createDynamicsCompressor\",\n \"createElement\",\n \"createElementNS\",\n \"createEntityReference\",\n \"createEvent\",\n \"createEventObject\",\n \"createExpression\",\n \"createFramebuffer\",\n \"createFunction\",\n \"createGain\",\n \"createGainNode\",\n \"createHTMLDocument\",\n \"createImageBitmap\",\n \"createImageData\",\n \"createIndex\",\n \"createJavaScriptNode\",\n \"createLinearGradient\",\n \"createMediaElementSource\",\n \"createMediaKeys\",\n \"createMediaStreamDestination\",\n \"createMediaStreamSource\",\n \"createMutableFile\",\n \"createNSResolver\",\n \"createNodeIterator\",\n \"createNotification\",\n \"createObjectStore\",\n \"createObjectURL\",\n \"createOffer\",\n \"createOscillator\",\n \"createPanner\",\n \"createPattern\",\n \"createPeriodicWave\",\n \"createPopup\",\n \"createProcessingInstruction\",\n \"createProgram\",\n \"createRadialGradient\",\n \"createRange\",\n \"createRangeCollection\",\n \"createRenderbuffer\",\n \"createSVGAngle\",\n \"createSVGLength\",\n \"createSVGMatrix\",\n \"createSVGNumber\",\n \"createSVGPathSegArcAbs\",\n \"createSVGPathSegArcRel\",\n \"createSVGPathSegClosePath\",\n \"createSVGPathSegCurvetoCubicAbs\",\n \"createSVGPathSegCurvetoCubicRel\",\n \"createSVGPathSegCurvetoCubicSmoothAbs\",\n \"createSVGPathSegCurvetoCubicSmoothRel\",\n \"createSVGPathSegCurvetoQuadraticAbs\",\n \"createSVGPathSegCurvetoQuadraticRel\",\n \"createSVGPathSegCurvetoQuadraticSmoothAbs\",\n \"createSVGPathSegCurvetoQuadraticSmoothRel\",\n \"createSVGPathSegLinetoAbs\",\n \"createSVGPathSegLinetoHorizontalAbs\",\n \"createSVGPathSegLinetoHorizontalRel\",\n \"createSVGPathSegLinetoRel\",\n \"createSVGPathSegLinetoVerticalAbs\",\n \"createSVGPathSegLinetoVerticalRel\",\n \"createSVGPathSegMovetoAbs\",\n \"createSVGPathSegMovetoRel\",\n \"createSVGPoint\",\n \"createSVGRect\",\n \"createSVGTransform\",\n \"createSVGTransformFromMatrix\",\n \"createScriptProcessor\",\n \"createSession\",\n \"createShader\",\n \"createShadowRoot\",\n \"createStereoPanner\",\n \"createStyleSheet\",\n \"createTBody\",\n \"createTFoot\",\n \"createTHead\",\n \"createTextNode\",\n \"createTextRange\",\n \"createTexture\",\n \"createTouch\",\n \"createTouchList\",\n \"createTreeWalker\",\n \"createWaveShaper\",\n \"creationTime\",\n \"crossOrigin\",\n \"crypto\",\n \"csi\",\n \"cssFloat\",\n \"cssRules\",\n \"cssText\",\n \"cssValueType\",\n \"ctrlKey\",\n \"ctrlLeft\",\n \"cues\",\n \"cullFace\",\n \"currentNode\",\n \"currentPage\",\n \"currentScale\",\n \"currentScript\",\n \"currentSrc\",\n \"currentState\",\n \"currentStyle\",\n \"currentTarget\",\n \"currentTime\",\n \"currentTranslate\",\n \"currentView\",\n \"cursor\",\n \"curve\",\n \"customError\",\n \"cx\",\n \"cy\",\n \"d\",\n \"data\",\n \"dataFld\",\n \"dataFormatAs\",\n \"dataPageSize\",\n \"dataSrc\",\n \"dataTransfer\",\n \"database\",\n \"dataset\",\n \"dateTime\",\n \"db\",\n \"debug\",\n \"debuggerEnabled\",\n \"declare\",\n \"decode\",\n \"decodeAudioData\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"decrypt\",\n \"default\",\n \"defaultCharset\",\n \"defaultChecked\",\n \"defaultMuted\",\n \"defaultPlaybackRate\",\n \"defaultPrevented\",\n \"defaultSelected\",\n \"defaultStatus\",\n \"defaultURL\",\n \"defaultValue\",\n \"defaultView\",\n \"defaultstatus\",\n \"defer\",\n \"defineMagicFunction\",\n \"defineMagicVariable\",\n \"defineProperties\",\n \"defineProperty\",\n \"delayTime\",\n \"delete\",\n \"deleteBuffer\",\n \"deleteCaption\",\n \"deleteCell\",\n \"deleteContents\",\n \"deleteData\",\n \"deleteDatabase\",\n \"deleteFramebuffer\",\n \"deleteFromDocument\",\n \"deleteIndex\",\n \"deleteMedium\",\n \"deleteObjectStore\",\n \"deleteProgram\",\n \"deleteRenderbuffer\",\n \"deleteRow\",\n \"deleteRule\",\n \"deleteShader\",\n \"deleteTFoot\",\n \"deleteTHead\",\n \"deleteTexture\",\n \"deliverChangeRecords\",\n \"delivery\",\n \"deliveryInfo\",\n \"deliveryStatus\",\n \"deliveryTimestamp\",\n \"delta\",\n \"deltaMode\",\n \"deltaX\",\n \"deltaY\",\n \"deltaZ\",\n \"depthFunc\",\n \"depthMask\",\n \"depthRange\",\n \"deriveBits\",\n \"deriveKey\",\n \"description\",\n \"deselectAll\",\n \"designMode\",\n \"destination\",\n \"destinationURL\",\n \"detach\",\n \"detachEvent\",\n \"detachShader\",\n \"detail\",\n \"detune\",\n \"devicePixelRatio\",\n \"deviceXDPI\",\n \"deviceYDPI\",\n \"diffuseConstant\",\n \"digest\",\n \"dimensions\",\n \"dir\",\n \"dirName\",\n \"direction\",\n \"dirxml\",\n \"disable\",\n \"disableVertexAttribArray\",\n \"disabled\",\n \"dischargingTime\",\n \"disconnect\",\n \"dispatchEvent\",\n \"display\",\n \"distanceModel\",\n \"divisor\",\n \"djsapi\",\n \"djsproxy\",\n \"doImport\",\n \"doNotTrack\",\n \"doScroll\",\n \"doctype\",\n \"document\",\n \"documentElement\",\n \"documentMode\",\n \"documentURI\",\n \"dolphin\",\n \"dolphinGameCenter\",\n \"dolphininfo\",\n \"dolphinmeta\",\n \"domComplete\",\n \"domContentLoadedEventEnd\",\n \"domContentLoadedEventStart\",\n \"domInteractive\",\n \"domLoading\",\n \"domain\",\n \"domainLookupEnd\",\n \"domainLookupStart\",\n \"dominant-baseline\",\n \"dominantBaseline\",\n \"done\",\n \"dopplerFactor\",\n \"download\",\n \"dragDrop\",\n \"draggable\",\n \"drawArrays\",\n \"drawArraysInstancedANGLE\",\n \"drawCustomFocusRing\",\n \"drawElements\",\n \"drawElementsInstancedANGLE\",\n \"drawFocusIfNeeded\",\n \"drawImage\",\n \"drawImageFromRect\",\n \"drawSystemFocusRing\",\n \"drawingBufferHeight\",\n \"drawingBufferWidth\",\n \"dropEffect\",\n \"droppedVideoFrames\",\n \"dropzone\",\n \"dump\",\n \"duplicate\",\n \"duration\",\n \"dvname\",\n \"dvnum\",\n \"dx\",\n \"dy\",\n \"dynsrc\",\n \"e\",\n \"edgeMode\",\n \"effectAllowed\",\n \"elapsedTime\",\n \"elementFromPoint\",\n \"elements\",\n \"elevation\",\n \"ellipse\",\n \"email\",\n \"embeds\",\n \"empty\",\n \"empty-cells\",\n \"emptyCells\",\n \"enable\",\n \"enableBackground\",\n \"enableStyleSheetsForSet\",\n \"enableVertexAttribArray\",\n \"enabled\",\n \"enabledPlugin\",\n \"encode\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"encoding\",\n \"encrypt\",\n \"enctype\",\n \"end\",\n \"endContainer\",\n \"endElement\",\n \"endElementAt\",\n \"endOfStream\",\n \"endOffset\",\n \"endTime\",\n \"ended\",\n \"endsWith\",\n \"entities\",\n \"entries\",\n \"entryType\",\n \"enumerate\",\n \"enumerateEditable\",\n \"error\",\n \"errorCode\",\n \"escape\",\n \"eval\",\n \"evaluate\",\n \"event\",\n \"eventPhase\",\n \"every\",\n \"exception\",\n \"exec\",\n \"execCommand\",\n \"execCommandShowHelp\",\n \"execScript\",\n \"exitFullscreen\",\n \"exitPointerLock\",\n \"exp\",\n \"expand\",\n \"expandEntityReferences\",\n \"expando\",\n \"expansion\",\n \"expiryDate\",\n \"explicitOriginalTarget\",\n \"expm1\",\n \"exponent\",\n \"exponentialRampToValueAtTime\",\n \"exportKey\",\n \"extend\",\n \"extensions\",\n \"extentNode\",\n \"extentOffset\",\n \"external\",\n \"externalResourcesRequired\",\n \"extractContents\",\n \"extractable\",\n \"f\",\n \"face\",\n \"factoryReset\",\n \"fallback\",\n \"familyName\",\n \"farthestViewportElement\",\n \"fastSeek\",\n \"fatal\",\n \"fetch\",\n \"fetchStart\",\n \"fftSize\",\n \"fgColor\",\n \"fileCreatedDate\",\n \"fileHandle\",\n \"fileModifiedDate\",\n \"fileName\",\n \"fileSize\",\n \"fileUpdatedDate\",\n \"filename\",\n \"files\",\n \"fill\",\n \"fill-opacity\",\n \"fill-rule\",\n \"fillOpacity\",\n \"fillRect\",\n \"fillRule\",\n \"fillStyle\",\n \"fillText\",\n \"filter\",\n \"filterResX\",\n \"filterResY\",\n \"filterUnits\",\n \"filters\",\n \"find\",\n \"findIndex\",\n \"findRule\",\n \"findText\",\n \"finish\",\n \"fireEvent\",\n \"firstChild\",\n \"firstElementChild\",\n \"firstPage\",\n \"fixed\",\n \"flex\",\n \"flex-basis\",\n \"flex-direction\",\n \"flex-flow\",\n \"flex-grow\",\n \"flex-shrink\",\n \"flex-wrap\",\n \"flexBasis\",\n \"flexDirection\",\n \"flexFlow\",\n \"flexGrow\",\n \"flexShrink\",\n \"flexWrap\",\n \"flipX\",\n \"flipY\",\n \"float\",\n \"flood-color\",\n \"flood-opacity\",\n \"floodColor\",\n \"floodOpacity\",\n \"floor\",\n \"flush\",\n \"focus\",\n \"focusNode\",\n \"focusOffset\",\n \"font\",\n \"font-family\",\n \"font-feature-settings\",\n \"font-kerning\",\n \"font-language-override\",\n \"font-size\",\n \"font-size-adjust\",\n \"font-stretch\",\n \"font-style\",\n \"font-synthesis\",\n \"font-variant\",\n \"font-variant-alternates\",\n \"font-variant-caps\",\n \"font-variant-east-asian\",\n \"font-variant-ligatures\",\n \"font-variant-numeric\",\n \"font-variant-position\",\n \"font-weight\",\n \"fontFamily\",\n \"fontFeatureSettings\",\n \"fontKerning\",\n \"fontLanguageOverride\",\n \"fontSize\",\n \"fontSizeAdjust\",\n \"fontSmoothingEnabled\",\n \"fontStretch\",\n \"fontStyle\",\n \"fontSynthesis\",\n \"fontVariant\",\n \"fontVariantAlternates\",\n \"fontVariantCaps\",\n \"fontVariantEastAsian\",\n \"fontVariantLigatures\",\n \"fontVariantNumeric\",\n \"fontVariantPosition\",\n \"fontWeight\",\n \"fontcolor\",\n \"fonts\",\n \"fontsize\",\n \"for\",\n \"forEach\",\n \"forceRedraw\",\n \"form\",\n \"formAction\",\n \"formEnctype\",\n \"formMethod\",\n \"formNoValidate\",\n \"formTarget\",\n \"format\",\n \"forms\",\n \"forward\",\n \"fr\",\n \"frame\",\n \"frameBorder\",\n \"frameElement\",\n \"frameSpacing\",\n \"framebufferRenderbuffer\",\n \"framebufferTexture2D\",\n \"frames\",\n \"freeSpace\",\n \"freeze\",\n \"frequency\",\n \"frequencyBinCount\",\n \"from\",\n \"fromCharCode\",\n \"fromCodePoint\",\n \"fromElement\",\n \"frontFace\",\n \"fround\",\n \"fullScreen\",\n \"fullscreenElement\",\n \"fullscreenEnabled\",\n \"fx\",\n \"fy\",\n \"gain\",\n \"gamepad\",\n \"gamma\",\n \"genderIdentity\",\n \"generateKey\",\n \"generateMipmap\",\n \"generateRequest\",\n \"geolocation\",\n \"gestureObject\",\n \"get\",\n \"getActiveAttrib\",\n \"getActiveUniform\",\n \"getAdjacentText\",\n \"getAll\",\n \"getAllResponseHeaders\",\n \"getAsFile\",\n \"getAsString\",\n \"getAttachedShaders\",\n \"getAttribLocation\",\n \"getAttribute\",\n \"getAttributeNS\",\n \"getAttributeNode\",\n \"getAttributeNodeNS\",\n \"getAudioTracks\",\n \"getBBox\",\n \"getBattery\",\n \"getBlob\",\n \"getBookmark\",\n \"getBoundingClientRect\",\n \"getBufferParameter\",\n \"getByteFrequencyData\",\n \"getByteTimeDomainData\",\n \"getCSSCanvasContext\",\n \"getCTM\",\n \"getCandidateWindowClientRect\",\n \"getChannelData\",\n \"getCharNumAtPosition\",\n \"getClientRect\",\n \"getClientRects\",\n \"getCompositionAlternatives\",\n \"getComputedStyle\",\n \"getComputedTextLength\",\n \"getConfiguration\",\n \"getContext\",\n \"getContextAttributes\",\n \"getCounterValue\",\n \"getCueAsHTML\",\n \"getCueById\",\n \"getCurrentPosition\",\n \"getCurrentTime\",\n \"getData\",\n \"getDatabaseNames\",\n \"getDate\",\n \"getDay\",\n \"getDefaultComputedStyle\",\n \"getDestinationInsertionPoints\",\n \"getDistributedNodes\",\n \"getEditable\",\n \"getElementById\",\n \"getElementsByClassName\",\n \"getElementsByName\",\n \"getElementsByTagName\",\n \"getElementsByTagNameNS\",\n \"getEnclosureList\",\n \"getEndPositionOfChar\",\n \"getEntries\",\n \"getEntriesByName\",\n \"getEntriesByType\",\n \"getError\",\n \"getExtension\",\n \"getExtentOfChar\",\n \"getFeature\",\n \"getFile\",\n \"getFloat32\",\n \"getFloat64\",\n \"getFloatFrequencyData\",\n \"getFloatTimeDomainData\",\n \"getFloatValue\",\n \"getFramebufferAttachmentParameter\",\n \"getFrequencyResponse\",\n \"getFullYear\",\n \"getGamepads\",\n \"getHours\",\n \"getImageData\",\n \"getInt16\",\n \"getInt32\",\n \"getInt8\",\n \"getIntersectionList\",\n \"getItem\",\n \"getItems\",\n \"getKey\",\n \"getLineDash\",\n \"getLocalStreams\",\n \"getMarks\",\n \"getMatchedCSSRules\",\n \"getMeasures\",\n \"getMetadata\",\n \"getMilliseconds\",\n \"getMinutes\",\n \"getModifierState\",\n \"getMonth\",\n \"getNamedItem\",\n \"getNamedItemNS\",\n \"getNotifier\",\n \"getNumberOfChars\",\n \"getOverrideHistoryNavigationMode\",\n \"getOverrideStyle\",\n \"getOwnPropertyDescriptor\",\n \"getOwnPropertyNames\",\n \"getOwnPropertySymbols\",\n \"getParameter\",\n \"getPathSegAtLength\",\n \"getPointAtLength\",\n \"getPreference\",\n \"getPreferenceDefault\",\n \"getPresentationAttribute\",\n \"getPreventDefault\",\n \"getProgramInfoLog\",\n \"getProgramParameter\",\n \"getPropertyCSSValue\",\n \"getPropertyPriority\",\n \"getPropertyShorthand\",\n \"getPropertyValue\",\n \"getPrototypeOf\",\n \"getRGBColorValue\",\n \"getRandomValues\",\n \"getRangeAt\",\n \"getReceivers\",\n \"getRectValue\",\n \"getRegistration\",\n \"getRemoteStreams\",\n \"getRenderbufferParameter\",\n \"getResponseHeader\",\n \"getRoot\",\n \"getRotationOfChar\",\n \"getSVGDocument\",\n \"getScreenCTM\",\n \"getSeconds\",\n \"getSelection\",\n \"getSenders\",\n \"getShaderInfoLog\",\n \"getShaderParameter\",\n \"getShaderPrecisionFormat\",\n \"getShaderSource\",\n \"getSimpleDuration\",\n \"getSiteIcons\",\n \"getSources\",\n \"getSpeculativeParserUrls\",\n \"getStartPositionOfChar\",\n \"getStartTime\",\n \"getStats\",\n \"getStorageUpdates\",\n \"getStreamById\",\n \"getStringValue\",\n \"getSubStringLength\",\n \"getSubscription\",\n \"getSupportedExtensions\",\n \"getTexParameter\",\n \"getTime\",\n \"getTimezoneOffset\",\n \"getTotalLength\",\n \"getTrackById\",\n \"getTracks\",\n \"getTransformToElement\",\n \"getUTCDate\",\n \"getUTCDay\",\n \"getUTCFullYear\",\n \"getUTCHours\",\n \"getUTCMilliseconds\",\n \"getUTCMinutes\",\n \"getUTCMonth\",\n \"getUTCSeconds\",\n \"getUint16\",\n \"getUint32\",\n \"getUint8\",\n \"getUniform\",\n \"getUniformLocation\",\n \"getUserMedia\",\n \"getValues\",\n \"getVarDate\",\n \"getVariableValue\",\n \"getVertexAttrib\",\n \"getVertexAttribOffset\",\n \"getVideoPlaybackQuality\",\n \"getVideoTracks\",\n \"getWakeLockState\",\n \"getYear\",\n \"givenName\",\n \"global\",\n \"globalAlpha\",\n \"globalCompositeOperation\",\n \"glyphOrientationHorizontal\",\n \"glyphOrientationVertical\",\n \"glyphRef\",\n \"go\",\n \"gradientTransform\",\n \"gradientUnits\",\n \"grammars\",\n \"green\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n \"hardwareConcurrency\",\n \"has\",\n \"hasAttribute\",\n \"hasAttributeNS\",\n \"hasAttributes\",\n \"hasChildNodes\",\n \"hasComposition\",\n \"hasExtension\",\n \"hasFeature\",\n \"hasFocus\",\n \"hasLayout\",\n \"hasOwnProperty\",\n \"hash\",\n \"head\",\n \"headers\",\n \"heading\",\n \"height\",\n \"hidden\",\n \"hide\",\n \"hideFocus\",\n \"high\",\n \"hint\",\n \"history\",\n \"honorificPrefix\",\n \"honorificSuffix\",\n \"horizontalOverflow\",\n \"host\",\n \"hostname\",\n \"href\",\n \"hreflang\",\n \"hspace\",\n \"html5TagCheckInerface\",\n \"htmlFor\",\n \"htmlText\",\n \"httpEquiv\",\n \"hwTimestamp\",\n \"hypot\",\n \"iccId\",\n \"iceConnectionState\",\n \"iceGatheringState\",\n \"icon\",\n \"id\",\n \"identifier\",\n \"identity\",\n \"ignoreBOM\",\n \"ignoreCase\",\n \"image-orientation\",\n \"image-rendering\",\n \"imageOrientation\",\n \"imageRendering\",\n \"images\",\n \"ime-mode\",\n \"imeMode\",\n \"implementation\",\n \"importKey\",\n \"importNode\",\n \"importStylesheet\",\n \"imports\",\n \"impp\",\n \"imul\",\n \"in1\",\n \"in2\",\n \"inBandMetadataTrackDispatchType\",\n \"inRange\",\n \"includes\",\n \"incremental\",\n \"indeterminate\",\n \"index\",\n \"indexNames\",\n \"indexOf\",\n \"indexedDB\",\n \"inertiaDestinationX\",\n \"inertiaDestinationY\",\n \"info\",\n \"init\",\n \"initAnimationEvent\",\n \"initBeforeLoadEvent\",\n \"initClipboardEvent\",\n \"initCloseEvent\",\n \"initCommandEvent\",\n \"initCompositionEvent\",\n \"initCustomEvent\",\n \"initData\",\n \"initDeviceMotionEvent\",\n \"initDeviceOrientationEvent\",\n \"initDragEvent\",\n \"initErrorEvent\",\n \"initEvent\",\n \"initFocusEvent\",\n \"initGestureEvent\",\n \"initHashChangeEvent\",\n \"initKeyEvent\",\n \"initKeyboardEvent\",\n \"initMSManipulationEvent\",\n \"initMessageEvent\",\n \"initMouseEvent\",\n \"initMouseScrollEvent\",\n \"initMouseWheelEvent\",\n \"initMutationEvent\",\n \"initNSMouseEvent\",\n \"initOverflowEvent\",\n \"initPageEvent\",\n \"initPageTransitionEvent\",\n \"initPointerEvent\",\n \"initPopStateEvent\",\n \"initProgressEvent\",\n \"initScrollAreaEvent\",\n \"initSimpleGestureEvent\",\n \"initStorageEvent\",\n \"initTextEvent\",\n \"initTimeEvent\",\n \"initTouchEvent\",\n \"initTransitionEvent\",\n \"initUIEvent\",\n \"initWebKitAnimationEvent\",\n \"initWebKitTransitionEvent\",\n \"initWebKitWheelEvent\",\n \"initWheelEvent\",\n \"initialTime\",\n \"initialize\",\n \"initiatorType\",\n \"inner\",\n \"innerHTML\",\n \"innerHeight\",\n \"innerText\",\n \"innerWidth\",\n \"input\",\n \"inputBuffer\",\n \"inputEncoding\",\n \"inputMethod\",\n \"insertAdjacentElement\",\n \"insertAdjacentHTML\",\n \"insertAdjacentText\",\n \"insertBefore\",\n \"insertCell\",\n \"insertData\",\n \"insertItemBefore\",\n \"insertNode\",\n \"insertRow\",\n \"insertRule\",\n \"instanceRoot\",\n \"intercept\",\n \"interimResults\",\n \"internalSubset\",\n \"intersectsNode\",\n \"interval\",\n \"invalidIteratorState\",\n \"inverse\",\n \"invertSelf\",\n \"is\",\n \"is2D\",\n \"isAlternate\",\n \"isArray\",\n \"isBingCurrentSearchDefault\",\n \"isBuffer\",\n \"isCandidateWindowVisible\",\n \"isChar\",\n \"isCollapsed\",\n \"isComposing\",\n \"isContentEditable\",\n \"isContentHandlerRegistered\",\n \"isContextLost\",\n \"isDefaultNamespace\",\n \"isDisabled\",\n \"isEnabled\",\n \"isEqual\",\n \"isEqualNode\",\n \"isExtensible\",\n \"isFinite\",\n \"isFramebuffer\",\n \"isFrozen\",\n \"isGenerator\",\n \"isId\",\n \"isInjected\",\n \"isInteger\",\n \"isMap\",\n \"isMultiLine\",\n \"isNaN\",\n \"isOpen\",\n \"isPointInFill\",\n \"isPointInPath\",\n \"isPointInRange\",\n \"isPointInStroke\",\n \"isPrefAlternate\",\n \"isPrimary\",\n \"isProgram\",\n \"isPropertyImplicit\",\n \"isProtocolHandlerRegistered\",\n \"isPrototypeOf\",\n \"isRenderbuffer\",\n \"isSafeInteger\",\n \"isSameNode\",\n \"isSealed\",\n \"isShader\",\n \"isSupported\",\n \"isTextEdit\",\n \"isTexture\",\n \"isTrusted\",\n \"isTypeSupported\",\n \"isView\",\n \"isolation\",\n \"italics\",\n \"item\",\n \"itemId\",\n \"itemProp\",\n \"itemRef\",\n \"itemScope\",\n \"itemType\",\n \"itemValue\",\n \"iterateNext\",\n \"iterator\",\n \"javaEnabled\",\n \"jobTitle\",\n \"join\",\n \"json\",\n \"justify-content\",\n \"justifyContent\",\n \"k1\",\n \"k2\",\n \"k3\",\n \"k4\",\n \"kernelMatrix\",\n \"kernelUnitLengthX\",\n \"kernelUnitLengthY\",\n \"kerning\",\n \"key\",\n \"keyCode\",\n \"keyFor\",\n \"keyIdentifier\",\n \"keyLightEnabled\",\n \"keyLocation\",\n \"keyPath\",\n \"keySystem\",\n \"keyText\",\n \"keyUsage\",\n \"keys\",\n \"keytype\",\n \"kind\",\n \"knee\",\n \"label\",\n \"labels\",\n \"lang\",\n \"language\",\n \"languages\",\n \"largeArcFlag\",\n \"lastChild\",\n \"lastElementChild\",\n \"lastEventId\",\n \"lastIndex\",\n \"lastIndexOf\",\n \"lastMatch\",\n \"lastMessageSubject\",\n \"lastMessageType\",\n \"lastModified\",\n \"lastModifiedDate\",\n \"lastPage\",\n \"lastParen\",\n \"lastState\",\n \"lastStyleSheetSet\",\n \"latitude\",\n \"layerX\",\n \"layerY\",\n \"layoutFlow\",\n \"layoutGrid\",\n \"layoutGridChar\",\n \"layoutGridLine\",\n \"layoutGridMode\",\n \"layoutGridType\",\n \"lbound\",\n \"left\",\n \"leftContext\",\n \"leftMargin\",\n \"length\",\n \"lengthAdjust\",\n \"lengthComputable\",\n \"letter-spacing\",\n \"letterSpacing\",\n \"level\",\n \"lighting-color\",\n \"lightingColor\",\n \"limitingConeAngle\",\n \"line\",\n \"line-height\",\n \"lineAlign\",\n \"lineBreak\",\n \"lineCap\",\n \"lineDashOffset\",\n \"lineHeight\",\n \"lineJoin\",\n \"lineNumber\",\n \"lineTo\",\n \"lineWidth\",\n \"linearRampToValueAtTime\",\n \"lineno\",\n \"link\",\n \"linkColor\",\n \"linkProgram\",\n \"links\",\n \"list\",\n \"list-style\",\n \"list-style-image\",\n \"list-style-position\",\n \"list-style-type\",\n \"listStyle\",\n \"listStyleImage\",\n \"listStylePosition\",\n \"listStyleType\",\n \"listener\",\n \"load\",\n \"loadEventEnd\",\n \"loadEventStart\",\n \"loadTimes\",\n \"loaded\",\n \"localDescription\",\n \"localName\",\n \"localStorage\",\n \"locale\",\n \"localeCompare\",\n \"location\",\n \"locationbar\",\n \"lock\",\n \"lockedFile\",\n \"log\",\n \"log10\",\n \"log1p\",\n \"log2\",\n \"logicalXDPI\",\n \"logicalYDPI\",\n \"longDesc\",\n \"longitude\",\n \"lookupNamespaceURI\",\n \"lookupPrefix\",\n \"loop\",\n \"loopEnd\",\n \"loopStart\",\n \"looping\",\n \"low\",\n \"lower\",\n \"lowerBound\",\n \"lowerOpen\",\n \"lowsrc\",\n \"m11\",\n \"m12\",\n \"m13\",\n \"m14\",\n \"m21\",\n \"m22\",\n \"m23\",\n \"m24\",\n \"m31\",\n \"m32\",\n \"m33\",\n \"m34\",\n \"m41\",\n \"m42\",\n \"m43\",\n \"m44\",\n \"manifest\",\n \"map\",\n \"mapping\",\n \"margin\",\n \"margin-bottom\",\n \"margin-left\",\n \"margin-right\",\n \"margin-top\",\n \"marginBottom\",\n \"marginHeight\",\n \"marginLeft\",\n \"marginRight\",\n \"marginTop\",\n \"marginWidth\",\n \"mark\",\n \"marker\",\n \"marker-end\",\n \"marker-mid\",\n \"marker-offset\",\n \"marker-start\",\n \"markerEnd\",\n \"markerHeight\",\n \"markerMid\",\n \"markerOffset\",\n \"markerStart\",\n \"markerUnits\",\n \"markerWidth\",\n \"marks\",\n \"mask\",\n \"mask-type\",\n \"maskContentUnits\",\n \"maskType\",\n \"maskUnits\",\n \"match\",\n \"matchMedia\",\n \"matchMedium\",\n \"matches\",\n \"matrix\",\n \"matrixTransform\",\n \"max\",\n \"max-height\",\n \"max-width\",\n \"maxAlternatives\",\n \"maxChannelCount\",\n \"maxConnectionsPerServer\",\n \"maxDecibels\",\n \"maxDistance\",\n \"maxHeight\",\n \"maxLength\",\n \"maxTouchPoints\",\n \"maxValue\",\n \"maxWidth\",\n \"measure\",\n \"measureText\",\n \"media\",\n \"mediaDevices\",\n \"mediaElement\",\n \"mediaGroup\",\n \"mediaKeys\",\n \"mediaText\",\n \"meetOrSlice\",\n \"memory\",\n \"menubar\",\n \"mergeAttributes\",\n \"message\",\n \"messageClass\",\n \"messageHandlers\",\n \"metaKey\",\n \"method\",\n \"mimeType\",\n \"mimeTypes\",\n \"min\",\n \"min-height\",\n \"min-width\",\n \"minDecibels\",\n \"minHeight\",\n \"minValue\",\n \"minWidth\",\n \"miterLimit\",\n \"mix-blend-mode\",\n \"mixBlendMode\",\n \"mode\",\n \"modify\",\n \"mount\",\n \"move\",\n \"moveBy\",\n \"moveEnd\",\n \"moveFirst\",\n \"moveFocusDown\",\n \"moveFocusLeft\",\n \"moveFocusRight\",\n \"moveFocusUp\",\n \"moveNext\",\n \"moveRow\",\n \"moveStart\",\n \"moveTo\",\n \"moveToBookmark\",\n \"moveToElementText\",\n \"moveToPoint\",\n \"mozAdd\",\n \"mozAnimationStartTime\",\n \"mozAnon\",\n \"mozApps\",\n \"mozAudioCaptured\",\n \"mozAudioChannelType\",\n \"mozAutoplayEnabled\",\n \"mozCancelAnimationFrame\",\n \"mozCancelFullScreen\",\n \"mozCancelRequestAnimationFrame\",\n \"mozCaptureStream\",\n \"mozCaptureStreamUntilEnded\",\n \"mozClearDataAt\",\n \"mozContact\",\n \"mozContacts\",\n \"mozCreateFileHandle\",\n \"mozCurrentTransform\",\n \"mozCurrentTransformInverse\",\n \"mozCursor\",\n \"mozDash\",\n \"mozDashOffset\",\n \"mozDecodedFrames\",\n \"mozExitPointerLock\",\n \"mozFillRule\",\n \"mozFragmentEnd\",\n \"mozFrameDelay\",\n \"mozFullScreen\",\n \"mozFullScreenElement\",\n \"mozFullScreenEnabled\",\n \"mozGetAll\",\n \"mozGetAllKeys\",\n \"mozGetAsFile\",\n \"mozGetDataAt\",\n \"mozGetMetadata\",\n \"mozGetUserMedia\",\n \"mozHasAudio\",\n \"mozHasItem\",\n \"mozHidden\",\n \"mozImageSmoothingEnabled\",\n \"mozIndexedDB\",\n \"mozInnerScreenX\",\n \"mozInnerScreenY\",\n \"mozInputSource\",\n \"mozIsTextField\",\n \"mozItem\",\n \"mozItemCount\",\n \"mozItems\",\n \"mozLength\",\n \"mozLockOrientation\",\n \"mozMatchesSelector\",\n \"mozMovementX\",\n \"mozMovementY\",\n \"mozOpaque\",\n \"mozOrientation\",\n \"mozPaintCount\",\n \"mozPaintedFrames\",\n \"mozParsedFrames\",\n \"mozPay\",\n \"mozPointerLockElement\",\n \"mozPresentedFrames\",\n \"mozPreservesPitch\",\n \"mozPressure\",\n \"mozPrintCallback\",\n \"mozRTCIceCandidate\",\n \"mozRTCPeerConnection\",\n \"mozRTCSessionDescription\",\n \"mozRemove\",\n \"mozRequestAnimationFrame\",\n \"mozRequestFullScreen\",\n \"mozRequestPointerLock\",\n \"mozSetDataAt\",\n \"mozSetImageElement\",\n \"mozSourceNode\",\n \"mozSrcObject\",\n \"mozSystem\",\n \"mozTCPSocket\",\n \"mozTextStyle\",\n \"mozTypesAt\",\n \"mozUnlockOrientation\",\n \"mozUserCancelled\",\n \"mozVisibilityState\",\n \"msAnimation\",\n \"msAnimationDelay\",\n \"msAnimationDirection\",\n \"msAnimationDuration\",\n \"msAnimationFillMode\",\n \"msAnimationIterationCount\",\n \"msAnimationName\",\n \"msAnimationPlayState\",\n \"msAnimationStartTime\",\n \"msAnimationTimingFunction\",\n \"msBackfaceVisibility\",\n \"msBlockProgression\",\n \"msCSSOMElementFloatMetrics\",\n \"msCaching\",\n \"msCachingEnabled\",\n \"msCancelRequestAnimationFrame\",\n \"msCapsLockWarningOff\",\n \"msClearImmediate\",\n \"msClose\",\n \"msContentZoomChaining\",\n \"msContentZoomFactor\",\n \"msContentZoomLimit\",\n \"msContentZoomLimitMax\",\n \"msContentZoomLimitMin\",\n \"msContentZoomSnap\",\n \"msContentZoomSnapPoints\",\n \"msContentZoomSnapType\",\n \"msContentZooming\",\n \"msConvertURL\",\n \"msCrypto\",\n \"msDoNotTrack\",\n \"msElementsFromPoint\",\n \"msElementsFromRect\",\n \"msExitFullscreen\",\n \"msExtendedCode\",\n \"msFillRule\",\n \"msFirstPaint\",\n \"msFlex\",\n \"msFlexAlign\",\n \"msFlexDirection\",\n \"msFlexFlow\",\n \"msFlexItemAlign\",\n \"msFlexLinePack\",\n \"msFlexNegative\",\n \"msFlexOrder\",\n \"msFlexPack\",\n \"msFlexPositive\",\n \"msFlexPreferredSize\",\n \"msFlexWrap\",\n \"msFlowFrom\",\n \"msFlowInto\",\n \"msFontFeatureSettings\",\n \"msFullscreenElement\",\n \"msFullscreenEnabled\",\n \"msGetInputContext\",\n \"msGetRegionContent\",\n \"msGetUntransformedBounds\",\n \"msGraphicsTrustStatus\",\n \"msGridColumn\",\n \"msGridColumnAlign\",\n \"msGridColumnSpan\",\n \"msGridColumns\",\n \"msGridRow\",\n \"msGridRowAlign\",\n \"msGridRowSpan\",\n \"msGridRows\",\n \"msHidden\",\n \"msHighContrastAdjust\",\n \"msHyphenateLimitChars\",\n \"msHyphenateLimitLines\",\n \"msHyphenateLimitZone\",\n \"msHyphens\",\n \"msImageSmoothingEnabled\",\n \"msImeAlign\",\n \"msIndexedDB\",\n \"msInterpolationMode\",\n \"msIsStaticHTML\",\n \"msKeySystem\",\n \"msKeys\",\n \"msLaunchUri\",\n \"msLockOrientation\",\n \"msManipulationViewsEnabled\",\n \"msMatchMedia\",\n \"msMatchesSelector\",\n \"msMaxTouchPoints\",\n \"msOrientation\",\n \"msOverflowStyle\",\n \"msPerspective\",\n \"msPerspectiveOrigin\",\n \"msPlayToDisabled\",\n \"msPlayToPreferredSourceUri\",\n \"msPlayToPrimary\",\n \"msPointerEnabled\",\n \"msRegionOverflow\",\n \"msReleasePointerCapture\",\n \"msRequestAnimationFrame\",\n \"msRequestFullscreen\",\n \"msSaveBlob\",\n \"msSaveOrOpenBlob\",\n \"msScrollChaining\",\n \"msScrollLimit\",\n \"msScrollLimitXMax\",\n \"msScrollLimitXMin\",\n \"msScrollLimitYMax\",\n \"msScrollLimitYMin\",\n \"msScrollRails\",\n \"msScrollSnapPointsX\",\n \"msScrollSnapPointsY\",\n \"msScrollSnapType\",\n \"msScrollSnapX\",\n \"msScrollSnapY\",\n \"msScrollTranslation\",\n \"msSetImmediate\",\n \"msSetMediaKeys\",\n \"msSetPointerCapture\",\n \"msTextCombineHorizontal\",\n \"msTextSizeAdjust\",\n \"msToBlob\",\n \"msTouchAction\",\n \"msTouchSelect\",\n \"msTraceAsyncCallbackCompleted\",\n \"msTraceAsyncCallbackStarting\",\n \"msTraceAsyncOperationCompleted\",\n \"msTraceAsyncOperationStarting\",\n \"msTransform\",\n \"msTransformOrigin\",\n \"msTransformStyle\",\n \"msTransition\",\n \"msTransitionDelay\",\n \"msTransitionDuration\",\n \"msTransitionProperty\",\n \"msTransitionTimingFunction\",\n \"msUnlockOrientation\",\n \"msUpdateAsyncCallbackRelation\",\n \"msUserSelect\",\n \"msVisibilityState\",\n \"msWrapFlow\",\n \"msWrapMargin\",\n \"msWrapThrough\",\n \"msWriteProfilerMark\",\n \"msZoom\",\n \"msZoomTo\",\n \"mt\",\n \"multiEntry\",\n \"multiSelectionObj\",\n \"multiline\",\n \"multiple\",\n \"multiply\",\n \"multiplySelf\",\n \"mutableFile\",\n \"muted\",\n \"n\",\n \"name\",\n \"nameProp\",\n \"namedItem\",\n \"namedRecordset\",\n \"names\",\n \"namespaceURI\",\n \"namespaces\",\n \"naturalHeight\",\n \"naturalWidth\",\n \"navigate\",\n \"navigation\",\n \"navigationMode\",\n \"navigationStart\",\n \"navigator\",\n \"near\",\n \"nearestViewportElement\",\n \"negative\",\n \"netscape\",\n \"networkState\",\n \"newScale\",\n \"newTranslate\",\n \"newURL\",\n \"newValue\",\n \"newValueSpecifiedUnits\",\n \"newVersion\",\n \"newhome\",\n \"next\",\n \"nextElementSibling\",\n \"nextNode\",\n \"nextPage\",\n \"nextSibling\",\n \"nickname\",\n \"noHref\",\n \"noResize\",\n \"noShade\",\n \"noValidate\",\n \"noWrap\",\n \"nodeName\",\n \"nodeType\",\n \"nodeValue\",\n \"normalize\",\n \"normalizedPathSegList\",\n \"notationName\",\n \"notations\",\n \"note\",\n \"noteGrainOn\",\n \"noteOff\",\n \"noteOn\",\n \"now\",\n \"numOctaves\",\n \"number\",\n \"numberOfChannels\",\n \"numberOfInputs\",\n \"numberOfItems\",\n \"numberOfOutputs\",\n \"numberValue\",\n \"oMatchesSelector\",\n \"object\",\n \"object-fit\",\n \"object-position\",\n \"objectFit\",\n \"objectPosition\",\n \"objectStore\",\n \"objectStoreNames\",\n \"observe\",\n \"of\",\n \"offscreenBuffering\",\n \"offset\",\n \"offsetHeight\",\n \"offsetLeft\",\n \"offsetNode\",\n \"offsetParent\",\n \"offsetTop\",\n \"offsetWidth\",\n \"offsetX\",\n \"offsetY\",\n \"ok\",\n \"oldURL\",\n \"oldValue\",\n \"oldVersion\",\n \"olderShadowRoot\",\n \"onLine\",\n \"onabort\",\n \"onactivate\",\n \"onactive\",\n \"onaddstream\",\n \"onaddtrack\",\n \"onafterprint\",\n \"onafterscriptexecute\",\n \"onafterupdate\",\n \"onaudioend\",\n \"onaudioprocess\",\n \"onaudiostart\",\n \"onautocomplete\",\n \"onautocompleteerror\",\n \"onbeforeactivate\",\n \"onbeforecopy\",\n \"onbeforecut\",\n \"onbeforedeactivate\",\n \"onbeforeeditfocus\",\n \"onbeforepaste\",\n \"onbeforeprint\",\n \"onbeforescriptexecute\",\n \"onbeforeunload\",\n \"onbeforeupdate\",\n \"onblocked\",\n \"onblur\",\n \"onbounce\",\n \"onboundary\",\n \"oncached\",\n \"oncancel\",\n \"oncandidatewindowhide\",\n \"oncandidatewindowshow\",\n \"oncandidatewindowupdate\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"oncellchange\",\n \"onchange\",\n \"onchargingchange\",\n \"onchargingtimechange\",\n \"onchecking\",\n \"onclick\",\n \"onclose\",\n \"oncompassneedscalibration\",\n \"oncomplete\",\n \"oncontextmenu\",\n \"oncontrolselect\",\n \"oncopy\",\n \"oncuechange\",\n \"oncut\",\n \"ondataavailable\",\n \"ondatachannel\",\n \"ondatasetchanged\",\n \"ondatasetcomplete\",\n \"ondblclick\",\n \"ondeactivate\",\n \"ondevicelight\",\n \"ondevicemotion\",\n \"ondeviceorientation\",\n \"ondeviceproximity\",\n \"ondischargingtimechange\",\n \"ondisplay\",\n \"ondownloading\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onencrypted\",\n \"onend\",\n \"onended\",\n \"onenter\",\n \"onerror\",\n \"onerrorupdate\",\n \"onexit\",\n \"onfilterchange\",\n \"onfinish\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onfullscreenchange\",\n \"onfullscreenerror\",\n \"ongesturechange\",\n \"ongestureend\",\n \"ongesturestart\",\n \"ongotpointercapture\",\n \"onhashchange\",\n \"onhelp\",\n \"onicecandidate\",\n \"oniceconnectionstatechange\",\n \"oninactive\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onlanguagechange\",\n \"onlayoutcomplete\",\n \"onlevelchange\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadend\",\n \"onloadstart\",\n \"onlosecapture\",\n \"onlostpointercapture\",\n \"only\",\n \"onmark\",\n \"onmessage\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onmousewheel\",\n \"onmove\",\n \"onmoveend\",\n \"onmovestart\",\n \"onmozfullscreenchange\",\n \"onmozfullscreenerror\",\n \"onmozorientationchange\",\n \"onmozpointerlockchange\",\n \"onmozpointerlockerror\",\n \"onmscontentzoom\",\n \"onmsfullscreenchange\",\n \"onmsfullscreenerror\",\n \"onmsgesturechange\",\n \"onmsgesturedoubletap\",\n \"onmsgestureend\",\n \"onmsgesturehold\",\n \"onmsgesturestart\",\n \"onmsgesturetap\",\n \"onmsgotpointercapture\",\n \"onmsinertiastart\",\n \"onmslostpointercapture\",\n \"onmsmanipulationstatechanged\",\n \"onmsneedkey\",\n \"onmsorientationchange\",\n \"onmspointercancel\",\n \"onmspointerdown\",\n \"onmspointerenter\",\n \"onmspointerhover\",\n \"onmspointerleave\",\n \"onmspointermove\",\n \"onmspointerout\",\n \"onmspointerover\",\n \"onmspointerup\",\n \"onmssitemodejumplistitemremoved\",\n \"onmsthumbnailclick\",\n \"onnegotiationneeded\",\n \"onnomatch\",\n \"onnoupdate\",\n \"onobsolete\",\n \"onoffline\",\n \"ononline\",\n \"onopen\",\n \"onorientationchange\",\n \"onpagechange\",\n \"onpagehide\",\n \"onpageshow\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpluginstreamstart\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointerlockchange\",\n \"onpointerlockerror\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onpopstate\",\n \"onprogress\",\n \"onpropertychange\",\n \"onratechange\",\n \"onreadystatechange\",\n \"onremovestream\",\n \"onremovetrack\",\n \"onreset\",\n \"onresize\",\n \"onresizeend\",\n \"onresizestart\",\n \"onresourcetimingbufferfull\",\n \"onresult\",\n \"onresume\",\n \"onrowenter\",\n \"onrowexit\",\n \"onrowsdelete\",\n \"onrowsinserted\",\n \"onscroll\",\n \"onsearch\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onshow\",\n \"onsignalingstatechange\",\n \"onsoundend\",\n \"onsoundstart\",\n \"onspeechend\",\n \"onspeechstart\",\n \"onstalled\",\n \"onstart\",\n \"onstatechange\",\n \"onstop\",\n \"onstorage\",\n \"onstoragecommit\",\n \"onsubmit\",\n \"onsuccess\",\n \"onsuspend\",\n \"ontextinput\",\n \"ontimeout\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitionend\",\n \"onunload\",\n \"onupdateready\",\n \"onupgradeneeded\",\n \"onuserproximity\",\n \"onversionchange\",\n \"onvoiceschanged\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwarning\",\n \"onwebkitanimationend\",\n \"onwebkitanimationiteration\",\n \"onwebkitanimationstart\",\n \"onwebkitcurrentplaybacktargetiswirelesschanged\",\n \"onwebkitfullscreenchange\",\n \"onwebkitfullscreenerror\",\n \"onwebkitkeyadded\",\n \"onwebkitkeyerror\",\n \"onwebkitkeymessage\",\n \"onwebkitneedkey\",\n \"onwebkitorientationchange\",\n \"onwebkitplaybacktargetavailabilitychanged\",\n \"onwebkitpointerlockchange\",\n \"onwebkitpointerlockerror\",\n \"onwebkitresourcetimingbufferfull\",\n \"onwebkittransitionend\",\n \"onwheel\",\n \"onzoom\",\n \"opacity\",\n \"open\",\n \"openCursor\",\n \"openDatabase\",\n \"openKeyCursor\",\n \"opener\",\n \"opera\",\n \"operationType\",\n \"operator\",\n \"opr\",\n \"optimum\",\n \"options\",\n \"order\",\n \"orderX\",\n \"orderY\",\n \"ordered\",\n \"org\",\n \"orient\",\n \"orientAngle\",\n \"orientType\",\n \"orientation\",\n \"origin\",\n \"originalTarget\",\n \"orphans\",\n \"oscpu\",\n \"outerHTML\",\n \"outerHeight\",\n \"outerText\",\n \"outerWidth\",\n \"outline\",\n \"outline-color\",\n \"outline-offset\",\n \"outline-style\",\n \"outline-width\",\n \"outlineColor\",\n \"outlineOffset\",\n \"outlineStyle\",\n \"outlineWidth\",\n \"outputBuffer\",\n \"overflow\",\n \"overflow-x\",\n \"overflow-y\",\n \"overflowX\",\n \"overflowY\",\n \"overrideMimeType\",\n \"oversample\",\n \"ownerDocument\",\n \"ownerElement\",\n \"ownerNode\",\n \"ownerRule\",\n \"ownerSVGElement\",\n \"owningElement\",\n \"p1\",\n \"p2\",\n \"p3\",\n \"p4\",\n \"pad\",\n \"padding\",\n \"padding-bottom\",\n \"padding-left\",\n \"padding-right\",\n \"padding-top\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingRight\",\n \"paddingTop\",\n \"page\",\n \"page-break-after\",\n \"page-break-before\",\n \"page-break-inside\",\n \"pageBreakAfter\",\n \"pageBreakBefore\",\n \"pageBreakInside\",\n \"pageCount\",\n \"pageX\",\n \"pageXOffset\",\n \"pageY\",\n \"pageYOffset\",\n \"pages\",\n \"paint-order\",\n \"paintOrder\",\n \"paintRequests\",\n \"paintType\",\n \"palette\",\n \"panningModel\",\n \"parent\",\n \"parentElement\",\n \"parentNode\",\n \"parentRule\",\n \"parentStyleSheet\",\n \"parentTextEdit\",\n \"parentWindow\",\n \"parse\",\n \"parseFloat\",\n \"parseFromString\",\n \"parseInt\",\n \"participants\",\n \"password\",\n \"pasteHTML\",\n \"path\",\n \"pathLength\",\n \"pathSegList\",\n \"pathSegType\",\n \"pathSegTypeAsLetter\",\n \"pathname\",\n \"pattern\",\n \"patternContentUnits\",\n \"patternMismatch\",\n \"patternTransform\",\n \"patternUnits\",\n \"pause\",\n \"pauseAnimations\",\n \"pauseOnExit\",\n \"paused\",\n \"pending\",\n \"performance\",\n \"permission\",\n \"persisted\",\n \"personalbar\",\n \"perspective\",\n \"perspective-origin\",\n \"perspectiveOrigin\",\n \"phoneticFamilyName\",\n \"phoneticGivenName\",\n \"photo\",\n \"ping\",\n \"pitch\",\n \"pixelBottom\",\n \"pixelDepth\",\n \"pixelHeight\",\n \"pixelLeft\",\n \"pixelRight\",\n \"pixelStorei\",\n \"pixelTop\",\n \"pixelUnitToMillimeterX\",\n \"pixelUnitToMillimeterY\",\n \"pixelWidth\",\n \"placeholder\",\n \"platform\",\n \"play\",\n \"playbackRate\",\n \"playbackState\",\n \"playbackTime\",\n \"played\",\n \"plugins\",\n \"pluginspage\",\n \"pname\",\n \"pointer-events\",\n \"pointerBeforeReferenceNode\",\n \"pointerEnabled\",\n \"pointerEvents\",\n \"pointerId\",\n \"pointerLockElement\",\n \"pointerType\",\n \"points\",\n \"pointsAtX\",\n \"pointsAtY\",\n \"pointsAtZ\",\n \"polygonOffset\",\n \"pop\",\n \"popupWindowFeatures\",\n \"popupWindowName\",\n \"popupWindowURI\",\n \"port\",\n \"port1\",\n \"port2\",\n \"ports\",\n \"posBottom\",\n \"posHeight\",\n \"posLeft\",\n \"posRight\",\n \"posTop\",\n \"posWidth\",\n \"position\",\n \"positionAlign\",\n \"postError\",\n \"postMessage\",\n \"poster\",\n \"pow\",\n \"powerOff\",\n \"preMultiplySelf\",\n \"precision\",\n \"preferredStyleSheetSet\",\n \"preferredStylesheetSet\",\n \"prefix\",\n \"preload\",\n \"preserveAlpha\",\n \"preserveAspectRatio\",\n \"preserveAspectRatioString\",\n \"pressed\",\n \"pressure\",\n \"prevValue\",\n \"preventDefault\",\n \"preventExtensions\",\n \"previousElementSibling\",\n \"previousNode\",\n \"previousPage\",\n \"previousScale\",\n \"previousSibling\",\n \"previousTranslate\",\n \"primaryKey\",\n \"primitiveType\",\n \"primitiveUnits\",\n \"principals\",\n \"print\",\n \"privateKey\",\n \"probablySupportsContext\",\n \"process\",\n \"processIceMessage\",\n \"product\",\n \"productSub\",\n \"profile\",\n \"profileEnd\",\n \"profiles\",\n \"prompt\",\n \"properties\",\n \"propertyIsEnumerable\",\n \"propertyName\",\n \"protocol\",\n \"protocolLong\",\n \"prototype\",\n \"pseudoClass\",\n \"pseudoElement\",\n \"publicId\",\n \"publicKey\",\n \"published\",\n \"push\",\n \"pushNotification\",\n \"pushState\",\n \"put\",\n \"putImageData\",\n \"quadraticCurveTo\",\n \"qualifier\",\n \"queryCommandEnabled\",\n \"queryCommandIndeterm\",\n \"queryCommandState\",\n \"queryCommandSupported\",\n \"queryCommandText\",\n \"queryCommandValue\",\n \"querySelector\",\n \"querySelectorAll\",\n \"quote\",\n \"quotes\",\n \"r\",\n \"r1\",\n \"r2\",\n \"race\",\n \"radiogroup\",\n \"radiusX\",\n \"radiusY\",\n \"random\",\n \"range\",\n \"rangeCount\",\n \"rangeMax\",\n \"rangeMin\",\n \"rangeOffset\",\n \"rangeOverflow\",\n \"rangeParent\",\n \"rangeUnderflow\",\n \"rate\",\n \"ratio\",\n \"raw\",\n \"read\",\n \"readAsArrayBuffer\",\n \"readAsBinaryString\",\n \"readAsBlob\",\n \"readAsDataURL\",\n \"readAsText\",\n \"readOnly\",\n \"readPixels\",\n \"readReportRequested\",\n \"readyState\",\n \"reason\",\n \"reboot\",\n \"receiver\",\n \"receivers\",\n \"recordNumber\",\n \"recordset\",\n \"rect\",\n \"red\",\n \"redirectCount\",\n \"redirectEnd\",\n \"redirectStart\",\n \"reduce\",\n \"reduceRight\",\n \"reduction\",\n \"refDistance\",\n \"refX\",\n \"refY\",\n \"referenceNode\",\n \"referrer\",\n \"refresh\",\n \"region\",\n \"regionAnchorX\",\n \"regionAnchorY\",\n \"regionId\",\n \"regions\",\n \"register\",\n \"registerContentHandler\",\n \"registerElement\",\n \"registerProtocolHandler\",\n \"reject\",\n \"rel\",\n \"relList\",\n \"relatedNode\",\n \"relatedTarget\",\n \"release\",\n \"releaseCapture\",\n \"releaseEvents\",\n \"releasePointerCapture\",\n \"releaseShaderCompiler\",\n \"reliable\",\n \"reload\",\n \"remainingSpace\",\n \"remoteDescription\",\n \"remove\",\n \"removeAllRanges\",\n \"removeAttribute\",\n \"removeAttributeNS\",\n \"removeAttributeNode\",\n \"removeBehavior\",\n \"removeChild\",\n \"removeCue\",\n \"removeEventListener\",\n \"removeFilter\",\n \"removeImport\",\n \"removeItem\",\n \"removeListener\",\n \"removeNamedItem\",\n \"removeNamedItemNS\",\n \"removeNode\",\n \"removeParameter\",\n \"removeProperty\",\n \"removeRange\",\n \"removeRegion\",\n \"removeRule\",\n \"removeSiteSpecificTrackingException\",\n \"removeSourceBuffer\",\n \"removeStream\",\n \"removeTrack\",\n \"removeVariable\",\n \"removeWakeLockListener\",\n \"removeWebWideTrackingException\",\n \"removedNodes\",\n \"renderbufferStorage\",\n \"renderedBuffer\",\n \"renderingMode\",\n \"repeat\",\n \"replace\",\n \"replaceAdjacentText\",\n \"replaceChild\",\n \"replaceData\",\n \"replaceId\",\n \"replaceItem\",\n \"replaceNode\",\n \"replaceState\",\n \"replaceTrack\",\n \"replaceWholeText\",\n \"reportValidity\",\n \"requestAnimationFrame\",\n \"requestAutocomplete\",\n \"requestData\",\n \"requestFullscreen\",\n \"requestMediaKeySystemAccess\",\n \"requestPermission\",\n \"requestPointerLock\",\n \"requestStart\",\n \"requestingWindow\",\n \"required\",\n \"requiredExtensions\",\n \"requiredFeatures\",\n \"reset\",\n \"resetTransform\",\n \"resize\",\n \"resizeBy\",\n \"resizeTo\",\n \"resolve\",\n \"response\",\n \"responseBody\",\n \"responseEnd\",\n \"responseStart\",\n \"responseText\",\n \"responseType\",\n \"responseURL\",\n \"responseXML\",\n \"restore\",\n \"result\",\n \"resultType\",\n \"resume\",\n \"returnValue\",\n \"rev\",\n \"reverse\",\n \"reversed\",\n \"revocable\",\n \"revokeObjectURL\",\n \"rgbColor\",\n \"right\",\n \"rightContext\",\n \"rightMargin\",\n \"rolloffFactor\",\n \"root\",\n \"rootElement\",\n \"rotate\",\n \"rotateAxisAngle\",\n \"rotateAxisAngleSelf\",\n \"rotateFromVector\",\n \"rotateFromVectorSelf\",\n \"rotateSelf\",\n \"rotation\",\n \"rotationRate\",\n \"round\",\n \"rowIndex\",\n \"rowSpan\",\n \"rows\",\n \"rubyAlign\",\n \"rubyOverhang\",\n \"rubyPosition\",\n \"rules\",\n \"runtime\",\n \"runtimeStyle\",\n \"rx\",\n \"ry\",\n \"safari\",\n \"sampleCoverage\",\n \"sampleRate\",\n \"sandbox\",\n \"save\",\n \"scale\",\n \"scale3d\",\n \"scale3dSelf\",\n \"scaleNonUniform\",\n \"scaleNonUniformSelf\",\n \"scaleSelf\",\n \"scheme\",\n \"scissor\",\n \"scope\",\n \"scopeName\",\n \"scoped\",\n \"screen\",\n \"screenBrightness\",\n \"screenEnabled\",\n \"screenLeft\",\n \"screenPixelToMillimeterX\",\n \"screenPixelToMillimeterY\",\n \"screenTop\",\n \"screenX\",\n \"screenY\",\n \"scripts\",\n \"scroll\",\n \"scroll-behavior\",\n \"scrollAmount\",\n \"scrollBehavior\",\n \"scrollBy\",\n \"scrollByLines\",\n \"scrollByPages\",\n \"scrollDelay\",\n \"scrollHeight\",\n \"scrollIntoView\",\n \"scrollIntoViewIfNeeded\",\n \"scrollLeft\",\n \"scrollLeftMax\",\n \"scrollMaxX\",\n \"scrollMaxY\",\n \"scrollTo\",\n \"scrollTop\",\n \"scrollTopMax\",\n \"scrollWidth\",\n \"scrollX\",\n \"scrollY\",\n \"scrollbar3dLightColor\",\n \"scrollbarArrowColor\",\n \"scrollbarBaseColor\",\n \"scrollbarDarkShadowColor\",\n \"scrollbarFaceColor\",\n \"scrollbarHighlightColor\",\n \"scrollbarShadowColor\",\n \"scrollbarTrackColor\",\n \"scrollbars\",\n \"scrolling\",\n \"sdp\",\n \"sdpMLineIndex\",\n \"sdpMid\",\n \"seal\",\n \"search\",\n \"searchBox\",\n \"searchBoxJavaBridge_\",\n \"searchParams\",\n \"sectionRowIndex\",\n \"secureConnectionStart\",\n \"security\",\n \"seed\",\n \"seekable\",\n \"seeking\",\n \"select\",\n \"selectAllChildren\",\n \"selectNode\",\n \"selectNodeContents\",\n \"selectNodes\",\n \"selectSingleNode\",\n \"selectSubString\",\n \"selected\",\n \"selectedIndex\",\n \"selectedOptions\",\n \"selectedStyleSheetSet\",\n \"selectedStylesheetSet\",\n \"selection\",\n \"selectionDirection\",\n \"selectionEnd\",\n \"selectionStart\",\n \"selector\",\n \"selectorText\",\n \"self\",\n \"send\",\n \"sendAsBinary\",\n \"sendBeacon\",\n \"sender\",\n \"sentTimestamp\",\n \"separator\",\n \"serializeToString\",\n \"serviceWorker\",\n \"sessionId\",\n \"sessionStorage\",\n \"set\",\n \"setActive\",\n \"setAlpha\",\n \"setAttribute\",\n \"setAttributeNS\",\n \"setAttributeNode\",\n \"setAttributeNodeNS\",\n \"setBaseAndExtent\",\n \"setBingCurrentSearchDefault\",\n \"setCapture\",\n \"setColor\",\n \"setCompositeOperation\",\n \"setCurrentTime\",\n \"setCustomValidity\",\n \"setData\",\n \"setDate\",\n \"setDragImage\",\n \"setEnd\",\n \"setEndAfter\",\n \"setEndBefore\",\n \"setEndPoint\",\n \"setFillColor\",\n \"setFilterRes\",\n \"setFloat32\",\n \"setFloat64\",\n \"setFloatValue\",\n \"setFullYear\",\n \"setHours\",\n \"setImmediate\",\n \"setInt16\",\n \"setInt32\",\n \"setInt8\",\n \"setInterval\",\n \"setItem\",\n \"setLineCap\",\n \"setLineDash\",\n \"setLineJoin\",\n \"setLineWidth\",\n \"setLocalDescription\",\n \"setMatrix\",\n \"setMatrixValue\",\n \"setMediaKeys\",\n \"setMilliseconds\",\n \"setMinutes\",\n \"setMiterLimit\",\n \"setMonth\",\n \"setNamedItem\",\n \"setNamedItemNS\",\n \"setNonUserCodeExceptions\",\n \"setOrientToAngle\",\n \"setOrientToAuto\",\n \"setOrientation\",\n \"setOverrideHistoryNavigationMode\",\n \"setPaint\",\n \"setParameter\",\n \"setPeriodicWave\",\n \"setPointerCapture\",\n \"setPosition\",\n \"setPreference\",\n \"setProperty\",\n \"setPrototypeOf\",\n \"setRGBColor\",\n \"setRGBColorICCColor\",\n \"setRadius\",\n \"setRangeText\",\n \"setRemoteDescription\",\n \"setRequestHeader\",\n \"setResizable\",\n \"setResourceTimingBufferSize\",\n \"setRotate\",\n \"setScale\",\n \"setSeconds\",\n \"setSelectionRange\",\n \"setServerCertificate\",\n \"setShadow\",\n \"setSkewX\",\n \"setSkewY\",\n \"setStart\",\n \"setStartAfter\",\n \"setStartBefore\",\n \"setStdDeviation\",\n \"setStringValue\",\n \"setStrokeColor\",\n \"setSuggestResult\",\n \"setTargetAtTime\",\n \"setTargetValueAtTime\",\n \"setTime\",\n \"setTimeout\",\n \"setTransform\",\n \"setTranslate\",\n \"setUTCDate\",\n \"setUTCFullYear\",\n \"setUTCHours\",\n \"setUTCMilliseconds\",\n \"setUTCMinutes\",\n \"setUTCMonth\",\n \"setUTCSeconds\",\n \"setUint16\",\n \"setUint32\",\n \"setUint8\",\n \"setUri\",\n \"setValueAtTime\",\n \"setValueCurveAtTime\",\n \"setVariable\",\n \"setVelocity\",\n \"setVersion\",\n \"setYear\",\n \"settingName\",\n \"settingValue\",\n \"sex\",\n \"shaderSource\",\n \"shadowBlur\",\n \"shadowColor\",\n \"shadowOffsetX\",\n \"shadowOffsetY\",\n \"shadowRoot\",\n \"shape\",\n \"shape-rendering\",\n \"shapeRendering\",\n \"sheet\",\n \"shift\",\n \"shiftKey\",\n \"shiftLeft\",\n \"show\",\n \"showHelp\",\n \"showModal\",\n \"showModalDialog\",\n \"showModelessDialog\",\n \"showNotification\",\n \"sidebar\",\n \"sign\",\n \"signalingState\",\n \"sin\",\n \"singleNodeValue\",\n \"sinh\",\n \"size\",\n \"sizeToContent\",\n \"sizes\",\n \"skewX\",\n \"skewXSelf\",\n \"skewY\",\n \"skewYSelf\",\n \"slice\",\n \"slope\",\n \"small\",\n \"smil\",\n \"smoothingTimeConstant\",\n \"snapToLines\",\n \"snapshotItem\",\n \"snapshotLength\",\n \"some\",\n \"sort\",\n \"source\",\n \"sourceBuffer\",\n \"sourceBuffers\",\n \"sourceIndex\",\n \"spacing\",\n \"span\",\n \"speakAs\",\n \"speaking\",\n \"specified\",\n \"specularConstant\",\n \"specularExponent\",\n \"speechSynthesis\",\n \"speed\",\n \"speedOfSound\",\n \"spellcheck\",\n \"splice\",\n \"split\",\n \"splitText\",\n \"spreadMethod\",\n \"sqrt\",\n \"src\",\n \"srcElement\",\n \"srcFilter\",\n \"srcUrn\",\n \"srcdoc\",\n \"srclang\",\n \"srcset\",\n \"stack\",\n \"stackTraceLimit\",\n \"stacktrace\",\n \"standalone\",\n \"standby\",\n \"start\",\n \"startContainer\",\n \"startIce\",\n \"startOffset\",\n \"startRendering\",\n \"startTime\",\n \"startsWith\",\n \"state\",\n \"status\",\n \"statusMessage\",\n \"statusText\",\n \"statusbar\",\n \"stdDeviationX\",\n \"stdDeviationY\",\n \"stencilFunc\",\n \"stencilFuncSeparate\",\n \"stencilMask\",\n \"stencilMaskSeparate\",\n \"stencilOp\",\n \"stencilOpSeparate\",\n \"step\",\n \"stepDown\",\n \"stepMismatch\",\n \"stepUp\",\n \"sticky\",\n \"stitchTiles\",\n \"stop\",\n \"stop-color\",\n \"stop-opacity\",\n \"stopColor\",\n \"stopImmediatePropagation\",\n \"stopOpacity\",\n \"stopPropagation\",\n \"storageArea\",\n \"storageName\",\n \"storageStatus\",\n \"storeSiteSpecificTrackingException\",\n \"storeWebWideTrackingException\",\n \"stpVersion\",\n \"stream\",\n \"strike\",\n \"stringValue\",\n \"stringify\",\n \"stroke\",\n \"stroke-dasharray\",\n \"stroke-dashoffset\",\n \"stroke-linecap\",\n \"stroke-linejoin\",\n \"stroke-miterlimit\",\n \"stroke-opacity\",\n \"stroke-width\",\n \"strokeDasharray\",\n \"strokeDashoffset\",\n \"strokeLinecap\",\n \"strokeLinejoin\",\n \"strokeMiterlimit\",\n \"strokeOpacity\",\n \"strokeRect\",\n \"strokeStyle\",\n \"strokeText\",\n \"strokeWidth\",\n \"style\",\n \"styleFloat\",\n \"styleMedia\",\n \"styleSheet\",\n \"styleSheetSets\",\n \"styleSheets\",\n \"sub\",\n \"subarray\",\n \"subject\",\n \"submit\",\n \"subscribe\",\n \"substr\",\n \"substring\",\n \"substringData\",\n \"subtle\",\n \"suffix\",\n \"suffixes\",\n \"summary\",\n \"sup\",\n \"supports\",\n \"surfaceScale\",\n \"surroundContents\",\n \"suspend\",\n \"suspendRedraw\",\n \"swapCache\",\n \"swapNode\",\n \"sweepFlag\",\n \"symbols\",\n \"system\",\n \"systemCode\",\n \"systemId\",\n \"systemLanguage\",\n \"systemXDPI\",\n \"systemYDPI\",\n \"tBodies\",\n \"tFoot\",\n \"tHead\",\n \"tabIndex\",\n \"table\",\n \"table-layout\",\n \"tableLayout\",\n \"tableValues\",\n \"tag\",\n \"tagName\",\n \"tagUrn\",\n \"tags\",\n \"taintEnabled\",\n \"takeRecords\",\n \"tan\",\n \"tanh\",\n \"target\",\n \"targetElement\",\n \"targetTouches\",\n \"targetX\",\n \"targetY\",\n \"tel\",\n \"terminate\",\n \"test\",\n \"texImage2D\",\n \"texParameterf\",\n \"texParameteri\",\n \"texSubImage2D\",\n \"text\",\n \"text-align\",\n \"text-anchor\",\n \"text-decoration\",\n \"text-decoration-color\",\n \"text-decoration-line\",\n \"text-decoration-style\",\n \"text-indent\",\n \"text-overflow\",\n \"text-rendering\",\n \"text-shadow\",\n \"text-transform\",\n \"textAlign\",\n \"textAlignLast\",\n \"textAnchor\",\n \"textAutospace\",\n \"textBaseline\",\n \"textContent\",\n \"textDecoration\",\n \"textDecorationBlink\",\n \"textDecorationColor\",\n \"textDecorationLine\",\n \"textDecorationLineThrough\",\n \"textDecorationNone\",\n \"textDecorationOverline\",\n \"textDecorationStyle\",\n \"textDecorationUnderline\",\n \"textIndent\",\n \"textJustify\",\n \"textJustifyTrim\",\n \"textKashida\",\n \"textKashidaSpace\",\n \"textLength\",\n \"textOverflow\",\n \"textRendering\",\n \"textShadow\",\n \"textTracks\",\n \"textTransform\",\n \"textUnderlinePosition\",\n \"then\",\n \"threadId\",\n \"threshold\",\n \"tiltX\",\n \"tiltY\",\n \"time\",\n \"timeEnd\",\n \"timeStamp\",\n \"timeout\",\n \"timestamp\",\n \"timestampOffset\",\n \"timing\",\n \"title\",\n \"toArray\",\n \"toBlob\",\n \"toDataURL\",\n \"toDateString\",\n \"toElement\",\n \"toExponential\",\n \"toFixed\",\n \"toFloat32Array\",\n \"toFloat64Array\",\n \"toGMTString\",\n \"toISOString\",\n \"toJSON\",\n \"toLocaleDateString\",\n \"toLocaleFormat\",\n \"toLocaleLowerCase\",\n \"toLocaleString\",\n \"toLocaleTimeString\",\n \"toLocaleUpperCase\",\n \"toLowerCase\",\n \"toMethod\",\n \"toPrecision\",\n \"toSdp\",\n \"toSource\",\n \"toStaticHTML\",\n \"toString\",\n \"toStringTag\",\n \"toTimeString\",\n \"toUTCString\",\n \"toUpperCase\",\n \"toggle\",\n \"toggleLongPressEnabled\",\n \"tooLong\",\n \"toolbar\",\n \"top\",\n \"topMargin\",\n \"total\",\n \"totalFrameDelay\",\n \"totalVideoFrames\",\n \"touchAction\",\n \"touches\",\n \"trace\",\n \"track\",\n \"transaction\",\n \"transactions\",\n \"transform\",\n \"transform-origin\",\n \"transform-style\",\n \"transformOrigin\",\n \"transformPoint\",\n \"transformString\",\n \"transformStyle\",\n \"transformToDocument\",\n \"transformToFragment\",\n \"transition\",\n \"transition-delay\",\n \"transition-duration\",\n \"transition-property\",\n \"transition-timing-function\",\n \"transitionDelay\",\n \"transitionDuration\",\n \"transitionProperty\",\n \"transitionTimingFunction\",\n \"translate\",\n \"translateSelf\",\n \"translationX\",\n \"translationY\",\n \"trim\",\n \"trimLeft\",\n \"trimRight\",\n \"trueSpeed\",\n \"trunc\",\n \"truncate\",\n \"type\",\n \"typeDetail\",\n \"typeMismatch\",\n \"typeMustMatch\",\n \"types\",\n \"ubound\",\n \"undefined\",\n \"unescape\",\n \"uneval\",\n \"unicode-bidi\",\n \"unicodeBidi\",\n \"uniform1f\",\n \"uniform1fv\",\n \"uniform1i\",\n \"uniform1iv\",\n \"uniform2f\",\n \"uniform2fv\",\n \"uniform2i\",\n \"uniform2iv\",\n \"uniform3f\",\n \"uniform3fv\",\n \"uniform3i\",\n \"uniform3iv\",\n \"uniform4f\",\n \"uniform4fv\",\n \"uniform4i\",\n \"uniform4iv\",\n \"uniformMatrix2fv\",\n \"uniformMatrix3fv\",\n \"uniformMatrix4fv\",\n \"unique\",\n \"uniqueID\",\n \"uniqueNumber\",\n \"unitType\",\n \"units\",\n \"unloadEventEnd\",\n \"unloadEventStart\",\n \"unlock\",\n \"unmount\",\n \"unobserve\",\n \"unpause\",\n \"unpauseAnimations\",\n \"unreadCount\",\n \"unregister\",\n \"unregisterContentHandler\",\n \"unregisterProtocolHandler\",\n \"unscopables\",\n \"unselectable\",\n \"unshift\",\n \"unsubscribe\",\n \"unsuspendRedraw\",\n \"unsuspendRedrawAll\",\n \"unwatch\",\n \"unwrapKey\",\n \"update\",\n \"updateCommands\",\n \"updateIce\",\n \"updateInterval\",\n \"updateSettings\",\n \"updated\",\n \"updating\",\n \"upload\",\n \"upper\",\n \"upperBound\",\n \"upperOpen\",\n \"uri\",\n \"url\",\n \"urn\",\n \"urns\",\n \"usages\",\n \"useCurrentView\",\n \"useMap\",\n \"useProgram\",\n \"usedSpace\",\n \"userAgent\",\n \"userLanguage\",\n \"username\",\n \"v8BreakIterator\",\n \"vAlign\",\n \"vLink\",\n \"valid\",\n \"validateProgram\",\n \"validationMessage\",\n \"validity\",\n \"value\",\n \"valueAsDate\",\n \"valueAsNumber\",\n \"valueAsString\",\n \"valueInSpecifiedUnits\",\n \"valueMissing\",\n \"valueOf\",\n \"valueText\",\n \"valueType\",\n \"values\",\n \"vector-effect\",\n \"vectorEffect\",\n \"velocityAngular\",\n \"velocityExpansion\",\n \"velocityX\",\n \"velocityY\",\n \"vendor\",\n \"vendorSub\",\n \"verify\",\n \"version\",\n \"vertexAttrib1f\",\n \"vertexAttrib1fv\",\n \"vertexAttrib2f\",\n \"vertexAttrib2fv\",\n \"vertexAttrib3f\",\n \"vertexAttrib3fv\",\n \"vertexAttrib4f\",\n \"vertexAttrib4fv\",\n \"vertexAttribDivisorANGLE\",\n \"vertexAttribPointer\",\n \"vertical\",\n \"vertical-align\",\n \"verticalAlign\",\n \"verticalOverflow\",\n \"vibrate\",\n \"videoHeight\",\n \"videoTracks\",\n \"videoWidth\",\n \"view\",\n \"viewBox\",\n \"viewBoxString\",\n \"viewTarget\",\n \"viewTargetString\",\n \"viewport\",\n \"viewportAnchorX\",\n \"viewportAnchorY\",\n \"viewportElement\",\n \"visibility\",\n \"visibilityState\",\n \"visible\",\n \"vlinkColor\",\n \"voice\",\n \"volume\",\n \"vrml\",\n \"vspace\",\n \"w\",\n \"wand\",\n \"warn\",\n \"wasClean\",\n \"watch\",\n \"watchPosition\",\n \"webdriver\",\n \"webkitAddKey\",\n \"webkitAnimation\",\n \"webkitAnimationDelay\",\n \"webkitAnimationDirection\",\n \"webkitAnimationDuration\",\n \"webkitAnimationFillMode\",\n \"webkitAnimationIterationCount\",\n \"webkitAnimationName\",\n \"webkitAnimationPlayState\",\n \"webkitAnimationTimingFunction\",\n \"webkitAppearance\",\n \"webkitAudioContext\",\n \"webkitAudioDecodedByteCount\",\n \"webkitAudioPannerNode\",\n \"webkitBackfaceVisibility\",\n \"webkitBackground\",\n \"webkitBackgroundAttachment\",\n \"webkitBackgroundClip\",\n \"webkitBackgroundColor\",\n \"webkitBackgroundImage\",\n \"webkitBackgroundOrigin\",\n \"webkitBackgroundPosition\",\n \"webkitBackgroundPositionX\",\n \"webkitBackgroundPositionY\",\n \"webkitBackgroundRepeat\",\n \"webkitBackgroundSize\",\n \"webkitBackingStorePixelRatio\",\n \"webkitBorderImage\",\n \"webkitBorderImageOutset\",\n \"webkitBorderImageRepeat\",\n \"webkitBorderImageSlice\",\n \"webkitBorderImageSource\",\n \"webkitBorderImageWidth\",\n \"webkitBoxAlign\",\n \"webkitBoxDirection\",\n \"webkitBoxFlex\",\n \"webkitBoxOrdinalGroup\",\n \"webkitBoxOrient\",\n \"webkitBoxPack\",\n \"webkitBoxSizing\",\n \"webkitCancelAnimationFrame\",\n \"webkitCancelFullScreen\",\n \"webkitCancelKeyRequest\",\n \"webkitCancelRequestAnimationFrame\",\n \"webkitClearResourceTimings\",\n \"webkitClosedCaptionsVisible\",\n \"webkitConvertPointFromNodeToPage\",\n \"webkitConvertPointFromPageToNode\",\n \"webkitCreateShadowRoot\",\n \"webkitCurrentFullScreenElement\",\n \"webkitCurrentPlaybackTargetIsWireless\",\n \"webkitDirectionInvertedFromDevice\",\n \"webkitDisplayingFullscreen\",\n \"webkitEnterFullScreen\",\n \"webkitEnterFullscreen\",\n \"webkitExitFullScreen\",\n \"webkitExitFullscreen\",\n \"webkitExitPointerLock\",\n \"webkitFullScreenKeyboardInputAllowed\",\n \"webkitFullscreenElement\",\n \"webkitFullscreenEnabled\",\n \"webkitGenerateKeyRequest\",\n \"webkitGetAsEntry\",\n \"webkitGetDatabaseNames\",\n \"webkitGetEntries\",\n \"webkitGetEntriesByName\",\n \"webkitGetEntriesByType\",\n \"webkitGetFlowByName\",\n \"webkitGetGamepads\",\n \"webkitGetImageDataHD\",\n \"webkitGetNamedFlows\",\n \"webkitGetRegionFlowRanges\",\n \"webkitGetUserMedia\",\n \"webkitHasClosedCaptions\",\n \"webkitHidden\",\n \"webkitIDBCursor\",\n \"webkitIDBDatabase\",\n \"webkitIDBDatabaseError\",\n \"webkitIDBDatabaseException\",\n \"webkitIDBFactory\",\n \"webkitIDBIndex\",\n \"webkitIDBKeyRange\",\n \"webkitIDBObjectStore\",\n \"webkitIDBRequest\",\n \"webkitIDBTransaction\",\n \"webkitImageSmoothingEnabled\",\n \"webkitIndexedDB\",\n \"webkitInitMessageEvent\",\n \"webkitIsFullScreen\",\n \"webkitKeys\",\n \"webkitLineDashOffset\",\n \"webkitLockOrientation\",\n \"webkitMatchesSelector\",\n \"webkitMediaStream\",\n \"webkitNotifications\",\n \"webkitOfflineAudioContext\",\n \"webkitOrientation\",\n \"webkitPeerConnection00\",\n \"webkitPersistentStorage\",\n \"webkitPointerLockElement\",\n \"webkitPostMessage\",\n \"webkitPreservesPitch\",\n \"webkitPutImageDataHD\",\n \"webkitRTCPeerConnection\",\n \"webkitRegionOverset\",\n \"webkitRequestAnimationFrame\",\n \"webkitRequestFileSystem\",\n \"webkitRequestFullScreen\",\n \"webkitRequestFullscreen\",\n \"webkitRequestPointerLock\",\n \"webkitResolveLocalFileSystemURL\",\n \"webkitSetMediaKeys\",\n \"webkitSetResourceTimingBufferSize\",\n \"webkitShadowRoot\",\n \"webkitShowPlaybackTargetPicker\",\n \"webkitSlice\",\n \"webkitSpeechGrammar\",\n \"webkitSpeechGrammarList\",\n \"webkitSpeechRecognition\",\n \"webkitSpeechRecognitionError\",\n \"webkitSpeechRecognitionEvent\",\n \"webkitStorageInfo\",\n \"webkitSupportsFullscreen\",\n \"webkitTemporaryStorage\",\n \"webkitTextSizeAdjust\",\n \"webkitTransform\",\n \"webkitTransformOrigin\",\n \"webkitTransition\",\n \"webkitTransitionDelay\",\n \"webkitTransitionDuration\",\n \"webkitTransitionProperty\",\n \"webkitTransitionTimingFunction\",\n \"webkitURL\",\n \"webkitUnlockOrientation\",\n \"webkitUserSelect\",\n \"webkitVideoDecodedByteCount\",\n \"webkitVisibilityState\",\n \"webkitWirelessVideoPlaybackDisabled\",\n \"webkitdropzone\",\n \"webstore\",\n \"weight\",\n \"whatToShow\",\n \"wheelDelta\",\n \"wheelDeltaX\",\n \"wheelDeltaY\",\n \"which\",\n \"white-space\",\n \"whiteSpace\",\n \"wholeText\",\n \"widows\",\n \"width\",\n \"will-change\",\n \"willChange\",\n \"willValidate\",\n \"window\",\n \"withCredentials\",\n \"word-break\",\n \"word-spacing\",\n \"word-wrap\",\n \"wordBreak\",\n \"wordSpacing\",\n \"wordWrap\",\n \"wrap\",\n \"wrapKey\",\n \"write\",\n \"writeln\",\n \"writingMode\",\n \"x\",\n \"x1\",\n \"x2\",\n \"xChannelSelector\",\n \"xmlEncoding\",\n \"xmlStandalone\",\n \"xmlVersion\",\n \"xmlbase\",\n \"xmllang\",\n \"xmlspace\",\n \"y\",\n \"y1\",\n \"y2\",\n \"yChannelSelector\",\n \"yandex\",\n \"z\",\n \"z-index\",\n \"zIndex\",\n \"zoom\",\n \"zoomAndPan\",\n \"zoomRectScreen\"\n]\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction characters(str) {\n return str.split(\"\");\n}\n\nfunction member(name, array) {\n return array.indexOf(name) >= 0;\n}\n\nfunction find_if(func, array) {\n for (var i = 0, n = array.length; i < n; ++i) {\n if (func(array[i]))\n return array[i];\n }\n}\n\nfunction repeat_string(str, i) {\n if (i <= 0) return \"\";\n if (i == 1) return str;\n var d = repeat_string(str, i >> 1);\n d += d;\n if (i & 1) d += str;\n return d;\n}\n\nfunction configure_error_stack(fn) {\n Object.defineProperty(fn.prototype, \"stack\", {\n get: function() {\n var err = new Error(this.message);\n err.name = this.name;\n try {\n throw err;\n } catch(e) {\n return e.stack;\n }\n }\n });\n}\n\nfunction DefaultsError(msg, defs) {\n this.message = msg;\n this.defs = defs;\n}\nDefaultsError.prototype = Object.create(Error.prototype);\nDefaultsError.prototype.constructor = DefaultsError;\nDefaultsError.prototype.name = \"DefaultsError\";\nconfigure_error_stack(DefaultsError);\n\nDefaultsError.croak = function(msg, defs) {\n throw new DefaultsError(msg, defs);\n};\n\nfunction defaults(args, defs, croak) {\n if (args === true)\n args = {};\n var ret = args || {};\n if (croak) for (var i in ret) if (HOP(ret, i) && !HOP(defs, i))\n DefaultsError.croak(\"`\" + i + \"` is not a supported option\", defs);\n for (var i in defs) if (HOP(defs, i)) {\n ret[i] = (args && HOP(args, i)) ? args[i] : defs[i];\n }\n return ret;\n}\n\nfunction merge(obj, ext) {\n var count = 0;\n for (var i in ext) if (HOP(ext, i)) {\n obj[i] = ext[i];\n count++;\n }\n return count;\n}\n\nfunction noop() {}\nfunction return_false() { return false; }\nfunction return_true() { return true; }\nfunction return_this() { return this; }\nfunction return_null() { return null; }\n\nvar MAP = (function() {\n function MAP(a, f, backwards) {\n var ret = [], top = [], i;\n function doit() {\n var val = f(a[i], i);\n var is_last = val instanceof Last;\n if (is_last) val = val.v;\n if (val instanceof AtTop) {\n val = val.v;\n if (val instanceof Splice) {\n top.push.apply(top, backwards ? val.v.slice().reverse() : val.v);\n } else {\n top.push(val);\n }\n } else if (val !== skip) {\n if (val instanceof Splice) {\n ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v);\n } else {\n ret.push(val);\n }\n }\n return is_last;\n }\n if (a instanceof Array) {\n if (backwards) {\n for (i = a.length; --i >= 0;) if (doit()) break;\n ret.reverse();\n top.reverse();\n } else {\n for (i = 0; i < a.length; ++i) if (doit()) break;\n }\n } else {\n for (i in a) if (HOP(a, i)) if (doit()) break;\n }\n return top.concat(ret);\n }\n MAP.at_top = function(val) { return new AtTop(val); };\n MAP.splice = function(val) { return new Splice(val); };\n MAP.last = function(val) { return new Last(val); };\n var skip = MAP.skip = {};\n function AtTop(val) { this.v = val; }\n function Splice(val) { this.v = val; }\n function Last(val) { this.v = val; }\n return MAP;\n})();\n\nfunction push_uniq(array, el) {\n if (array.indexOf(el) < 0)\n array.push(el);\n}\n\nfunction string_template(text, props) {\n return text.replace(/\\{(.+?)\\}/g, function(str, p) {\n return props && props[p];\n });\n}\n\nfunction remove(array, el) {\n for (var i = array.length; --i >= 0;) {\n if (array[i] === el) array.splice(i, 1);\n }\n}\n\nfunction mergeSort(array, cmp) {\n if (array.length < 2) return array.slice();\n function merge(a, b) {\n var r = [], ai = 0, bi = 0, i = 0;\n while (ai < a.length && bi < b.length) {\n cmp(a[ai], b[bi]) <= 0\n ? r[i++] = a[ai++]\n : r[i++] = b[bi++];\n }\n if (ai < a.length) r.push.apply(r, a.slice(ai));\n if (bi < b.length) r.push.apply(r, b.slice(bi));\n return r;\n }\n function _ms(a) {\n if (a.length <= 1)\n return a;\n var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m);\n left = _ms(left);\n right = _ms(right);\n return merge(left, right);\n }\n return _ms(array);\n}\n\n// this function is taken from Acorn [1], written by Marijn Haverbeke\n// [1] https://github.com/marijnh/acorn\nfunction makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function quote(word) {\n return JSON.stringify(word).replace(/[\\u2028\\u2029]/g, function(s) {\n switch (s) {\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n }\n return s;\n });\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + quote(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + quote(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}\n\nfunction all(array, predicate) {\n for (var i = array.length; --i >= 0;)\n if (!predicate(array[i]))\n return false;\n return true;\n}\n\nfunction Dictionary() {\n this._values = Object.create(null);\n this._size = 0;\n}\nDictionary.prototype = {\n set: function(key, val) {\n if (!this.has(key)) ++this._size;\n this._values[\"$\" + key] = val;\n return this;\n },\n add: function(key, val) {\n if (this.has(key)) {\n this.get(key).push(val);\n } else {\n this.set(key, [ val ]);\n }\n return this;\n },\n get: function(key) { return this._values[\"$\" + key]; },\n del: function(key) {\n if (this.has(key)) {\n --this._size;\n delete this._values[\"$\" + key];\n }\n return this;\n },\n has: function(key) { return (\"$\" + key) in this._values; },\n each: function(f) {\n for (var i in this._values)\n f(this._values[i], i.substr(1));\n },\n size: function() {\n return this._size;\n },\n map: function(f) {\n var ret = [];\n for (var i in this._values)\n ret.push(f(this._values[i], i.substr(1)));\n return ret;\n },\n clone: function() {\n var ret = new Dictionary();\n for (var i in this._values)\n ret._values[i] = this._values[i];\n ret._size = this._size;\n return ret;\n },\n toObject: function() { return this._values; }\n};\nDictionary.fromObject = function(obj) {\n var dict = new Dictionary();\n dict._size = merge(dict._values, obj);\n return dict;\n};\nexports.Dictionary = Dictionary;\n\nfunction HOP(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n// return true if the node at the top of the stack (that means the\n// innermost node in the current output) is lexically the first in\n// a statement.\nfunction first_in_statement(stack) {\n var node = stack.parent(-1);\n for (var i = 0, p; p = stack.parent(i); i++) {\n if (p instanceof AST_Statement && p.body === node)\n return true;\n if ((p instanceof AST_Sequence && p.expressions[0] === node) ||\n (p.TYPE == \"Call\" && p.expression === node ) ||\n (p instanceof AST_Dot && p.expression === node ) ||\n (p instanceof AST_Sub && p.expression === node ) ||\n (p instanceof AST_Conditional && p.condition === node ) ||\n (p instanceof AST_Binary && p.left === node ) ||\n (p instanceof AST_UnaryPostfix && p.expression === node )\n ) {\n node = p;\n } else {\n return false;\n }\n }\n}\n\nfunction keep_name(keep_setting, name) {\n return keep_setting === true\n || (keep_setting instanceof RegExp && keep_setting.test(name));\n}\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction DEFNODE(type, props, methods, base) {\n if (arguments.length < 4) base = AST_Node;\n if (!props) props = [];\n else props = props.split(/\\s+/);\n var self_props = props;\n if (base && base.PROPS)\n props = props.concat(base.PROPS);\n var code = \"return function AST_\" + type + \"(props){ if (props) { \";\n for (var i = props.length; --i >= 0;) {\n code += \"this.\" + props[i] + \" = props.\" + props[i] + \";\";\n }\n var proto = base && new base;\n if (proto && proto.initialize || (methods && methods.initialize))\n code += \"this.initialize();\";\n code += \"}}\";\n var ctor = new Function(code)();\n if (proto) {\n ctor.prototype = proto;\n ctor.BASE = base;\n }\n if (base) base.SUBCLASSES.push(ctor);\n ctor.prototype.CTOR = ctor;\n ctor.PROPS = props || null;\n ctor.SELF_PROPS = self_props;\n ctor.SUBCLASSES = [];\n if (type) {\n ctor.prototype.TYPE = ctor.TYPE = type;\n }\n if (methods) for (i in methods) if (HOP(methods, i)) {\n if (/^\\$/.test(i)) {\n ctor[i.substr(1)] = methods[i];\n } else {\n ctor.prototype[i] = methods[i];\n }\n }\n ctor.DEFMETHOD = function(name, method) {\n this.prototype[name] = method;\n };\n if (typeof exports !== \"undefined\") {\n exports[\"AST_\" + type] = ctor;\n }\n return ctor;\n}\n\nvar AST_Token = DEFNODE(\"Token\", \"type value line col pos endline endcol endpos nlb comments_before comments_after file raw\", {\n}, null);\n\nvar AST_Node = DEFNODE(\"Node\", \"start end\", {\n _clone: function(deep) {\n if (deep) {\n var self = this.clone();\n return self.transform(new TreeTransformer(function(node) {\n if (node !== self) {\n return node.clone(true);\n }\n }));\n }\n return new this.CTOR(this);\n },\n clone: function(deep) {\n return this._clone(deep);\n },\n $documentation: \"Base class of all AST nodes\",\n $propdoc: {\n start: \"[AST_Token] The first token of this node\",\n end: \"[AST_Token] The last token of this node\"\n },\n _walk: function(visitor) {\n return visitor._visit(this);\n },\n walk: function(visitor) {\n return this._walk(visitor); // not sure the indirection will be any help\n }\n}, null);\n\nAST_Node.warn_function = null;\nAST_Node.warn = function(txt, props) {\n if (AST_Node.warn_function)\n AST_Node.warn_function(string_template(txt, props));\n};\n\n/* -----[ statements ]----- */\n\nvar AST_Statement = DEFNODE(\"Statement\", null, {\n $documentation: \"Base class of all statements\",\n});\n\nvar AST_Debugger = DEFNODE(\"Debugger\", null, {\n $documentation: \"Represents a debugger statement\",\n}, AST_Statement);\n\nvar AST_Directive = DEFNODE(\"Directive\", \"value quote\", {\n $documentation: \"Represents a directive, like \\\"use strict\\\";\",\n $propdoc: {\n value: \"[string] The value of this directive as a plain string (it's not an AST_String!)\",\n quote: \"[string] the original quote character\"\n },\n}, AST_Statement);\n\nvar AST_SimpleStatement = DEFNODE(\"SimpleStatement\", \"body\", {\n $documentation: \"A statement consisting of an expression, i.e. a = 1 + 2\",\n $propdoc: {\n body: \"[AST_Node] an expression node (should not be instanceof AST_Statement)\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.body._walk(visitor);\n });\n }\n}, AST_Statement);\n\nfunction walk_body(node, visitor) {\n var body = node.body;\n if (body instanceof AST_Node) {\n body._walk(visitor);\n } else for (var i = 0, len = body.length; i < len; i++) {\n body[i]._walk(visitor);\n }\n}\n\nfunction clone_block_scope(deep) {\n var clone = this._clone(deep);\n if (this.block_scope) {\n // TODO this is sometimes undefined during compression.\n // But it should always have a value!\n clone.block_scope = this.block_scope.clone();\n }\n return clone;\n}\n\nvar AST_Block = DEFNODE(\"Block\", \"body block_scope\", {\n $documentation: \"A body of statements (usually braced)\",\n $propdoc: {\n body: \"[AST_Statement*] an array of statements\",\n block_scope: \"[AST_Scope] the block scope\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n walk_body(this, visitor);\n });\n },\n clone: clone_block_scope\n}, AST_Statement);\n\nvar AST_BlockStatement = DEFNODE(\"BlockStatement\", null, {\n $documentation: \"A block statement\",\n}, AST_Block);\n\nvar AST_EmptyStatement = DEFNODE(\"EmptyStatement\", null, {\n $documentation: \"The empty statement (empty block or simply a semicolon)\"\n}, AST_Statement);\n\nvar AST_StatementWithBody = DEFNODE(\"StatementWithBody\", \"body\", {\n $documentation: \"Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`\",\n $propdoc: {\n body: \"[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement\"\n }\n}, AST_Statement);\n\nvar AST_LabeledStatement = DEFNODE(\"LabeledStatement\", \"label\", {\n $documentation: \"Statement with a label\",\n $propdoc: {\n label: \"[AST_Label] a label definition\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.label._walk(visitor);\n this.body._walk(visitor);\n });\n },\n clone: function(deep) {\n var node = this._clone(deep);\n if (deep) {\n var label = node.label;\n var def = this.label;\n node.walk(new TreeWalker(function(node) {\n if (node instanceof AST_LoopControl\n && node.label && node.label.thedef === def) {\n node.label.thedef = label;\n label.references.push(node);\n }\n }));\n }\n return node;\n }\n}, AST_StatementWithBody);\n\nvar AST_IterationStatement = DEFNODE(\"IterationStatement\", \"block_scope\", {\n $documentation: \"Internal class. All loops inherit from it.\",\n $propdoc: {\n block_scope: \"[AST_Scope] the block scope for this iteration statement.\"\n },\n clone: clone_block_scope\n}, AST_StatementWithBody);\n\nvar AST_DWLoop = DEFNODE(\"DWLoop\", \"condition\", {\n $documentation: \"Base class for do/while statements\",\n $propdoc: {\n condition: \"[AST_Node] the loop condition. Should not be instanceof AST_Statement\"\n }\n}, AST_IterationStatement);\n\nvar AST_Do = DEFNODE(\"Do\", null, {\n $documentation: \"A `do` statement\",\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.body._walk(visitor);\n this.condition._walk(visitor);\n });\n }\n}, AST_DWLoop);\n\nvar AST_While = DEFNODE(\"While\", null, {\n $documentation: \"A `while` statement\",\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.condition._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_DWLoop);\n\nvar AST_For = DEFNODE(\"For\", \"init condition step\", {\n $documentation: \"A `for` statement\",\n $propdoc: {\n init: \"[AST_Node?] the `for` initialization code, or null if empty\",\n condition: \"[AST_Node?] the `for` termination clause, or null if empty\",\n step: \"[AST_Node?] the `for` update clause, or null if empty\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n if (this.init) this.init._walk(visitor);\n if (this.condition) this.condition._walk(visitor);\n if (this.step) this.step._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_IterationStatement);\n\nvar AST_ForIn = DEFNODE(\"ForIn\", \"init object\", {\n $documentation: \"A `for ... in` statement\",\n $propdoc: {\n init: \"[AST_Node] the `for/in` initialization code\",\n object: \"[AST_Node] the object that we're looping through\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.init._walk(visitor);\n this.object._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_IterationStatement);\n\nvar AST_ForOf = DEFNODE(\"ForOf\", \"await\", {\n $documentation: \"A `for ... of` statement\",\n}, AST_ForIn);\n\nvar AST_With = DEFNODE(\"With\", \"expression\", {\n $documentation: \"A `with` statement\",\n $propdoc: {\n expression: \"[AST_Node] the `with` expression\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expression._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_StatementWithBody);\n\n/* -----[ scope and functions ]----- */\n\nvar AST_Scope = DEFNODE(\"Scope\", \"variables functions uses_with uses_eval parent_scope enclosed cname\", {\n $documentation: \"Base class for all statements introducing a lexical scope\",\n $propdoc: {\n variables: \"[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope\",\n functions: \"[Object/S] like `variables`, but only lists function declarations\",\n uses_with: \"[boolean/S] tells whether this scope uses the `with` statement\",\n uses_eval: \"[boolean/S] tells whether this scope contains a direct call to the global `eval`\",\n parent_scope: \"[AST_Scope?/S] link to the parent scope\",\n enclosed: \"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes\",\n cname: \"[integer/S] current index for mangling variables (used internally by the mangler)\",\n },\n get_defun_scope: function() {\n var self = this;\n while (self.is_block_scope()) {\n self = self.parent_scope;\n }\n return self;\n },\n clone: function(deep) {\n var node = this._clone(deep);\n if (this.variables) node.variables = this.variables.clone();\n if (this.functions) node.functions = this.functions.clone();\n if (this.enclosed) node.enclosed = this.enclosed.slice();\n return node;\n },\n pinned: function() {\n return this.uses_eval || this.uses_with;\n }\n}, AST_Block);\n\nvar AST_Toplevel = DEFNODE(\"Toplevel\", \"globals\", {\n $documentation: \"The toplevel scope\",\n $propdoc: {\n globals: \"[Object/S] a map of name -> SymbolDef for all undeclared names\",\n },\n wrap_commonjs: function(name) {\n var body = this.body;\n var wrapped_tl = \"(function(exports){'$ORIG';})(typeof \" + name + \"=='undefined'?(\" + name + \"={}):\" + name + \");\";\n wrapped_tl = parse(wrapped_tl);\n wrapped_tl = wrapped_tl.transform(new TreeTransformer(function(node) {\n if (node instanceof AST_Directive && node.value == \"$ORIG\") {\n return MAP.splice(body);\n }\n }));\n return wrapped_tl;\n },\n wrap_enclose: function(args_values) {\n if (typeof args_values != \"string\") args_values = \"\";\n var index = args_values.indexOf(\":\");\n if (index < 0) index = args_values.length;\n var body = this.body;\n return parse([\n \"(function(\",\n args_values.slice(0, index),\n '){\"$ORIG\"})(',\n args_values.slice(index + 1),\n \")\"\n ].join(\"\")).transform(new TreeTransformer(function(node) {\n if (node instanceof AST_Directive && node.value == \"$ORIG\") {\n return MAP.splice(body);\n }\n }));\n }\n}, AST_Scope);\n\nvar AST_Expansion = DEFNODE(\"Expansion\", \"expression\", {\n $documentation: \"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list\",\n $propdoc: {\n expression: \"[AST_Node] the thing to be expanded\"\n },\n _walk: function(visitor) {\n var self = this;\n return visitor._visit(this, function() {\n self.expression.walk(visitor);\n });\n }\n});\n\nvar AST_Lambda = DEFNODE(\"Lambda\", \"name argnames uses_arguments is_generator async\", {\n $documentation: \"Base class for functions\",\n $propdoc: {\n name: \"[AST_SymbolDeclaration?] the name of this function\",\n argnames: \"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments\",\n uses_arguments: \"[boolean/S] tells whether this function accesses the arguments array\",\n is_generator: \"[boolean] is this a generator method\",\n async: \"[boolean] is this method async\",\n },\n args_as_names: function () {\n var out = [];\n for (var i = 0; i < this.argnames.length; i++) {\n if (this.argnames[i] instanceof AST_Destructuring) {\n out = out.concat(this.argnames[i].all_symbols());\n } else {\n out.push(this.argnames[i]);\n }\n }\n return out;\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n if (this.name) this.name._walk(visitor);\n var argnames = this.argnames;\n for (var i = 0, len = argnames.length; i < len; i++) {\n argnames[i]._walk(visitor);\n }\n walk_body(this, visitor);\n });\n }\n}, AST_Scope);\n\nvar AST_Accessor = DEFNODE(\"Accessor\", null, {\n $documentation: \"A setter/getter function. The `name` property is always null.\"\n}, AST_Lambda);\n\nvar AST_Function = DEFNODE(\"Function\", \"inlined\", {\n $documentation: \"A function expression\"\n}, AST_Lambda);\n\nvar AST_Arrow = DEFNODE(\"Arrow\", \"inlined\", {\n $documentation: \"An ES6 Arrow function ((a) => b)\"\n}, AST_Lambda);\n\nvar AST_Defun = DEFNODE(\"Defun\", \"inlined\", {\n $documentation: \"A function definition\"\n}, AST_Lambda);\n\n/* -----[ DESTRUCTURING ]----- */\nvar AST_Destructuring = DEFNODE(\"Destructuring\", \"names is_array\", {\n $documentation: \"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names\",\n $propdoc: {\n \"names\": \"[AST_Node*] Array of properties or elements\",\n \"is_array\": \"[Boolean] Whether the destructuring represents an object or array\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.names.forEach(function(name) {\n name._walk(visitor);\n });\n });\n },\n all_symbols: function() {\n var out = [];\n this.walk(new TreeWalker(function (node) {\n if (node instanceof AST_Symbol) {\n out.push(node);\n }\n if (node instanceof AST_Expansion) {\n out.push(node.expression);\n }\n }));\n return out;\n }\n});\n\nvar AST_PrefixedTemplateString = DEFNODE(\"PrefixedTemplateString\", \"template_string prefix\", {\n $documentation: \"A templatestring with a prefix, such as String.raw`foobarbaz`\",\n $propdoc: {\n template_string: \"[AST_TemplateString] The template string\",\n prefix: \"[AST_SymbolRef|AST_PropAccess] The prefix, which can be a symbol such as `foo` or a dotted expression such as `String.raw`.\"\n },\n _walk: function(visitor) {\n this.prefix._walk(visitor);\n this.template_string._walk(visitor);\n }\n});\n\nvar AST_TemplateString = DEFNODE(\"TemplateString\", \"segments\", {\n $documentation: \"A template string literal\",\n $propdoc: {\n segments: \"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment.\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.segments.forEach(function(seg) {\n seg._walk(visitor);\n });\n });\n }\n});\n\nvar AST_TemplateSegment = DEFNODE(\"TemplateSegment\", \"value raw\", {\n $documentation: \"A segment of a template string literal\",\n $propdoc: {\n value: \"Content of the segment\",\n raw: \"Raw content of the segment\"\n }\n});\n\n/* -----[ JUMPS ]----- */\n\nvar AST_Jump = DEFNODE(\"Jump\", null, {\n $documentation: \"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)\"\n}, AST_Statement);\n\nvar AST_Exit = DEFNODE(\"Exit\", \"value\", {\n $documentation: \"Base class for “exits” (`return` and `throw`)\",\n $propdoc: {\n value: \"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, this.value && function() {\n this.value._walk(visitor);\n });\n }\n}, AST_Jump);\n\nvar AST_Return = DEFNODE(\"Return\", null, {\n $documentation: \"A `return` statement\"\n}, AST_Exit);\n\nvar AST_Throw = DEFNODE(\"Throw\", null, {\n $documentation: \"A `throw` statement\"\n}, AST_Exit);\n\nvar AST_LoopControl = DEFNODE(\"LoopControl\", \"label\", {\n $documentation: \"Base class for loop control statements (`break` and `continue`)\",\n $propdoc: {\n label: \"[AST_LabelRef?] the label, or null if none\",\n },\n _walk: function(visitor) {\n return visitor._visit(this, this.label && function() {\n this.label._walk(visitor);\n });\n }\n}, AST_Jump);\n\nvar AST_Break = DEFNODE(\"Break\", null, {\n $documentation: \"A `break` statement\"\n}, AST_LoopControl);\n\nvar AST_Continue = DEFNODE(\"Continue\", null, {\n $documentation: \"A `continue` statement\"\n}, AST_LoopControl);\n\n/* -----[ IF ]----- */\n\nvar AST_If = DEFNODE(\"If\", \"condition alternative\", {\n $documentation: \"A `if` statement\",\n $propdoc: {\n condition: \"[AST_Node] the `if` condition\",\n alternative: \"[AST_Statement?] the `else` part, or null if not present\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.condition._walk(visitor);\n this.body._walk(visitor);\n if (this.alternative) this.alternative._walk(visitor);\n });\n }\n}, AST_StatementWithBody);\n\n/* -----[ SWITCH ]----- */\n\nvar AST_Switch = DEFNODE(\"Switch\", \"expression\", {\n $documentation: \"A `switch` statement\",\n $propdoc: {\n expression: \"[AST_Node] the `switch` “discriminant”\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expression._walk(visitor);\n walk_body(this, visitor);\n });\n }\n}, AST_Block);\n\nvar AST_SwitchBranch = DEFNODE(\"SwitchBranch\", null, {\n $documentation: \"Base class for `switch` branches\",\n}, AST_Block);\n\nvar AST_Default = DEFNODE(\"Default\", null, {\n $documentation: \"A `default` switch branch\",\n}, AST_SwitchBranch);\n\nvar AST_Case = DEFNODE(\"Case\", \"expression\", {\n $documentation: \"A `case` switch branch\",\n $propdoc: {\n expression: \"[AST_Node] the `case` expression\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expression._walk(visitor);\n walk_body(this, visitor);\n });\n }\n}, AST_SwitchBranch);\n\n/* -----[ EXCEPTIONS ]----- */\n\nvar AST_Try = DEFNODE(\"Try\", \"bcatch bfinally\", {\n $documentation: \"A `try` statement\",\n $propdoc: {\n bcatch: \"[AST_Catch?] the catch block, or null if not present\",\n bfinally: \"[AST_Finally?] the finally block, or null if not present\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n walk_body(this, visitor);\n if (this.bcatch) this.bcatch._walk(visitor);\n if (this.bfinally) this.bfinally._walk(visitor);\n });\n }\n}, AST_Block);\n\nvar AST_Catch = DEFNODE(\"Catch\", \"argname\", {\n $documentation: \"A `catch` node; only makes sense as part of a `try` statement\",\n $propdoc: {\n argname: \"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n if (this.argname) this.argname._walk(visitor);\n walk_body(this, visitor);\n });\n }\n}, AST_Block);\n\nvar AST_Finally = DEFNODE(\"Finally\", null, {\n $documentation: \"A `finally` node; only makes sense as part of a `try` statement\"\n}, AST_Block);\n\n/* -----[ VAR/CONST ]----- */\n\nvar AST_Definitions = DEFNODE(\"Definitions\", \"definitions\", {\n $documentation: \"Base class for `var` or `const` nodes (variable declarations/initializations)\",\n $propdoc: {\n definitions: \"[AST_VarDef*] array of variable definitions\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n var definitions = this.definitions;\n for (var i = 0, len = definitions.length; i < len; i++) {\n definitions[i]._walk(visitor);\n }\n });\n }\n}, AST_Statement);\n\nvar AST_Var = DEFNODE(\"Var\", null, {\n $documentation: \"A `var` statement\"\n}, AST_Definitions);\n\nvar AST_Let = DEFNODE(\"Let\", null, {\n $documentation: \"A `let` statement\"\n}, AST_Definitions);\n\nvar AST_Const = DEFNODE(\"Const\", null, {\n $documentation: \"A `const` statement\"\n}, AST_Definitions);\n\nvar AST_NameMapping = DEFNODE(\"NameMapping\", \"foreign_name name\", {\n $documentation: \"The part of the export/import statement that declare names from a module.\",\n $propdoc: {\n foreign_name: \"[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)\",\n name: \"[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module.\"\n },\n _walk: function (visitor) {\n return visitor._visit(this, function() {\n this.foreign_name._walk(visitor);\n this.name._walk(visitor);\n });\n }\n});\n\nvar AST_Import = DEFNODE(\"Import\", \"imported_name imported_names module_name\", {\n $documentation: \"An `import` statement\",\n $propdoc: {\n imported_name: \"[AST_SymbolImport] The name of the variable holding the module's default export.\",\n imported_names: \"[AST_NameMapping*] The names of non-default imported variables\",\n module_name: \"[AST_String] String literal describing where this module came from\",\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n if (this.imported_name) {\n this.imported_name._walk(visitor);\n }\n if (this.imported_names) {\n this.imported_names.forEach(function(name_import) {\n name_import._walk(visitor);\n });\n }\n this.module_name._walk(visitor);\n });\n }\n});\n\nvar AST_Export = DEFNODE(\"Export\", \"exported_definition exported_value is_default exported_names module_name\", {\n $documentation: \"An `export` statement\",\n $propdoc: {\n exported_definition: \"[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition\",\n exported_value: \"[AST_Node?] An exported value\",\n exported_names: \"[AST_NameMapping*?] List of exported names\",\n module_name: \"[AST_String?] Name of the file to load exports from\",\n is_default: \"[Boolean] Whether this is the default exported value of this module\"\n },\n _walk: function (visitor) {\n visitor._visit(this, function () {\n if (this.exported_definition) {\n this.exported_definition._walk(visitor);\n }\n if (this.exported_value) {\n this.exported_value._walk(visitor);\n }\n if (this.exported_names) {\n this.exported_names.forEach(function(name_export) {\n name_export._walk(visitor);\n });\n }\n if (this.module_name) {\n this.module_name._walk(visitor);\n }\n });\n }\n}, AST_Statement);\n\nvar AST_VarDef = DEFNODE(\"VarDef\", \"name value\", {\n $documentation: \"A variable declaration; only appears in a AST_Definitions node\",\n $propdoc: {\n name: \"[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable\",\n value: \"[AST_Node?] initializer, or null of there's no initializer\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.name._walk(visitor);\n if (this.value) this.value._walk(visitor);\n });\n }\n});\n\n/* -----[ OTHER ]----- */\n\nvar AST_Call = DEFNODE(\"Call\", \"expression args\", {\n $documentation: \"A function call expression\",\n $propdoc: {\n expression: \"[AST_Node] expression to invoke as function\",\n args: \"[AST_Node*] array of arguments\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n var args = this.args;\n for (var i = 0, len = args.length; i < len; i++) {\n args[i]._walk(visitor);\n }\n this.expression._walk(visitor);\n });\n }\n});\n\nvar AST_New = DEFNODE(\"New\", null, {\n $documentation: \"An object instantiation. Derives from a function call since it has exactly the same properties\"\n}, AST_Call);\n\nvar AST_Sequence = DEFNODE(\"Sequence\", \"expressions\", {\n $documentation: \"A sequence expression (comma-separated expressions)\",\n $propdoc: {\n expressions: \"[AST_Node*] array of expressions (at least two)\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expressions.forEach(function(node) {\n node._walk(visitor);\n });\n });\n }\n});\n\nvar AST_PropAccess = DEFNODE(\"PropAccess\", \"expression property\", {\n $documentation: \"Base class for property access expressions, i.e. `a.foo` or `a[\\\"foo\\\"]`\",\n $propdoc: {\n expression: \"[AST_Node] the “container” expression\",\n property: \"[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node\"\n }\n});\n\nvar AST_Dot = DEFNODE(\"Dot\", null, {\n $documentation: \"A dotted property access expression\",\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expression._walk(visitor);\n });\n }\n}, AST_PropAccess);\n\nvar AST_Sub = DEFNODE(\"Sub\", null, {\n $documentation: \"Index-style property access, i.e. `a[\\\"foo\\\"]`\",\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expression._walk(visitor);\n this.property._walk(visitor);\n });\n }\n}, AST_PropAccess);\n\nvar AST_Unary = DEFNODE(\"Unary\", \"operator expression\", {\n $documentation: \"Base class for unary expressions\",\n $propdoc: {\n operator: \"[string] the operator\",\n expression: \"[AST_Node] expression that this unary operator applies to\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expression._walk(visitor);\n });\n }\n});\n\nvar AST_UnaryPrefix = DEFNODE(\"UnaryPrefix\", null, {\n $documentation: \"Unary prefix expression, i.e. `typeof i` or `++i`\"\n}, AST_Unary);\n\nvar AST_UnaryPostfix = DEFNODE(\"UnaryPostfix\", null, {\n $documentation: \"Unary postfix expression, i.e. `i++`\"\n}, AST_Unary);\n\nvar AST_Binary = DEFNODE(\"Binary\", \"operator left right\", {\n $documentation: \"Binary expression, i.e. `a + b`\",\n $propdoc: {\n left: \"[AST_Node] left-hand side expression\",\n operator: \"[string] the operator\",\n right: \"[AST_Node] right-hand side expression\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.left._walk(visitor);\n this.right._walk(visitor);\n });\n }\n});\n\nvar AST_Conditional = DEFNODE(\"Conditional\", \"condition consequent alternative\", {\n $documentation: \"Conditional expression using the ternary operator, i.e. `a ? b : c`\",\n $propdoc: {\n condition: \"[AST_Node]\",\n consequent: \"[AST_Node]\",\n alternative: \"[AST_Node]\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.condition._walk(visitor);\n this.consequent._walk(visitor);\n this.alternative._walk(visitor);\n });\n }\n});\n\nvar AST_Assign = DEFNODE(\"Assign\", null, {\n $documentation: \"An assignment expression — `a = b + 5`\",\n}, AST_Binary);\n\nvar AST_DefaultAssign = DEFNODE(\"DefaultAssign\", null, {\n $documentation: \"A default assignment expression like in `(a = 3) => a`\"\n}, AST_Binary);\n\n/* -----[ LITERALS ]----- */\n\nvar AST_Array = DEFNODE(\"Array\", \"elements\", {\n $documentation: \"An array literal\",\n $propdoc: {\n elements: \"[AST_Node*] array of elements\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n var elements = this.elements;\n for (var i = 0, len = elements.length; i < len; i++) {\n elements[i]._walk(visitor);\n }\n });\n }\n});\n\nvar AST_Object = DEFNODE(\"Object\", \"properties\", {\n $documentation: \"An object literal\",\n $propdoc: {\n properties: \"[AST_ObjectProperty*] array of properties\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n var properties = this.properties;\n for (var i = 0, len = properties.length; i < len; i++) {\n properties[i]._walk(visitor);\n }\n });\n }\n});\n\nvar AST_ObjectProperty = DEFNODE(\"ObjectProperty\", \"key value\", {\n $documentation: \"Base class for literal object properties\",\n $propdoc: {\n key: \"[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.\",\n value: \"[AST_Node] property value. For getters and setters this is an AST_Accessor.\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n if (this.key instanceof AST_Node)\n this.key._walk(visitor);\n this.value._walk(visitor);\n });\n }\n});\n\nvar AST_ObjectKeyVal = DEFNODE(\"ObjectKeyVal\", \"quote\", {\n $documentation: \"A key: value object property\",\n $propdoc: {\n quote: \"[string] the original quote character\"\n }\n}, AST_ObjectProperty);\n\nvar AST_ObjectSetter = DEFNODE(\"ObjectSetter\", \"quote static\", {\n $propdoc: {\n quote: \"[string|undefined] the original quote character, if any\",\n static: \"[boolean] whether this is a static setter (classes only)\"\n },\n $documentation: \"An object setter property\",\n}, AST_ObjectProperty);\n\nvar AST_ObjectGetter = DEFNODE(\"ObjectGetter\", \"quote static\", {\n $propdoc: {\n quote: \"[string|undefined] the original quote character, if any\",\n static: \"[boolean] whether this is a static getter (classes only)\"\n },\n $documentation: \"An object getter property\",\n}, AST_ObjectProperty);\n\nvar AST_ConciseMethod = DEFNODE(\"ConciseMethod\", \"quote static is_generator async\", {\n $propdoc: {\n quote: \"[string|undefined] the original quote character, if any\",\n static: \"[boolean] is this method static (classes only)\",\n is_generator: \"[boolean] is this a generator method\",\n async: \"[boolean] is this method async\",\n },\n $documentation: \"An ES6 concise method inside an object or class\"\n}, AST_ObjectProperty);\n\nvar AST_Class = DEFNODE(\"Class\", \"name extends properties inlined\", {\n $propdoc: {\n name: \"[AST_SymbolClass|AST_SymbolDefClass?] optional class name.\",\n extends: \"[AST_Node]? optional parent class\",\n properties: \"[AST_ObjectProperty*] array of properties\"\n },\n $documentation: \"An ES6 class\",\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n if (this.name) {\n this.name._walk(visitor);\n }\n if (this.extends) {\n this.extends._walk(visitor);\n }\n this.properties.forEach(function(prop) {\n prop._walk(visitor);\n });\n });\n },\n}, AST_Scope);\n\nvar AST_DefClass = DEFNODE(\"DefClass\", null, {\n $documentation: \"A class definition\",\n}, AST_Class);\n\nvar AST_ClassExpression = DEFNODE(\"ClassExpression\", null, {\n $documentation: \"A class expression.\"\n}, AST_Class);\n\nvar AST_Symbol = DEFNODE(\"Symbol\", \"scope name thedef\", {\n $propdoc: {\n name: \"[string] name of this symbol\",\n scope: \"[AST_Scope/S] the current scope (not necessarily the definition scope)\",\n thedef: \"[SymbolDef/S] the definition of this symbol\"\n },\n $documentation: \"Base class for all symbols\"\n});\n\nvar AST_NewTarget = DEFNODE(\"NewTarget\", null, {\n $documentation: \"A reference to new.target\"\n});\n\nvar AST_SymbolDeclaration = DEFNODE(\"SymbolDeclaration\", \"init\", {\n $documentation: \"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)\",\n}, AST_Symbol);\n\nvar AST_SymbolVar = DEFNODE(\"SymbolVar\", null, {\n $documentation: \"Symbol defining a variable\",\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolBlockDeclaration = DEFNODE(\"SymbolBlockDeclaration\", null, {\n $documentation: \"Base class for block-scoped declaration symbols\"\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolConst = DEFNODE(\"SymbolConst\", null, {\n $documentation: \"A constant declaration\"\n}, AST_SymbolBlockDeclaration);\n\nvar AST_SymbolLet = DEFNODE(\"SymbolLet\", null, {\n $documentation: \"A block-scoped `let` declaration\"\n}, AST_SymbolBlockDeclaration);\n\nvar AST_SymbolFunarg = DEFNODE(\"SymbolFunarg\", null, {\n $documentation: \"Symbol naming a function argument\",\n}, AST_SymbolVar);\n\nvar AST_SymbolDefun = DEFNODE(\"SymbolDefun\", null, {\n $documentation: \"Symbol defining a function\",\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolMethod = DEFNODE(\"SymbolMethod\", null, {\n $documentation: \"Symbol in an object defining a method\",\n}, AST_Symbol);\n\nvar AST_SymbolLambda = DEFNODE(\"SymbolLambda\", null, {\n $documentation: \"Symbol naming a function expression\",\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolDefClass = DEFNODE(\"SymbolDefClass\", null, {\n $documentation: \"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class.\"\n}, AST_SymbolBlockDeclaration);\n\nvar AST_SymbolClass = DEFNODE(\"SymbolClass\", null, {\n $documentation: \"Symbol naming a class's name. Lexically scoped to the class.\"\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolCatch = DEFNODE(\"SymbolCatch\", null, {\n $documentation: \"Symbol naming the exception in catch\",\n}, AST_SymbolBlockDeclaration);\n\nvar AST_SymbolImport = DEFNODE(\"SymbolImport\", null, {\n $documentation: \"Symbol referring to an imported name\",\n}, AST_SymbolBlockDeclaration);\n\nvar AST_SymbolImportForeign = DEFNODE(\"SymbolImportForeign\", null, {\n $documentation: \"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes\",\n}, AST_Symbol);\n\nvar AST_Label = DEFNODE(\"Label\", \"references\", {\n $documentation: \"Symbol naming a label (declaration)\",\n $propdoc: {\n references: \"[AST_LoopControl*] a list of nodes referring to this label\"\n },\n initialize: function() {\n this.references = [];\n this.thedef = this;\n }\n}, AST_Symbol);\n\nvar AST_SymbolRef = DEFNODE(\"SymbolRef\", null, {\n $documentation: \"Reference to some symbol (not definition/declaration)\",\n}, AST_Symbol);\n\nvar AST_SymbolExport = DEFNODE(\"SymbolExport\", null, {\n $documentation: \"Symbol referring to a name to export\",\n}, AST_SymbolRef);\n\nvar AST_SymbolExportForeign = DEFNODE(\"SymbolExportForeign\", null, {\n $documentation: \"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes\",\n}, AST_Symbol);\n\nvar AST_LabelRef = DEFNODE(\"LabelRef\", null, {\n $documentation: \"Reference to a label symbol\",\n}, AST_Symbol);\n\nvar AST_This = DEFNODE(\"This\", null, {\n $documentation: \"The `this` symbol\",\n}, AST_Symbol);\n\nvar AST_Super = DEFNODE(\"Super\", null, {\n $documentation: \"The `super` symbol\",\n}, AST_This);\n\nvar AST_Constant = DEFNODE(\"Constant\", null, {\n $documentation: \"Base class for all constants\",\n getValue: function() {\n return this.value;\n }\n});\n\nvar AST_String = DEFNODE(\"String\", \"value quote\", {\n $documentation: \"A string literal\",\n $propdoc: {\n value: \"[string] the contents of this string\",\n quote: \"[string] the original quote character\"\n }\n}, AST_Constant);\n\nvar AST_Number = DEFNODE(\"Number\", \"value literal\", {\n $documentation: \"A number literal\",\n $propdoc: {\n value: \"[number] the numeric value\",\n literal: \"[string] numeric value as string (optional)\"\n }\n}, AST_Constant);\n\nvar AST_RegExp = DEFNODE(\"RegExp\", \"value\", {\n $documentation: \"A regexp literal\",\n $propdoc: {\n value: \"[RegExp] the actual regexp\",\n }\n}, AST_Constant);\n\nvar AST_Atom = DEFNODE(\"Atom\", null, {\n $documentation: \"Base class for atoms\",\n}, AST_Constant);\n\nvar AST_Null = DEFNODE(\"Null\", null, {\n $documentation: \"The `null` atom\",\n value: null\n}, AST_Atom);\n\nvar AST_NaN = DEFNODE(\"NaN\", null, {\n $documentation: \"The impossible value\",\n value: 0/0\n}, AST_Atom);\n\nvar AST_Undefined = DEFNODE(\"Undefined\", null, {\n $documentation: \"The `undefined` value\",\n value: (function() {}())\n}, AST_Atom);\n\nvar AST_Hole = DEFNODE(\"Hole\", null, {\n $documentation: \"A hole in an array\",\n value: (function() {}())\n}, AST_Atom);\n\nvar AST_Infinity = DEFNODE(\"Infinity\", null, {\n $documentation: \"The `Infinity` value\",\n value: 1/0\n}, AST_Atom);\n\nvar AST_Boolean = DEFNODE(\"Boolean\", null, {\n $documentation: \"Base class for booleans\",\n}, AST_Atom);\n\nvar AST_False = DEFNODE(\"False\", null, {\n $documentation: \"The `false` atom\",\n value: false\n}, AST_Boolean);\n\nvar AST_True = DEFNODE(\"True\", null, {\n $documentation: \"The `true` atom\",\n value: true\n}, AST_Boolean);\n\nvar AST_Await = DEFNODE(\"Await\", \"expression\", {\n $documentation: \"An `await` statement\",\n $propdoc: {\n expression: \"[AST_Node] the mandatory expression being awaited\",\n },\n _walk: function(visitor) {\n return visitor._visit(this, function() {\n this.expression._walk(visitor);\n });\n }\n});\n\nvar AST_Yield = DEFNODE(\"Yield\", \"expression is_star\", {\n $documentation: \"A `yield` statement\",\n $propdoc: {\n expression: \"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false\",\n is_star: \"[Boolean] Whether this is a yield or yield* statement\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, this.expression && function() {\n this.expression._walk(visitor);\n });\n }\n});\n\n/* -----[ TreeWalker ]----- */\n\nfunction TreeWalker(callback) {\n this.visit = callback;\n this.stack = [];\n this.directives = Object.create(null);\n}\nTreeWalker.prototype = {\n _visit: function(node, descend) {\n this.push(node);\n var ret = this.visit(node, descend ? function() {\n descend.call(node);\n } : noop);\n if (!ret && descend) {\n descend.call(node);\n }\n this.pop();\n return ret;\n },\n parent: function(n) {\n return this.stack[this.stack.length - 2 - (n || 0)];\n },\n push: function(node) {\n if (node instanceof AST_Lambda) {\n this.directives = Object.create(this.directives);\n } else if (node instanceof AST_Directive && !this.directives[node.value]) {\n this.directives[node.value] = node;\n } else if (node instanceof AST_Class) {\n this.directives = Object.create(this.directives);\n if (!this.directives[\"use strict\"]) {\n this.directives[\"use strict\"] = node;\n }\n }\n this.stack.push(node);\n },\n pop: function() {\n var node = this.stack.pop();\n if (node instanceof AST_Lambda || node instanceof AST_Class) {\n this.directives = Object.getPrototypeOf(this.directives);\n }\n },\n self: function() {\n return this.stack[this.stack.length - 1];\n },\n find_parent: function(type) {\n var stack = this.stack;\n for (var i = stack.length; --i >= 0;) {\n var x = stack[i];\n if (x instanceof type) return x;\n }\n },\n has_directive: function(type) {\n var dir = this.directives[type];\n if (dir) return dir;\n var node = this.stack[this.stack.length - 1];\n if (node instanceof AST_Scope && node.body) {\n for (var i = 0; i < node.body.length; ++i) {\n var st = node.body[i];\n if (!(st instanceof AST_Directive)) break;\n if (st.value == type) return st;\n }\n }\n },\n loopcontrol_target: function(node) {\n var stack = this.stack;\n if (node.label) for (var i = stack.length; --i >= 0;) {\n var x = stack[i];\n if (x instanceof AST_LabeledStatement && x.label.name == node.label.name)\n return x.body;\n } else for (var i = stack.length; --i >= 0;) {\n var x = stack[i];\n if (x instanceof AST_IterationStatement\n || node instanceof AST_Break && x instanceof AST_Switch)\n return x;\n }\n }\n};\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nvar KEYWORDS = \"break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with\";\nvar KEYWORDS_ATOM = \"false null true\";\nvar RESERVED_WORDS = \"enum implements import interface package private protected public static super this \" + KEYWORDS_ATOM + \" \" + KEYWORDS;\nvar KEYWORDS_BEFORE_EXPRESSION = \"return new delete throw else case yield await\";\n\nKEYWORDS = makePredicate(KEYWORDS);\nRESERVED_WORDS = makePredicate(RESERVED_WORDS);\nKEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION);\nKEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM);\n\nvar OPERATOR_CHARS = makePredicate(characters(\"+-*&%=<>!?|~^\"));\n\nvar RE_NUM_LITERAL = /[0-9a-f]/i;\nvar RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;\nvar RE_OCT_NUMBER = /^0[0-7]+$/;\nvar RE_ES6_OCT_NUMBER = /^0o[0-7]+$/i;\nvar RE_BIN_NUMBER = /^0b[01]+$/i;\nvar RE_DEC_NUMBER = /^\\d*\\.?\\d*(?:e[+-]?\\d*(?:\\d\\.?|\\.?\\d)\\d*)?$/i;\n\nvar OPERATORS = makePredicate([\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"new\",\n \"void\",\n \"delete\",\n \"++\",\n \"--\",\n \"+\",\n \"-\",\n \"!\",\n \"~\",\n \"&\",\n \"|\",\n \"^\",\n \"*\",\n \"**\",\n \"/\",\n \"%\",\n \">>\",\n \"<<\",\n \">>>\",\n \"<\",\n \">\",\n \"<=\",\n \">=\",\n \"==\",\n \"===\",\n \"!=\",\n \"!==\",\n \"?\",\n \"=\",\n \"+=\",\n \"-=\",\n \"/=\",\n \"*=\",\n \"**=\",\n \"%=\",\n \">>=\",\n \"<<=\",\n \">>>=\",\n \"|=\",\n \"^=\",\n \"&=\",\n \"&&\",\n \"||\"\n]);\n\nvar WHITESPACE_CHARS = makePredicate(characters(\" \\u00a0\\n\\r\\t\\f\\u000b\\u200b\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\uFEFF\"));\n\nvar NEWLINE_CHARS = makePredicate(characters(\"\\n\\r\\u2028\\u2029\"));\n\nvar PUNC_AFTER_EXPRESSION = makePredicate(characters(\";]),:\"));\n\nvar PUNC_BEFORE_EXPRESSION = makePredicate(characters(\"[{(,;:\"));\n\nvar PUNC_CHARS = makePredicate(characters(\"[]{}(),;:\"));\n\n/* -----[ Tokenizer ]----- */\n\n// surrogate safe regexps adapted from https://github.com/mathiasbynens/unicode-8.0.0/tree/89b412d8a71ecca9ed593d9e9fa073ab64acfebe/Binary_Property\nvar UNICODE = {\n ID_Start: /[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AD\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\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A\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D]/,\n ID_Continue: /[0-9A-Z_a-z\\xAA\\xB5\\xB7\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B4\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8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F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1369-\\u1371\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19DA\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AD\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA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DF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/,\n};\n\nfunction get_full_char(str, pos) {\n var char = str.charAt(pos);\n if (is_surrogate_pair_head(char)) {\n var next = str.charAt(pos + 1);\n if (is_surrogate_pair_tail(next)) {\n return char + next;\n }\n }\n if (is_surrogate_pair_tail(char)) {\n var prev = str.charAt(pos - 1);\n if (is_surrogate_pair_head(prev)) {\n return prev + char;\n }\n }\n return char;\n}\n\nfunction get_full_char_code(str, pos) {\n // https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates\n if (is_surrogate_pair_head(str.charAt(pos))) {\n return 0x10000 + (str.charCodeAt(pos) - 0xd800 << 10) + str.charCodeAt(pos + 1) - 0xdc00;\n }\n return str.charCodeAt(pos);\n}\n\nfunction get_full_char_length(str) {\n var surrogates = 0;\n\n for (var i = 0; i < str.length; i++) {\n if (is_surrogate_pair_head(str.charCodeAt(i))) {\n if (is_surrogate_pair_tail(str.charCodeAt(i + 1))) {\n surrogates++;\n i++;\n }\n }\n }\n\n return str.length - surrogates;\n}\n\nfunction from_char_code(code) {\n // Based on https://github.com/mathiasbynens/String.fromCodePoint/blob/master/fromcodepoint.js\n if (code > 0xFFFF) {\n code -= 0x10000;\n return (String.fromCharCode((code >> 10) + 0xD800) +\n String.fromCharCode((code % 0x400) + 0xDC00));\n }\n return String.fromCharCode(code);\n}\n\nfunction is_surrogate_pair_head(code) {\n if (typeof code === \"string\")\n code = code.charCodeAt(0);\n\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction is_surrogate_pair_tail(code) {\n if (typeof code === \"string\")\n code = code.charCodeAt(0);\n return code >= 0xdc00 && code <= 0xdfff;\n}\n\nfunction is_digit(code) {\n return code >= 48 && code <= 57;\n}\n\nfunction is_identifier(name) {\n if (typeof name !== \"string\" || RESERVED_WORDS(name))\n return false;\n\n return true;\n}\n\nfunction is_identifier_start(ch) {\n var code = ch.charCodeAt(0);\n return UNICODE.ID_Start.test(ch) || code == 36 || code == 95;\n}\n\nfunction is_identifier_char(ch) {\n var code = ch.charCodeAt(0);\n return UNICODE.ID_Continue.test(ch)\n || code == 36\n || code == 95\n || code == 8204 // \\u200c: zero-width non-joiner \n || code == 8205 // \\u200d: zero-width joiner (in my ECMA-262 PDF, this is also 200c)\n ;\n}\n\nfunction is_identifier_string(str) {\n return /^[a-z_$][a-z0-9_$]*$/i.test(str);\n}\n\nfunction parse_js_number(num) {\n if (RE_HEX_NUMBER.test(num)) {\n return parseInt(num.substr(2), 16);\n } else if (RE_OCT_NUMBER.test(num)) {\n return parseInt(num.substr(1), 8);\n } else if (RE_ES6_OCT_NUMBER.test(num)) {\n return parseInt(num.substr(2), 8);\n } else if (RE_BIN_NUMBER.test(num)) {\n return parseInt(num.substr(2), 2);\n } else if (RE_DEC_NUMBER.test(num)) {\n return parseFloat(num);\n } else {\n var val = parseFloat(num);\n if (val == num) return val;\n }\n}\n\nfunction JS_Parse_Error(message, filename, line, col, pos) {\n this.message = message;\n this.filename = filename;\n this.line = line;\n this.col = col;\n this.pos = pos;\n}\nJS_Parse_Error.prototype = Object.create(Error.prototype);\nJS_Parse_Error.prototype.constructor = JS_Parse_Error;\nJS_Parse_Error.prototype.name = \"SyntaxError\";\nconfigure_error_stack(JS_Parse_Error);\n\nfunction js_error(message, filename, line, col, pos) {\n throw new JS_Parse_Error(message, filename, line, col, pos);\n}\n\nfunction is_token(token, type, val) {\n return token.type == type && (val == null || token.value == val);\n}\n\nvar EX_EOF = {};\n\nfunction tokenizer($TEXT, filename, html5_comments, shebang) {\n\n var S = {\n text : $TEXT,\n filename : filename,\n pos : 0,\n tokpos : 0,\n line : 1,\n tokline : 0,\n col : 0,\n tokcol : 0,\n newline_before : false,\n regex_allowed : false,\n brace_counter : 0,\n template_braces : [],\n comments_before : [],\n directives : {},\n directive_stack : []\n };\n\n function peek() { return get_full_char(S.text, S.pos); }\n\n function next(signal_eof, in_string) {\n var ch = get_full_char(S.text, S.pos++);\n if (signal_eof && !ch)\n throw EX_EOF;\n if (NEWLINE_CHARS(ch)) {\n S.newline_before = S.newline_before || !in_string;\n ++S.line;\n S.col = 0;\n if (!in_string && ch == \"\\r\" && peek() == \"\\n\") {\n // treat a \\r\\n sequence as a single \\n\n ++S.pos;\n ch = \"\\n\";\n }\n } else {\n if (ch.length > 1) {\n ++S.pos;\n ++S.col;\n }\n ++S.col;\n }\n return ch;\n }\n\n function forward(i) {\n while (i-- > 0) next();\n }\n\n function looking_at(str) {\n return S.text.substr(S.pos, str.length) == str;\n }\n\n function find_eol() {\n var text = S.text;\n for (var i = S.pos, n = S.text.length; i < n; ++i) {\n var ch = text[i];\n if (NEWLINE_CHARS(ch))\n return i;\n }\n return -1;\n }\n\n function find(what, signal_eof) {\n var pos = S.text.indexOf(what, S.pos);\n if (signal_eof && pos == -1) throw EX_EOF;\n return pos;\n }\n\n function start_token() {\n S.tokline = S.line;\n S.tokcol = S.col;\n S.tokpos = S.pos;\n }\n\n var prev_was_dot = false;\n var previous_token = null;\n function token(type, value, is_comment) {\n S.regex_allowed = ((type == \"operator\" && !UNARY_POSTFIX(value)) ||\n (type == \"keyword\" && KEYWORDS_BEFORE_EXPRESSION(value)) ||\n (type == \"punc\" && PUNC_BEFORE_EXPRESSION(value))) ||\n (type == \"arrow\");\n if (type == \"punc\" && value == \".\") {\n prev_was_dot = true;\n } else if (!is_comment) {\n prev_was_dot = false;\n }\n var ret = {\n type : type,\n value : value,\n line : S.tokline,\n col : S.tokcol,\n pos : S.tokpos,\n endline : S.line,\n endcol : S.col,\n endpos : S.pos,\n nlb : S.newline_before,\n file : filename\n };\n if (/^(?:num|string|regexp)$/i.test(type)) {\n ret.raw = $TEXT.substring(ret.pos, ret.endpos);\n }\n if (!is_comment) {\n ret.comments_before = S.comments_before;\n ret.comments_after = S.comments_before = [];\n }\n S.newline_before = false;\n ret = new AST_Token(ret);\n if (!is_comment) previous_token = ret;\n return ret;\n }\n\n function skip_whitespace() {\n while (WHITESPACE_CHARS(peek()))\n next();\n }\n\n function read_while(pred) {\n var ret = \"\", ch, i = 0;\n while ((ch = peek()) && pred(ch, i++))\n ret += next();\n return ret;\n }\n\n function parse_error(err) {\n js_error(err, filename, S.tokline, S.tokcol, S.tokpos);\n }\n\n function read_num(prefix) {\n var has_e = false, after_e = false, has_x = false, has_dot = prefix == \".\";\n var num = read_while(function(ch, i) {\n var code = ch.charCodeAt(0);\n switch (code) {\n case 98: case 66: // bB\n return (has_x = true); // Can occur in hex sequence, don't return false yet\n case 111: case 79: // oO\n case 120: case 88: // xX\n return has_x ? false : (has_x = true);\n case 101: case 69: // eE\n return has_x ? true : has_e ? false : (has_e = after_e = true);\n case 45: // -\n return after_e || (i == 0 && !prefix);\n case 43: // +\n return after_e;\n case (after_e = false, 46): // .\n return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false;\n }\n return RE_NUM_LITERAL.test(ch);\n });\n if (prefix) num = prefix + num;\n if (RE_OCT_NUMBER.test(num) && next_token.has_directive(\"use strict\")) {\n parse_error(\"Legacy octal literals are not allowed in strict mode\");\n }\n var valid = parse_js_number(num);\n if (!isNaN(valid)) {\n return token(\"num\", valid);\n } else {\n parse_error(\"Invalid syntax: \" + num);\n }\n }\n\n function read_escaped_char(in_string, strict_hex, template_string) {\n var ch = next(true, in_string);\n switch (ch.charCodeAt(0)) {\n case 110 : return \"\\n\";\n case 114 : return \"\\r\";\n case 116 : return \"\\t\";\n case 98 : return \"\\b\";\n case 118 : return \"\\u000b\"; // \\v\n case 102 : return \"\\f\";\n case 120 : return String.fromCharCode(hex_bytes(2, strict_hex)); // \\x\n case 117 : // \\u\n if (peek() == \"{\") {\n next(true);\n if (peek() === \"}\")\n parse_error(\"Expecting hex-character between {}\");\n while (peek() == \"0\") next(true); // No significance\n var result, length = find(\"}\", true) - S.pos;\n // Avoid 32 bit integer overflow (1 << 32 === 1)\n // We know first character isn't 0 and thus out of range anyway\n if (length > 6 || (result = hex_bytes(length, strict_hex)) > 0x10FFFF) {\n parse_error(\"Unicode reference out of bounds\");\n }\n next(true);\n return from_char_code(result);\n }\n return String.fromCharCode(hex_bytes(4, strict_hex));\n case 10 : return \"\"; // newline\n case 13 : // \\r\n if (peek() == \"\\n\") { // DOS newline\n next(true, in_string);\n return \"\";\n }\n }\n if (ch >= \"0\" && ch <= \"7\") {\n if (template_string && strict_hex) {\n parse_error(\"Octal escape sequences are not allowed in template strings\");\n }\n return read_octal_escape_sequence(ch, strict_hex);\n }\n return ch;\n }\n\n function read_octal_escape_sequence(ch, strict_octal) {\n // Read\n var p = peek();\n if (p >= \"0\" && p <= \"7\") {\n ch += next(true);\n if (ch[0] <= \"3\" && (p = peek()) >= \"0\" && p <= \"7\")\n ch += next(true);\n }\n\n // Parse\n if (ch === \"0\") return \"\\0\";\n if (ch.length > 0 && next_token.has_directive(\"use strict\") && strict_octal)\n parse_error(\"Legacy octal escape sequences are not allowed in strict mode\");\n return String.fromCharCode(parseInt(ch, 8));\n }\n\n function hex_bytes(n, strict_hex) {\n var num = 0;\n for (; n > 0; --n) {\n if (!strict_hex && isNaN(parseInt(peek(), 16))) {\n return parseInt(num, 16) || \"\";\n }\n var digit = next(true);\n if (isNaN(parseInt(digit, 16)))\n parse_error(\"Invalid hex-character pattern in string\");\n num += digit;\n }\n return parseInt(num, 16);\n }\n\n var read_string = with_eof_error(\"Unterminated string constant\", function(quote_char) {\n var quote = next(), ret = \"\";\n for (;;) {\n var ch = next(true, true);\n if (ch == \"\\\\\") ch = read_escaped_char(true, true);\n else if (NEWLINE_CHARS(ch)) parse_error(\"Unterminated string constant\");\n else if (ch == quote) break;\n ret += ch;\n }\n var tok = token(\"string\", ret);\n tok.quote = quote_char;\n return tok;\n });\n\n var read_template_characters = with_eof_error(\"Unterminated template\", function(begin) {\n if (begin) {\n S.template_braces.push(S.brace_counter);\n }\n var content = \"\", raw = \"\", ch, tok;\n next(true, true);\n while ((ch = next(true, true)) != \"`\") {\n if (ch == \"\\r\") {\n if (peek() == \"\\n\") ++S.pos;\n ch = \"\\n\";\n } else if (ch == \"$\" && peek() == \"{\") {\n next(true, true);\n S.brace_counter++;\n tok = token(begin ? \"template_head\" : \"template_substitution\", content);\n tok.begin = begin;\n tok.raw = raw;\n tok.end = false;\n return tok;\n }\n\n raw += ch;\n if (ch == \"\\\\\") {\n var tmp = S.pos;\n var prev_is_tag = previous_token.type === \"name\" || previous_token.type === \"punc\" && (previous_token.value === \")\" || previous_token.value === \"]\");\n ch = read_escaped_char(true, !prev_is_tag, true);\n raw += S.text.substr(tmp, S.pos - tmp);\n }\n\n content += ch;\n }\n S.template_braces.pop();\n tok = token(begin ? \"template_head\" : \"template_substitution\", content);\n tok.begin = begin;\n tok.raw = raw;\n tok.end = true;\n return tok;\n });\n\n function skip_line_comment(type) {\n var regex_allowed = S.regex_allowed;\n var i = find_eol(), ret;\n if (i == -1) {\n ret = S.text.substr(S.pos);\n S.pos = S.text.length;\n } else {\n ret = S.text.substring(S.pos, i);\n S.pos = i;\n }\n S.col = S.tokcol + (S.pos - S.tokpos);\n S.comments_before.push(token(type, ret, true));\n S.regex_allowed = regex_allowed;\n return next_token;\n }\n\n var skip_multiline_comment = with_eof_error(\"Unterminated multiline comment\", function() {\n var regex_allowed = S.regex_allowed;\n var i = find(\"*/\", true);\n var text = S.text.substring(S.pos, i).replace(/\\r\\n|\\r|\\u2028|\\u2029/g, \"\\n\");\n // update stream position\n forward(get_full_char_length(text) /* text length doesn't count \\r\\n as 2 char while S.pos - i does */ + 2);\n S.comments_before.push(token(\"comment2\", text, true));\n S.newline_before = S.newline_before || text.indexOf(\"\\n\") >= 0;\n S.regex_allowed = regex_allowed;\n return next_token;\n });\n\n var read_name = with_eof_error(\"Unterminated identifier name\", function() {\n var name = \"\", ch, escaped = false, hex;\n var read_escaped_identifier_char = function() {\n escaped = true;\n next();\n if (peek() !== \"u\") {\n parse_error(\"Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}\");\n }\n return read_escaped_char(false, true);\n };\n\n // Read first character (ID_Start)\n if ((name = peek()) === \"\\\\\") {\n name = read_escaped_identifier_char();\n if (!is_identifier_start(name)) {\n parse_error(\"First identifier char is an invalid identifier char\");\n }\n } else if (is_identifier_start(name)) {\n next();\n } else {\n return \"\";\n }\n\n // Read ID_Continue\n while ((ch = peek()) != null) {\n if ((ch = peek()) === \"\\\\\") {\n ch = read_escaped_identifier_char();\n if (!is_identifier_char(ch)) {\n parse_error(\"Invalid escaped identifier char\");\n }\n } else {\n if (!is_identifier_char(ch)) {\n break;\n }\n next();\n }\n name += ch;\n }\n if (RESERVED_WORDS(name) && escaped) {\n parse_error(\"Escaped characters are not allowed in keywords\");\n }\n return name;\n });\n\n var read_regexp = with_eof_error(\"Unterminated regular expression\", function(source) {\n var prev_backslash = false, ch, in_class = false;\n while ((ch = next(true))) if (NEWLINE_CHARS(ch)) {\n parse_error(\"Unexpected line terminator\");\n } else if (prev_backslash) {\n source += \"\\\\\" + ch;\n prev_backslash = false;\n } else if (ch == \"[\") {\n in_class = true;\n source += ch;\n } else if (ch == \"]\" && in_class) {\n in_class = false;\n source += ch;\n } else if (ch == \"/\" && !in_class) {\n break;\n } else if (ch == \"\\\\\") {\n prev_backslash = true;\n } else {\n source += ch;\n }\n var mods = read_name();\n try {\n var regexp = new RegExp(source, mods);\n regexp.raw_source = \"/\" + source + \"/\" + mods;\n return token(\"regexp\", regexp);\n } catch(e) {\n parse_error(e.message);\n }\n });\n\n function read_operator(prefix) {\n function grow(op) {\n if (!peek()) return op;\n var bigger = op + peek();\n if (OPERATORS(bigger)) {\n next();\n return grow(bigger);\n } else {\n return op;\n }\n }\n return token(\"operator\", grow(prefix || next()));\n }\n\n function handle_slash() {\n next();\n switch (peek()) {\n case \"/\":\n next();\n return skip_line_comment(\"comment1\");\n case \"*\":\n next();\n return skip_multiline_comment();\n }\n return S.regex_allowed ? read_regexp(\"\") : read_operator(\"/\");\n }\n\n function handle_eq_sign() {\n next();\n if (peek() === \">\") {\n next();\n return token(\"arrow\", \"=>\");\n } else {\n return read_operator(\"=\");\n }\n }\n\n function handle_dot() {\n next();\n if (is_digit(peek().charCodeAt(0))) {\n return read_num(\".\");\n }\n if (peek() === \".\") {\n next(); // Consume second dot\n next(); // Consume third dot\n return token(\"expand\", \"...\");\n }\n\n return token(\"punc\", \".\");\n }\n\n function read_word() {\n var word = read_name();\n if (prev_was_dot) return token(\"name\", word);\n return KEYWORDS_ATOM(word) ? token(\"atom\", word)\n : !KEYWORDS(word) ? token(\"name\", word)\n : OPERATORS(word) ? token(\"operator\", word)\n : token(\"keyword\", word);\n }\n\n function with_eof_error(eof_error, cont) {\n return function(x) {\n try {\n return cont(x);\n } catch(ex) {\n if (ex === EX_EOF) parse_error(eof_error);\n else throw ex;\n }\n };\n }\n\n function next_token(force_regexp) {\n if (force_regexp != null)\n return read_regexp(force_regexp);\n if (shebang && S.pos == 0 && looking_at(\"#!\")) {\n start_token();\n forward(2);\n skip_line_comment(\"comment5\");\n }\n for (;;) {\n skip_whitespace();\n start_token();\n if (html5_comments) {\n if (looking_at(\"\") && S.newline_before) {\n forward(3);\n skip_line_comment(\"comment4\");\n continue;\n }\n }\n var ch = peek();\n if (!ch) return token(\"eof\");\n var code = ch.charCodeAt(0);\n switch (code) {\n case 34: case 39: return read_string(ch);\n case 46: return handle_dot();\n case 47: {\n var tok = handle_slash();\n if (tok === next_token) continue;\n return tok;\n }\n case 61: return handle_eq_sign();\n case 96: return read_template_characters(true);\n case 123:\n S.brace_counter++;\n break;\n case 125:\n S.brace_counter--;\n if (S.template_braces.length > 0\n && S.template_braces[S.template_braces.length - 1] === S.brace_counter)\n return read_template_characters(false);\n break;\n }\n if (is_digit(code)) return read_num();\n if (PUNC_CHARS(ch)) return token(\"punc\", next());\n if (OPERATOR_CHARS(ch)) return read_operator();\n if (code == 92 || is_identifier_start(ch)) return read_word();\n break;\n }\n parse_error(\"Unexpected character '\" + ch + \"'\");\n }\n\n next_token.next = next;\n next_token.peek = peek;\n\n next_token.context = function(nc) {\n if (nc) S = nc;\n return S;\n };\n\n next_token.add_directive = function(directive) {\n S.directive_stack[S.directive_stack.length - 1].push(directive);\n\n if (S.directives[directive] === undefined) {\n S.directives[directive] = 1;\n } else {\n S.directives[directive]++;\n }\n };\n\n next_token.push_directives_stack = function() {\n S.directive_stack.push([]);\n };\n\n next_token.pop_directives_stack = function() {\n var directives = S.directive_stack[S.directive_stack.length - 1];\n\n for (var i = 0; i < directives.length; i++) {\n S.directives[directives[i]]--;\n }\n\n S.directive_stack.pop();\n };\n\n next_token.has_directive = function(directive) {\n return S.directives[directive] > 0;\n };\n\n return next_token;\n\n}\n\n/* -----[ Parser (constants) ]----- */\n\nvar UNARY_PREFIX = makePredicate([\n \"typeof\",\n \"void\",\n \"delete\",\n \"--\",\n \"++\",\n \"!\",\n \"~\",\n \"-\",\n \"+\"\n]);\n\nvar UNARY_POSTFIX = makePredicate([ \"--\", \"++\" ]);\n\nvar ASSIGNMENT = makePredicate([ \"=\", \"+=\", \"-=\", \"/=\", \"*=\", \"**=\", \"%=\", \">>=\", \"<<=\", \">>>=\", \"|=\", \"^=\", \"&=\" ]);\n\nvar PRECEDENCE = (function(a, ret) {\n for (var i = 0; i < a.length; ++i) {\n var b = a[i];\n for (var j = 0; j < b.length; ++j) {\n ret[b[j]] = i + 1;\n }\n }\n return ret;\n})(\n [\n [\"||\"],\n [\"&&\"],\n [\"|\"],\n [\"^\"],\n [\"&\"],\n [\"==\", \"===\", \"!=\", \"!==\"],\n [\"<\", \">\", \"<=\", \">=\", \"in\", \"instanceof\"],\n [\">>\", \"<<\", \">>>\"],\n [\"+\", \"-\"],\n [\"*\", \"/\", \"%\"],\n [\"**\"]\n ],\n {}\n);\n\nvar ATOMIC_START_TOKEN = makePredicate([ \"atom\", \"num\", \"string\", \"regexp\", \"name\" ]);\n\n/* -----[ Parser ]----- */\n\nfunction parse($TEXT, options) {\n\n options = defaults(options, {\n bare_returns : false,\n ecma : 8,\n expression : false,\n filename : null,\n html5_comments : true,\n module : false,\n shebang : true,\n strict : false,\n toplevel : null,\n }, true);\n\n var S = {\n input : (typeof $TEXT == \"string\"\n ? tokenizer($TEXT, options.filename,\n options.html5_comments, options.shebang)\n : $TEXT),\n token : null,\n prev : null,\n peeked : null,\n in_function : 0,\n in_async : -1,\n in_generator : -1,\n in_directives : true,\n in_loop : 0,\n labels : []\n };\n\n S.token = next();\n\n function is(type, value) {\n return is_token(S.token, type, value);\n }\n\n function peek() { return S.peeked || (S.peeked = S.input()); }\n\n function next() {\n S.prev = S.token;\n\n if (!S.peeked) peek();\n S.token = S.peeked;\n S.peeked = null;\n S.in_directives = S.in_directives && (\n S.token.type == \"string\" || is(\"punc\", \";\")\n );\n return S.token;\n }\n\n function prev() {\n return S.prev;\n }\n\n function croak(msg, line, col, pos) {\n var ctx = S.input.context();\n js_error(msg,\n ctx.filename,\n line != null ? line : ctx.tokline,\n col != null ? col : ctx.tokcol,\n pos != null ? pos : ctx.tokpos);\n }\n\n function token_error(token, msg) {\n croak(msg, token.line, token.col);\n }\n\n function unexpected(token) {\n if (token == null)\n token = S.token;\n token_error(token, \"Unexpected token: \" + token.type + \" (\" + token.value + \")\");\n }\n\n function expect_token(type, val) {\n if (is(type, val)) {\n return next();\n }\n token_error(S.token, \"Unexpected token \" + S.token.type + \" «\" + S.token.value + \"»\" + \", expected \" + type + \" «\" + val + \"»\");\n }\n\n function expect(punc) { return expect_token(\"punc\", punc); }\n\n function has_newline_before(token) {\n return token.nlb || !all(token.comments_before, function(comment) {\n return !comment.nlb;\n });\n }\n\n function can_insert_semicolon() {\n return !options.strict\n && (is(\"eof\") || is(\"punc\", \"}\") || has_newline_before(S.token));\n }\n\n function is_in_generator() {\n return S.in_generator === S.in_function;\n }\n\n function is_in_async() {\n return S.in_async === S.in_function;\n }\n\n function semicolon(optional) {\n if (is(\"punc\", \";\")) next();\n else if (!optional && !can_insert_semicolon()) unexpected();\n }\n\n function parenthesised() {\n expect(\"(\");\n var exp = expression(true);\n expect(\")\");\n return exp;\n }\n\n function embed_tokens(parser) {\n return function() {\n var start = S.token;\n var expr = parser.apply(null, arguments);\n var end = prev();\n expr.start = start;\n expr.end = end;\n return expr;\n };\n }\n\n function handle_regexp() {\n if (is(\"operator\", \"/\") || is(\"operator\", \"/=\")) {\n S.peeked = null;\n S.token = S.input(S.token.value.substr(1)); // force regexp\n }\n }\n\n var statement = embed_tokens(function(is_export_default, is_for_body, is_if_body) {\n handle_regexp();\n switch (S.token.type) {\n case \"string\":\n if (S.in_directives) {\n var token = peek();\n if (S.token.raw.indexOf(\"\\\\\") == -1\n && (is_token(token, \"punc\", \";\")\n || is_token(token, \"punc\", \"}\")\n || has_newline_before(token)\n || is_token(token, \"eof\"))) {\n S.input.add_directive(S.token.value);\n } else {\n S.in_directives = false;\n }\n }\n var dir = S.in_directives, stat = simple_statement();\n return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat;\n case \"template_head\":\n case \"num\":\n case \"regexp\":\n case \"operator\":\n case \"atom\":\n return simple_statement();\n\n case \"name\":\n if (S.token.value == \"async\" && is_token(peek(), \"keyword\", \"function\")) {\n next();\n next();\n if (is_for_body) {\n croak(\"functions are not allowed as the body of a loop\");\n }\n return function_(AST_Defun, false, true, is_export_default);\n }\n if (S.token.value == \"import\" && !is_token(peek(), \"punc\", \"(\")) {\n next();\n var node = import_();\n semicolon();\n return node;\n }\n return is_token(peek(), \"punc\", \":\")\n ? labeled_statement()\n : simple_statement();\n\n case \"punc\":\n switch (S.token.value) {\n case \"{\":\n return new AST_BlockStatement({\n start : S.token,\n body : block_(),\n end : prev()\n });\n case \"[\":\n case \"(\":\n return simple_statement();\n case \";\":\n S.in_directives = false;\n next();\n return new AST_EmptyStatement();\n default:\n unexpected();\n }\n\n case \"keyword\":\n switch (S.token.value) {\n case \"break\":\n next();\n return break_cont(AST_Break);\n\n case \"continue\":\n next();\n return break_cont(AST_Continue);\n\n case \"debugger\":\n next();\n semicolon();\n return new AST_Debugger();\n\n case \"do\":\n next();\n var body = in_loop(statement);\n expect_token(\"keyword\", \"while\");\n var condition = parenthesised();\n semicolon(true);\n return new AST_Do({\n body : body,\n condition : condition\n });\n\n case \"while\":\n next();\n return new AST_While({\n condition : parenthesised(),\n body : in_loop(function() { return statement(false, true); })\n });\n\n case \"for\":\n next();\n return for_();\n\n case \"class\":\n next();\n if (is_for_body) {\n croak(\"classes are not allowed as the body of a loop\");\n }\n if (is_if_body) {\n croak(\"classes are not allowed as the body of an if\");\n }\n return class_(AST_DefClass);\n\n case \"function\":\n next();\n if (is_for_body) {\n croak(\"functions are not allowed as the body of a loop\");\n }\n return function_(AST_Defun, false, false, is_export_default);\n\n case \"if\":\n next();\n return if_();\n\n case \"return\":\n if (S.in_function == 0 && !options.bare_returns)\n croak(\"'return' outside of function\");\n next();\n var value = null;\n if (is(\"punc\", \";\")) {\n next();\n } else if (!can_insert_semicolon()) {\n value = expression(true);\n semicolon();\n }\n return new AST_Return({\n value: value\n });\n\n case \"switch\":\n next();\n return new AST_Switch({\n expression : parenthesised(),\n body : in_loop(switch_body_)\n });\n\n case \"throw\":\n next();\n if (has_newline_before(S.token))\n croak(\"Illegal newline after 'throw'\");\n var value = expression(true);\n semicolon();\n return new AST_Throw({\n value: value\n });\n\n case \"try\":\n next();\n return try_();\n\n case \"var\":\n next();\n var node = var_();\n semicolon();\n return node;\n\n case \"let\":\n next();\n var node = let_();\n semicolon();\n return node;\n\n case \"const\":\n next();\n var node = const_();\n semicolon();\n return node;\n\n case \"with\":\n if (S.input.has_directive(\"use strict\")) {\n croak(\"Strict mode may not include a with statement\");\n }\n next();\n return new AST_With({\n expression : parenthesised(),\n body : statement()\n });\n\n case \"export\":\n if (!is_token(peek(), \"punc\", \"(\")) {\n next();\n var node = export_();\n if (is(\"punc\", \";\")) semicolon();\n return node;\n }\n }\n }\n unexpected();\n });\n\n function labeled_statement() {\n var label = as_symbol(AST_Label);\n if (label.name === \"await\" && is_in_async()) {\n token_error(S.prev, \"await cannot be used as label inside async function\");\n }\n if (find_if(function(l) { return l.name == label.name; }, S.labels)) {\n // ECMA-262, 12.12: An ECMAScript program is considered\n // syntactically incorrect if it contains a\n // LabelledStatement that is enclosed by a\n // LabelledStatement with the same Identifier as label.\n croak(\"Label \" + label.name + \" defined twice\");\n }\n expect(\":\");\n S.labels.push(label);\n var stat = statement();\n S.labels.pop();\n if (!(stat instanceof AST_IterationStatement)) {\n // check for `continue` that refers to this label.\n // those should be reported as syntax errors.\n // https://github.com/mishoo/UglifyJS2/issues/287\n label.references.forEach(function(ref) {\n if (ref instanceof AST_Continue) {\n ref = ref.label.start;\n croak(\"Continue label `\" + label.name + \"` refers to non-IterationStatement.\",\n ref.line, ref.col, ref.pos);\n }\n });\n }\n return new AST_LabeledStatement({ body: stat, label: label });\n }\n\n function simple_statement(tmp) {\n return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) });\n }\n\n function break_cont(type) {\n var label = null, ldef;\n if (!can_insert_semicolon()) {\n label = as_symbol(AST_LabelRef, true);\n }\n if (label != null) {\n ldef = find_if(function(l) { return l.name == label.name; }, S.labels);\n if (!ldef)\n croak(\"Undefined label \" + label.name);\n label.thedef = ldef;\n } else if (S.in_loop == 0)\n croak(type.TYPE + \" not inside a loop or switch\");\n semicolon();\n var stat = new type({ label: label });\n if (ldef) ldef.references.push(stat);\n return stat;\n }\n\n function for_() {\n var for_await_error = \"`for await` invalid in this context\";\n var await_tok = S.token;\n if (await_tok.type == \"name\" && await_tok.value == \"await\") {\n if (!is_in_async()) {\n token_error(await_tok, for_await_error);\n }\n next();\n } else {\n await_tok = false;\n }\n expect(\"(\");\n var init = null;\n if (!is(\"punc\", \";\")) {\n init =\n is(\"keyword\", \"var\") ? (next(), var_(true)) :\n is(\"keyword\", \"let\") ? (next(), let_(true)) :\n is(\"keyword\", \"const\") ? (next(), const_(true)) :\n expression(true, true);\n var is_in = is(\"operator\", \"in\");\n var is_of = is(\"name\", \"of\");\n if (await_tok && !is_of) {\n token_error(await_tok, for_await_error);\n }\n if (is_in || is_of) {\n if (init instanceof AST_Definitions) {\n if (init.definitions.length > 1)\n token_error(init.start, \"Only one variable declaration allowed in for..in loop\");\n } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) {\n token_error(init.start, \"Invalid left-hand side in for..in loop\");\n }\n next();\n if (is_in) {\n return for_in(init);\n } else {\n return for_of(init, !!await_tok);\n }\n }\n } else if (await_tok) {\n token_error(await_tok, for_await_error);\n }\n return regular_for(init);\n }\n\n function regular_for(init) {\n expect(\";\");\n var test = is(\"punc\", \";\") ? null : expression(true);\n expect(\";\");\n var step = is(\"punc\", \")\") ? null : expression(true);\n expect(\")\");\n return new AST_For({\n init : init,\n condition : test,\n step : step,\n body : in_loop(function() { return statement(false, true); })\n });\n }\n\n function for_of(init, is_await) {\n var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null;\n var obj = expression(true);\n expect(\")\");\n return new AST_ForOf({\n await : is_await,\n init : init,\n name : lhs,\n object : obj,\n body : in_loop(function() { return statement(false, true); })\n });\n }\n\n function for_in(init) {\n var obj = expression(true);\n expect(\")\");\n return new AST_ForIn({\n init : init,\n object : obj,\n body : in_loop(function() { return statement(false, true); })\n });\n }\n\n var arrow_function = function(start, argnames, is_async) {\n if (has_newline_before(S.token)) {\n croak(\"Unexpected newline before arrow (=>)\");\n }\n\n expect_token(\"arrow\", \"=>\");\n\n var body = _function_body(is(\"punc\", \"{\"), false, is_async);\n\n var end =\n body instanceof Array && body.length ? body[body.length - 1].end :\n body instanceof Array ? start :\n body.end;\n\n return new AST_Arrow({\n start : start,\n end : end,\n async : is_async,\n argnames : argnames,\n body : body\n });\n };\n\n var function_ = function(ctor, is_generator_property, is_async, is_export_default) {\n var start = S.token;\n\n var in_statement = ctor === AST_Defun;\n var is_generator = is(\"operator\", \"*\");\n if (is_generator) {\n next();\n }\n\n var name = is(\"name\") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null;\n if (in_statement && !name) {\n if (is_export_default) {\n ctor = AST_Function;\n } else {\n unexpected();\n }\n }\n\n if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration))\n unexpected(prev());\n\n var args = [];\n var body = _function_body(true, is_generator || is_generator_property, is_async, name, args);\n return new ctor({\n start : args.start,\n end : body.end,\n is_generator: is_generator,\n async : is_async,\n name : name,\n argnames: args,\n body : body\n });\n };\n\n function track_used_binding_identifiers(is_parameter, strict) {\n var parameters = {};\n var duplicate = false;\n var default_assignment = false;\n var spread = false;\n var strict_mode = !!strict;\n var tracker = {\n add_parameter: function(token) {\n if (parameters[\"$\" + token.value] !== undefined) {\n if (duplicate === false) {\n duplicate = token;\n }\n tracker.check_strict();\n } else {\n parameters[\"$\" + token.value] = true;\n if (is_parameter) {\n switch (token.value) {\n case \"arguments\":\n case \"eval\":\n case \"yield\":\n if (strict_mode) {\n token_error(token, \"Unexpected \" + token.value + \" identifier as parameter inside strict mode\");\n }\n break;\n default:\n if (RESERVED_WORDS(token.value)) {\n unexpected();\n }\n }\n }\n }\n },\n mark_default_assignment: function(token) {\n if (default_assignment === false) {\n default_assignment = token;\n }\n },\n mark_spread: function(token) {\n if (spread === false) {\n spread = token;\n }\n },\n mark_strict_mode: function() {\n strict_mode = true;\n },\n is_strict: function() {\n return default_assignment !== false || spread !== false || strict_mode;\n },\n check_strict: function() {\n if (tracker.is_strict() && duplicate !== false) {\n token_error(duplicate, \"Parameter \" + duplicate.value + \" was used already\");\n }\n }\n };\n\n return tracker;\n }\n\n function parameters(params) {\n var start = S.token;\n var used_parameters = track_used_binding_identifiers(true, S.input.has_directive(\"use strict\"));\n\n expect(\"(\");\n\n while (!is(\"punc\", \")\")) {\n var param = parameter(used_parameters);\n params.push(param);\n\n if (!is(\"punc\", \")\")) {\n expect(\",\");\n if (is(\"punc\", \")\") && options.ecma < 8) unexpected();\n }\n\n if (param instanceof AST_Expansion) {\n break;\n }\n }\n\n next();\n }\n\n function parameter(used_parameters, symbol_type) {\n var param;\n var expand = false;\n if (used_parameters === undefined) {\n used_parameters = track_used_binding_identifiers(true, S.input.has_directive(\"use strict\"));\n }\n if (is(\"expand\", \"...\")) {\n expand = S.token;\n used_parameters.mark_spread(S.token);\n next();\n }\n param = binding_element(used_parameters, symbol_type);\n\n if (is(\"operator\", \"=\") && expand === false) {\n used_parameters.mark_default_assignment(S.token);\n next();\n param = new AST_DefaultAssign({\n start: param.start,\n left: param,\n operator: \"=\",\n right: expression(false),\n end: S.token\n });\n }\n\n if (expand !== false) {\n if (!is(\"punc\", \")\")) {\n unexpected();\n }\n param = new AST_Expansion({\n start: expand,\n expression: param,\n end: expand\n });\n }\n used_parameters.check_strict();\n\n return param;\n }\n\n function binding_element(used_parameters, symbol_type) {\n var elements = [];\n var first = true;\n var is_expand = false;\n var expand_token;\n var first_token = S.token;\n if (used_parameters === undefined) {\n used_parameters = track_used_binding_identifiers(false, S.input.has_directive(\"use strict\"));\n }\n symbol_type = symbol_type === undefined ? AST_SymbolFunarg : symbol_type;\n if (is(\"punc\", \"[\")) {\n next();\n while (!is(\"punc\", \"]\")) {\n if (first) {\n first = false;\n } else {\n expect(\",\");\n }\n\n if (is(\"expand\", \"...\")) {\n is_expand = true;\n expand_token = S.token;\n used_parameters.mark_spread(S.token);\n next();\n }\n if (is(\"punc\")) {\n switch (S.token.value) {\n case \",\":\n elements.push(new AST_Hole({\n start: S.token,\n end: S.token\n }));\n continue;\n case \"]\": // Trailing comma after last element\n break;\n case \"[\":\n case \"{\":\n elements.push(binding_element(used_parameters, symbol_type));\n break;\n default:\n unexpected();\n }\n } else if (is(\"name\")) {\n used_parameters.add_parameter(S.token);\n elements.push(as_symbol(symbol_type));\n } else {\n croak(\"Invalid function parameter\");\n }\n if (is(\"operator\", \"=\") && is_expand === false) {\n used_parameters.mark_default_assignment(S.token);\n next();\n elements[elements.length - 1] = new AST_DefaultAssign({\n start: elements[elements.length - 1].start,\n left: elements[elements.length - 1],\n operator: \"=\",\n right: expression(false),\n end: S.token\n });\n }\n if (is_expand) {\n if (!is(\"punc\", \"]\")) {\n croak(\"Rest element must be last element\");\n }\n elements[elements.length - 1] = new AST_Expansion({\n start: expand_token,\n expression: elements[elements.length - 1],\n end: expand_token\n });\n }\n }\n expect(\"]\");\n used_parameters.check_strict();\n return new AST_Destructuring({\n start: first_token,\n names: elements,\n is_array: true,\n end: prev()\n });\n } else if (is(\"punc\", \"{\")) {\n next();\n while (!is(\"punc\", \"}\")) {\n if (first) {\n first = false;\n } else {\n expect(\",\");\n }\n if (is(\"expand\", \"...\")) {\n is_expand = true;\n expand_token = S.token;\n used_parameters.mark_spread(S.token);\n next();\n }\n if (is(\"name\") && (is_token(peek(), \"punc\") || is_token(peek(), \"operator\")) && [\",\", \"}\", \"=\"].indexOf(peek().value) !== -1) {\n used_parameters.add_parameter(S.token);\n var start = prev();\n var value = as_symbol(symbol_type);\n if (is_expand) {\n elements.push(new AST_Expansion({\n start: expand_token,\n expression: value,\n end: value.end,\n }));\n } else {\n elements.push(new AST_ObjectKeyVal({\n start: start,\n key: value.name,\n value: value,\n end: value.end,\n }));\n }\n } else if (is(\"punc\", \"}\")) {\n continue; // Allow trailing hole\n } else {\n var property_token = S.token;\n var property = as_property_name();\n if (property === null) {\n unexpected(prev());\n } else if (prev().type === \"name\" && !is(\"punc\", \":\")) {\n elements.push(new AST_ObjectKeyVal({\n start: prev(),\n key: property,\n value: new symbol_type({\n start: prev(),\n name: property,\n end: prev()\n }),\n end: prev()\n }));\n } else {\n expect(\":\");\n elements.push(new AST_ObjectKeyVal({\n start: property_token,\n quote: property_token.quote,\n key: property,\n value: binding_element(used_parameters, symbol_type),\n end: prev()\n }));\n }\n }\n if (is_expand) {\n if (!is(\"punc\", \"}\")) {\n croak(\"Rest element must be last element\");\n }\n } else if (is(\"operator\", \"=\")) {\n used_parameters.mark_default_assignment(S.token);\n next();\n elements[elements.length - 1].value = new AST_DefaultAssign({\n start: elements[elements.length - 1].value.start,\n left: elements[elements.length - 1].value,\n operator: \"=\",\n right: expression(false),\n end: S.token\n });\n }\n }\n expect(\"}\");\n used_parameters.check_strict();\n return new AST_Destructuring({\n start: first_token,\n names: elements,\n is_array: false,\n end: prev()\n });\n } else if (is(\"name\")) {\n used_parameters.add_parameter(S.token);\n return as_symbol(symbol_type);\n } else {\n croak(\"Invalid function parameter\");\n }\n }\n\n function params_or_seq_(allow_arrows, maybe_sequence) {\n var spread_token;\n var invalid_sequence;\n var trailing_comma;\n var a = [];\n expect(\"(\");\n while (!is(\"punc\", \")\")) {\n if (spread_token) unexpected(spread_token);\n if (is(\"expand\", \"...\")) {\n spread_token = S.token;\n if (maybe_sequence) invalid_sequence = S.token;\n next();\n a.push(new AST_Expansion({\n start: prev(),\n expression: expression(),\n end: S.token,\n }));\n } else {\n a.push(expression());\n }\n if (!is(\"punc\", \")\")) {\n expect(\",\");\n if (is(\"punc\", \")\")) {\n if (options.ecma < 8) unexpected();\n trailing_comma = prev();\n if (maybe_sequence) invalid_sequence = trailing_comma;\n }\n }\n }\n expect(\")\");\n if (allow_arrows && is(\"arrow\", \"=>\")) {\n if (spread_token && trailing_comma) unexpected(trailing_comma);\n } else if (invalid_sequence) {\n unexpected(invalid_sequence);\n }\n return a;\n }\n\n function _function_body(block, generator, is_async, name, args) {\n var loop = S.in_loop;\n var labels = S.labels;\n var current_generator = S.in_generator;\n var current_async = S.in_async;\n ++S.in_function;\n if (generator)\n S.in_generator = S.in_function;\n if (is_async)\n S.in_async = S.in_function;\n if (args) parameters(args);\n if (block)\n S.in_directives = true;\n S.in_loop = 0;\n S.labels = [];\n if (block) {\n S.input.push_directives_stack();\n var a = block_();\n if (name) _verify_symbol(name);\n if (args) args.forEach(_verify_symbol);\n S.input.pop_directives_stack();\n } else {\n var a = expression(false);\n }\n --S.in_function;\n S.in_loop = loop;\n S.labels = labels;\n S.in_generator = current_generator;\n S.in_async = current_async;\n return a;\n }\n\n function _await_expression() {\n // Previous token must be \"await\" and not be interpreted as an identifier\n if (!is_in_async()) {\n croak(\"Unexpected await expression outside async function\",\n S.prev.line, S.prev.col, S.prev.pos);\n }\n // the await expression is parsed as a unary expression in Babel\n return new AST_Await({\n start: prev(),\n end: S.token,\n expression : maybe_unary(true),\n });\n }\n\n function _yield_expression() {\n // Previous token must be keyword yield and not be interpret as an identifier\n if (!is_in_generator()) {\n croak(\"Unexpected yield expression outside generator function\",\n S.prev.line, S.prev.col, S.prev.pos);\n }\n var start = S.token;\n var star = false;\n var has_expression = true;\n\n // Attempt to get expression or star (and then the mandatory expression)\n // behind yield on the same line.\n //\n // If nothing follows on the same line of the yieldExpression,\n // it should default to the value `undefined` for yield to return.\n // In that case, the `undefined` stored as `null` in ast.\n //\n // Note 1: It isn't allowed for yield* to close without an expression\n // Note 2: If there is a nlb between yield and star, it is interpret as\n // yield *\n if (can_insert_semicolon() ||\n (is(\"punc\") && PUNC_AFTER_EXPRESSION(S.token.value))) {\n has_expression = false;\n\n } else if (is(\"operator\", \"*\")) {\n star = true;\n next();\n }\n\n return new AST_Yield({\n start : start,\n is_star : star,\n expression : has_expression ? expression() : null,\n end : prev()\n });\n }\n\n function if_() {\n var cond = parenthesised(), body = statement(false, false, true), belse = null;\n if (is(\"keyword\", \"else\")) {\n next();\n belse = statement(false, false, true);\n }\n return new AST_If({\n condition : cond,\n body : body,\n alternative : belse\n });\n }\n\n function block_() {\n expect(\"{\");\n var a = [];\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n a.push(statement());\n }\n next();\n return a;\n }\n\n function switch_body_() {\n expect(\"{\");\n var a = [], cur = null, branch = null, tmp;\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n if (is(\"keyword\", \"case\")) {\n if (branch) branch.end = prev();\n cur = [];\n branch = new AST_Case({\n start : (tmp = S.token, next(), tmp),\n expression : expression(true),\n body : cur\n });\n a.push(branch);\n expect(\":\");\n } else if (is(\"keyword\", \"default\")) {\n if (branch) branch.end = prev();\n cur = [];\n branch = new AST_Default({\n start : (tmp = S.token, next(), expect(\":\"), tmp),\n body : cur\n });\n a.push(branch);\n } else {\n if (!cur) unexpected();\n cur.push(statement());\n }\n }\n if (branch) branch.end = prev();\n next();\n return a;\n }\n\n function try_() {\n var body = block_(), bcatch = null, bfinally = null;\n if (is(\"keyword\", \"catch\")) {\n var start = S.token;\n next();\n if (is(\"punc\", \"{\")) {\n var name = null;\n } else {\n expect(\"(\");\n var name = parameter(undefined, AST_SymbolCatch);\n expect(\")\");\n }\n bcatch = new AST_Catch({\n start : start,\n argname : name,\n body : block_(),\n end : prev()\n });\n }\n if (is(\"keyword\", \"finally\")) {\n var start = S.token;\n next();\n bfinally = new AST_Finally({\n start : start,\n body : block_(),\n end : prev()\n });\n }\n if (!bcatch && !bfinally)\n croak(\"Missing catch/finally blocks\");\n return new AST_Try({\n body : body,\n bcatch : bcatch,\n bfinally : bfinally\n });\n }\n\n function vardefs(no_in, kind) {\n var a = [];\n var def;\n for (;;) {\n var sym_type =\n kind === \"var\" ? AST_SymbolVar :\n kind === \"const\" ? AST_SymbolConst :\n kind === \"let\" ? AST_SymbolLet : null;\n if (is(\"punc\", \"{\") || is(\"punc\", \"[\")) {\n def = new AST_VarDef({\n start: S.token,\n name: binding_element(undefined ,sym_type),\n value: is(\"operator\", \"=\") ? (expect_token(\"operator\", \"=\"), expression(false, no_in)) : null,\n end: prev()\n });\n } else {\n def = new AST_VarDef({\n start : S.token,\n name : as_symbol(sym_type),\n value : is(\"operator\", \"=\")\n ? (next(), expression(false, no_in))\n : !no_in && kind === \"const\"\n ? croak(\"Missing initializer in const declaration\") : null,\n end : prev()\n });\n if (def.name.name == \"import\") croak(\"Unexpected token: import\");\n }\n a.push(def);\n if (!is(\"punc\", \",\"))\n break;\n next();\n }\n return a;\n }\n\n var var_ = function(no_in) {\n return new AST_Var({\n start : prev(),\n definitions : vardefs(no_in, \"var\"),\n end : prev()\n });\n };\n\n var let_ = function(no_in) {\n return new AST_Let({\n start : prev(),\n definitions : vardefs(no_in, \"let\"),\n end : prev()\n });\n };\n\n var const_ = function(no_in) {\n return new AST_Const({\n start : prev(),\n definitions : vardefs(no_in, \"const\"),\n end : prev()\n });\n };\n\n var new_ = function(allow_calls) {\n var start = S.token;\n expect_token(\"operator\", \"new\");\n if (is(\"punc\", \".\")) {\n next();\n expect_token(\"name\", \"target\");\n return subscripts(new AST_NewTarget({\n start : start,\n end : prev()\n }), allow_calls);\n }\n var newexp = expr_atom(false), args;\n if (is(\"punc\", \"(\")) {\n next();\n args = expr_list(\")\", options.ecma >= 8);\n } else {\n args = [];\n }\n var call = new AST_New({\n start : start,\n expression : newexp,\n args : args,\n end : prev()\n });\n mark_pure(call);\n return subscripts(call, allow_calls);\n };\n\n function as_atom_node() {\n var tok = S.token, ret;\n switch (tok.type) {\n case \"name\":\n ret = _make_symbol(AST_SymbolRef);\n break;\n case \"num\":\n ret = new AST_Number({ start: tok, end: tok, value: tok.value });\n break;\n case \"string\":\n ret = new AST_String({\n start : tok,\n end : tok,\n value : tok.value,\n quote : tok.quote\n });\n break;\n case \"regexp\":\n ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });\n break;\n case \"atom\":\n switch (tok.value) {\n case \"false\":\n ret = new AST_False({ start: tok, end: tok });\n break;\n case \"true\":\n ret = new AST_True({ start: tok, end: tok });\n break;\n case \"null\":\n ret = new AST_Null({ start: tok, end: tok });\n break;\n }\n break;\n }\n next();\n return ret;\n }\n\n function to_fun_args(ex, _, __, default_seen_above) {\n var insert_default = function(ex, default_value) {\n if (default_value) {\n return new AST_DefaultAssign({\n start: ex.start,\n left: ex,\n operator: \"=\",\n right: default_value,\n end: default_value.end\n });\n }\n return ex;\n };\n if (ex instanceof AST_Object) {\n return insert_default(new AST_Destructuring({\n start: ex.start,\n end: ex.end,\n is_array: false,\n names: ex.properties.map(to_fun_args)\n }), default_seen_above);\n } else if (ex instanceof AST_ObjectKeyVal) {\n ex.value = to_fun_args(ex.value, 0, [ex.key]);\n return insert_default(ex, default_seen_above);\n } else if (ex instanceof AST_Hole) {\n return ex;\n } else if (ex instanceof AST_Destructuring) {\n ex.names = ex.names.map(to_fun_args);\n return insert_default(ex, default_seen_above);\n } else if (ex instanceof AST_SymbolRef) {\n return insert_default(new AST_SymbolFunarg({\n name: ex.name,\n start: ex.start,\n end: ex.end\n }), default_seen_above);\n } else if (ex instanceof AST_Expansion) {\n ex.expression = to_fun_args(ex.expression);\n return insert_default(ex, default_seen_above);\n } else if (ex instanceof AST_Array) {\n return insert_default(new AST_Destructuring({\n start: ex.start,\n end: ex.end,\n is_array: true,\n names: ex.elements.map(to_fun_args)\n }), default_seen_above);\n } else if (ex instanceof AST_Assign) {\n return insert_default(to_fun_args(ex.left, undefined, undefined, ex.right), default_seen_above);\n } else if (ex instanceof AST_DefaultAssign) {\n ex.left = to_fun_args(ex.left, 0, [ex.left]);\n return ex;\n } else {\n croak(\"Invalid function parameter\", ex.start.line, ex.start.col);\n }\n }\n\n var expr_atom = function(allow_calls, allow_arrows) {\n if (is(\"operator\", \"new\")) {\n return new_(allow_calls);\n }\n var start = S.token;\n var peeked;\n var async = is(\"name\", \"async\")\n && (peeked = peek()).value != \"[\"\n && peeked.type != \"arrow\"\n && as_atom_node();\n if (is(\"punc\")) {\n switch (S.token.value) {\n case \"(\":\n if (async && !allow_calls) break;\n var exprs = params_or_seq_(allow_arrows, !async);\n if (allow_arrows && is(\"arrow\", \"=>\")) {\n return arrow_function(start, exprs.map(to_fun_args), !!async);\n }\n var ex = async ? new AST_Call({\n expression: async,\n args: exprs\n }) : exprs.length == 1 ? exprs[0] : new AST_Sequence({\n expressions: exprs\n });\n if (ex.start) {\n var len = start.comments_before.length;\n [].unshift.apply(ex.start.comments_before, start.comments_before);\n start.comments_before = ex.start.comments_before;\n start.comments_before_length = len;\n if (len == 0 && start.comments_before.length > 0) {\n var comment = start.comments_before[0];\n if (!comment.nlb) {\n comment.nlb = start.nlb;\n start.nlb = false;\n }\n }\n start.comments_after = ex.start.comments_after;\n }\n ex.start = start;\n var end = prev();\n if (ex.end) {\n end.comments_before = ex.end.comments_before;\n [].push.apply(ex.end.comments_after, end.comments_after);\n end.comments_after = ex.end.comments_after;\n }\n ex.end = end;\n if (ex instanceof AST_Call) mark_pure(ex);\n return subscripts(ex, allow_calls);\n case \"[\":\n return subscripts(array_(), allow_calls);\n case \"{\":\n return subscripts(object_or_destructuring_(), allow_calls);\n }\n if (!async) unexpected();\n }\n if (allow_arrows && is(\"name\") && is_token(peek(), \"arrow\")) {\n var param = new AST_SymbolFunarg({\n name: S.token.value,\n start: start,\n end: start,\n });\n next();\n return arrow_function(start, [param], !!async);\n }\n if (is(\"keyword\", \"function\")) {\n next();\n var func = function_(AST_Function, false, !!async);\n func.start = start;\n func.end = prev();\n return subscripts(func, allow_calls);\n }\n if (async) return subscripts(async, allow_calls);\n if (is(\"keyword\", \"class\")) {\n next();\n var cls = class_(AST_ClassExpression);\n cls.start = start;\n cls.end = prev();\n return subscripts(cls, allow_calls);\n }\n if (is(\"template_head\")) {\n return subscripts(template_string(false), allow_calls);\n }\n if (ATOMIC_START_TOKEN(S.token.type)) {\n return subscripts(as_atom_node(), allow_calls);\n }\n unexpected();\n };\n\n function template_string(tagged) {\n var segments = [], start = S.token;\n\n segments.push(new AST_TemplateSegment({\n start: S.token,\n raw: S.token.raw,\n value: S.token.value,\n end: S.token\n }));\n while (S.token.end === false) {\n next();\n handle_regexp();\n segments.push(expression(true));\n\n if (!is_token(\"template_substitution\")) {\n unexpected();\n }\n\n segments.push(new AST_TemplateSegment({\n start: S.token,\n raw: S.token.raw,\n value: S.token.value,\n end: S.token\n }));\n }\n next();\n\n return new AST_TemplateString({\n start: start,\n segments: segments,\n end: S.token\n });\n }\n\n function expr_list(closing, allow_trailing_comma, allow_empty) {\n var first = true, a = [];\n while (!is(\"punc\", closing)) {\n if (first) first = false; else expect(\",\");\n if (allow_trailing_comma && is(\"punc\", closing)) break;\n if (is(\"punc\", \",\") && allow_empty) {\n a.push(new AST_Hole({ start: S.token, end: S.token }));\n } else if (is(\"expand\", \"...\")) {\n next();\n a.push(new AST_Expansion({start: prev(), expression: expression(),end: S.token}));\n } else {\n a.push(expression(false));\n }\n }\n next();\n return a;\n }\n\n var array_ = embed_tokens(function() {\n expect(\"[\");\n return new AST_Array({\n elements: expr_list(\"]\", !options.strict, true)\n });\n });\n\n var create_accessor = embed_tokens(function(is_generator, is_async) {\n return function_(AST_Accessor, is_generator, is_async);\n });\n\n var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() {\n var start = S.token, first = true, a = [];\n expect(\"{\");\n while (!is(\"punc\", \"}\")) {\n if (first) first = false; else expect(\",\");\n if (!options.strict && is(\"punc\", \"}\"))\n // allow trailing comma\n break;\n\n start = S.token;\n if (start.type == \"expand\") {\n next();\n a.push(new AST_Expansion({\n start: start,\n expression: expression(false),\n end: prev(),\n }));\n continue;\n }\n\n var name = as_property_name();\n var value;\n\n // Check property and fetch value\n if (!is(\"punc\", \":\")) {\n var concise = concise_method_or_getset(name, start);\n if (concise) {\n a.push(concise);\n continue;\n }\n\n value = new AST_SymbolRef({\n start: prev(),\n name: name,\n end: prev()\n });\n } else if (name === null) {\n unexpected(prev());\n } else {\n next(); // `:` - see first condition\n value = expression(false);\n }\n\n // Check for default value and alter value accordingly if necessary\n if (is(\"operator\", \"=\")) {\n next();\n value = new AST_Assign({\n start: start,\n left: value,\n operator: \"=\",\n right: expression(false),\n end: prev()\n });\n }\n\n // Create property\n a.push(new AST_ObjectKeyVal({\n start: start,\n quote: start.quote,\n key: name instanceof AST_Node ? name : \"\" + name,\n value: value,\n end: prev()\n }));\n }\n next();\n return new AST_Object({ properties: a });\n });\n\n function class_(KindOfClass) {\n var start, method, class_name, extends_, a = [];\n\n S.input.push_directives_stack(); // Push directive stack, but not scope stack\n S.input.add_directive(\"use strict\");\n\n if (S.token.type == \"name\" && S.token.value != \"extends\") {\n class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass);\n }\n\n if (KindOfClass === AST_DefClass && !class_name) {\n unexpected();\n }\n\n if (S.token.value == \"extends\") {\n next();\n extends_ = expression(true);\n }\n\n expect(\"{\");\n\n if (is(\"punc\", \";\")) { next(); } // Leading semicolons are okay in class bodies.\n while (!is(\"punc\", \"}\")) {\n start = S.token;\n method = concise_method_or_getset(as_property_name(), start, true);\n if (!method) { unexpected(); }\n a.push(method);\n if (is(\"punc\", \";\")) { next(); }\n }\n\n S.input.pop_directives_stack();\n\n next();\n\n return new KindOfClass({\n start: start,\n name: class_name,\n extends: extends_,\n properties: a,\n end: prev(),\n });\n }\n\n function concise_method_or_getset(name, start, is_class) {\n var get_ast = function(name, token) {\n if (typeof name === \"string\" || typeof name === \"number\") {\n return new AST_SymbolMethod({\n start: token,\n name: \"\" + name,\n end: prev()\n });\n } else if (name === null) {\n unexpected();\n }\n return name;\n };\n var is_async = false;\n var is_static = false;\n var is_generator = false;\n var property_token = start;\n if (is_class && name === \"static\" && !is(\"punc\", \"(\")) {\n is_static = true;\n property_token = S.token;\n name = as_property_name();\n }\n if (name === \"async\" && !is(\"punc\", \"(\") && !is(\"punc\", \",\") && !is(\"punc\", \"}\")) {\n is_async = true;\n property_token = S.token;\n name = as_property_name();\n }\n if (name === null) {\n is_generator = true;\n property_token = S.token;\n name = as_property_name();\n if (name === null) {\n unexpected();\n }\n }\n if (is(\"punc\", \"(\")) {\n name = get_ast(name, start);\n var node = new AST_ConciseMethod({\n start : start,\n static : is_static,\n is_generator: is_generator,\n async : is_async,\n key : name,\n quote : name instanceof AST_SymbolMethod ?\n property_token.quote : undefined,\n value : create_accessor(is_generator, is_async),\n end : prev()\n });\n return node;\n }\n property_token = S.token;\n if (name == \"get\") {\n if (!is(\"punc\") || is(\"punc\", \"[\")) {\n name = get_ast(as_property_name(), start);\n return new AST_ObjectGetter({\n start : start,\n static: is_static,\n key : name,\n quote : name instanceof AST_SymbolMethod ?\n property_token.quote : undefined,\n value : create_accessor(),\n end : prev()\n });\n }\n } else if (name == \"set\") {\n if (!is(\"punc\") || is(\"punc\", \"[\")) {\n name = get_ast(as_property_name(), start);\n return new AST_ObjectSetter({\n start : start,\n static: is_static,\n key : name,\n quote : name instanceof AST_SymbolMethod ?\n property_token.quote : undefined,\n value : create_accessor(),\n end : prev()\n });\n }\n }\n }\n\n function import_() {\n var start = prev();\n var imported_name;\n var imported_names;\n if (is(\"name\")) {\n imported_name = as_symbol(AST_SymbolImport);\n }\n\n if (is(\"punc\", \",\")) {\n next();\n }\n\n imported_names = map_names(true);\n\n if (imported_names || imported_name) {\n expect_token(\"name\", \"from\");\n }\n var mod_str = S.token;\n if (mod_str.type !== \"string\") {\n unexpected();\n }\n next();\n return new AST_Import({\n start: start,\n imported_name: imported_name,\n imported_names: imported_names,\n module_name: new AST_String({\n start: mod_str,\n value: mod_str.value,\n quote: mod_str.quote,\n end: mod_str,\n }),\n end: S.token,\n });\n }\n\n function map_name(is_import) {\n function make_symbol(type) {\n return new type({\n name: as_property_name(),\n start: prev(),\n end: prev()\n });\n }\n\n var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign;\n var type = is_import ? AST_SymbolImport : AST_SymbolExport;\n var start = S.token;\n var foreign_name;\n var name;\n\n if (is_import) {\n foreign_name = make_symbol(foreign_type);\n } else {\n name = make_symbol(type);\n }\n if (is(\"name\", \"as\")) {\n next(); // The \"as\" word\n if (is_import) {\n name = make_symbol(type);\n } else {\n foreign_name = make_symbol(foreign_type);\n }\n } else if (is_import) {\n name = new type(foreign_name);\n } else {\n foreign_name = new foreign_type(name);\n }\n\n return new AST_NameMapping({\n start: start,\n foreign_name: foreign_name,\n name: name,\n end: prev(),\n });\n }\n\n function map_nameAsterisk(is_import, name) {\n var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign;\n var type = is_import ? AST_SymbolImport : AST_SymbolExport;\n var start = S.token;\n var foreign_name;\n var end = prev();\n\n name = name || new type({\n name: \"*\",\n start: start,\n end: end,\n });\n\n foreign_name = new foreign_type({\n name: \"*\",\n start: start,\n end: end,\n });\n\n return new AST_NameMapping({\n start: start,\n foreign_name: foreign_name,\n name: name,\n end: end,\n });\n }\n\n function map_names(is_import) {\n var names;\n if (is(\"punc\", \"{\")) {\n next();\n names = [];\n while (!is(\"punc\", \"}\")) {\n names.push(map_name(is_import));\n if (is(\"punc\", \",\")) {\n next();\n }\n }\n next();\n } else if (is(\"operator\", \"*\")) {\n var name;\n next();\n if (is_import && is(\"name\", \"as\")) {\n next(); // The \"as\" word\n name = as_symbol(is_import ? AST_SymbolImport : AST_SymbolExportForeign);\n }\n names = [map_nameAsterisk(is_import, name)];\n }\n return names;\n }\n\n function export_() {\n var start = S.token;\n var is_default;\n var exported_names;\n\n if (is(\"keyword\", \"default\")) {\n is_default = true;\n next();\n } else if (exported_names = map_names(false)) {\n if (is(\"name\", \"from\")) {\n next();\n\n var mod_str = S.token;\n if (mod_str.type !== \"string\") {\n unexpected();\n }\n next();\n\n return new AST_Export({\n start: start,\n is_default: is_default,\n exported_names: exported_names,\n module_name: new AST_String({\n start: mod_str,\n value: mod_str.value,\n quote: mod_str.quote,\n end: mod_str,\n }),\n end: prev(),\n });\n } else {\n return new AST_Export({\n start: start,\n is_default: is_default,\n exported_names: exported_names,\n end: prev(),\n });\n }\n }\n\n var node;\n var exported_value;\n var exported_definition;\n if (is(\"punc\", \"{\")\n || is_default\n && (is(\"keyword\", \"class\") || is(\"keyword\", \"function\"))\n && is_token(peek(), \"punc\")) {\n exported_value = expression(false);\n semicolon();\n } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) {\n unexpected(node.start);\n } else if (node instanceof AST_Definitions || node instanceof AST_Lambda || node instanceof AST_DefClass) {\n exported_definition = node;\n } else if (node instanceof AST_SimpleStatement) {\n exported_value = node.body;\n } else {\n unexpected(node.start);\n }\n\n return new AST_Export({\n start: start,\n is_default: is_default,\n exported_value: exported_value,\n exported_definition: exported_definition,\n end: prev(),\n });\n }\n\n function as_property_name() {\n var tmp = S.token;\n switch (tmp.type) {\n case \"punc\":\n if (tmp.value === \"[\") {\n next();\n var ex = expression(false);\n expect(\"]\");\n return ex;\n } else unexpected(tmp);\n case \"operator\":\n if (tmp.value === \"*\") {\n next();\n return null;\n }\n if ([\"delete\", \"in\", \"instanceof\", \"new\", \"typeof\", \"void\"].indexOf(tmp.value) === -1) {\n unexpected(tmp);\n }\n case \"name\":\n if (tmp.value == \"yield\") {\n if (is_in_generator()) {\n token_error(tmp, \"Yield cannot be used as identifier inside generators\");\n } else if (!is_token(peek(), \"punc\", \":\")\n && !is_token(peek(), \"punc\", \"(\")\n && S.input.has_directive(\"use strict\")) {\n token_error(tmp, \"Unexpected yield identifier inside strict mode\");\n }\n }\n case \"string\":\n case \"num\":\n case \"keyword\":\n case \"atom\":\n next();\n return tmp.value;\n default:\n unexpected(tmp);\n }\n }\n\n function as_name() {\n var tmp = S.token;\n if (tmp.type != \"name\") unexpected();\n next();\n return tmp.value;\n }\n\n function _make_symbol(type) {\n var name = S.token.value;\n return new (name == \"this\" ? AST_This :\n name == \"super\" ? AST_Super :\n type)({\n name : String(name),\n start : S.token,\n end : S.token\n });\n }\n\n function _verify_symbol(sym) {\n var name = sym.name;\n if (is_in_generator() && name == \"yield\") {\n token_error(sym.start, \"Yield cannot be used as identifier inside generators\");\n }\n if (S.input.has_directive(\"use strict\")) {\n if (name == \"yield\") {\n token_error(sym.start, \"Unexpected yield identifier inside strict mode\");\n }\n if (sym instanceof AST_SymbolDeclaration && (name == \"arguments\" || name == \"eval\")) {\n token_error(sym.start, \"Unexpected \" + name + \" in strict mode\");\n }\n }\n }\n\n function as_symbol(type, noerror) {\n if (!is(\"name\")) {\n if (!noerror) croak(\"Name expected\");\n return null;\n }\n var sym = _make_symbol(type);\n _verify_symbol(sym);\n next();\n return sym;\n }\n\n function mark_pure(call) {\n var start = call.start;\n var comments = start.comments_before;\n var i = HOP(start, \"comments_before_length\") ? start.comments_before_length : comments.length;\n while (--i >= 0) {\n var comment = comments[i];\n if (/[@#]__PURE__/.test(comment.value)) {\n call.pure = comment;\n break;\n }\n }\n }\n\n var subscripts = function(expr, allow_calls) {\n var start = expr.start;\n if (is(\"punc\", \".\")) {\n next();\n return subscripts(new AST_Dot({\n start : start,\n expression : expr,\n property : as_name(),\n end : prev()\n }), allow_calls);\n }\n if (is(\"punc\", \"[\")) {\n next();\n var prop = expression(true);\n expect(\"]\");\n return subscripts(new AST_Sub({\n start : start,\n expression : expr,\n property : prop,\n end : prev()\n }), allow_calls);\n }\n if (allow_calls && is(\"punc\", \"(\")) {\n next();\n var call = new AST_Call({\n start : start,\n expression : expr,\n args : call_args(),\n end : prev()\n });\n mark_pure(call);\n return subscripts(call, true);\n }\n if (is(\"template_head\")) {\n return subscripts(new AST_PrefixedTemplateString({\n start: start,\n prefix: expr,\n template_string: template_string(true),\n end: prev()\n }), allow_calls);\n }\n return expr;\n };\n\n var call_args = embed_tokens(function _call_args() {\n var args = [];\n while (!is(\"punc\", \")\")) {\n if (is(\"expand\", \"...\")) {\n next();\n args.push(new AST_Expansion({\n start: prev(),\n expression: expression(false),\n end: prev()\n }));\n } else {\n args.push(expression(false));\n }\n if (!is(\"punc\", \")\")) {\n expect(\",\");\n if (is(\"punc\", \")\") && options.ecma < 8) unexpected();\n }\n }\n next();\n return args;\n });\n\n var maybe_unary = function(allow_calls, allow_arrows) {\n var start = S.token;\n if (start.type == \"name\" && start.value == \"await\") {\n if (is_in_async()) {\n next();\n return _await_expression();\n } else if (S.input.has_directive(\"use strict\")) {\n token_error(S.token, \"Unexpected await identifier inside strict mode\");\n }\n }\n if (is(\"operator\") && UNARY_PREFIX(start.value)) {\n next();\n handle_regexp();\n var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls));\n ex.start = start;\n ex.end = prev();\n return ex;\n }\n var val = expr_atom(allow_calls, allow_arrows);\n while (is(\"operator\") && UNARY_POSTFIX(S.token.value) && !has_newline_before(S.token)) {\n if (val instanceof AST_Arrow) unexpected();\n val = make_unary(AST_UnaryPostfix, S.token, val);\n val.start = start;\n val.end = S.token;\n next();\n }\n return val;\n };\n\n function make_unary(ctor, token, expr) {\n var op = token.value;\n switch (op) {\n case \"++\":\n case \"--\":\n if (!is_assignable(expr))\n croak(\"Invalid use of \" + op + \" operator\", token.line, token.col, token.pos);\n break;\n case \"delete\":\n if (expr instanceof AST_SymbolRef && S.input.has_directive(\"use strict\"))\n croak(\"Calling delete on expression not allowed in strict mode\", expr.start.line, expr.start.col, expr.start.pos);\n break;\n }\n return new ctor({ operator: op, expression: expr });\n }\n\n var expr_op = function(left, min_prec, no_in) {\n var op = is(\"operator\") ? S.token.value : null;\n if (op == \"in\" && no_in) op = null;\n if (op == \"**\" && left instanceof AST_UnaryPrefix\n /* unary token in front not allowed - parenthesis required */\n && !is_token(left.start, \"punc\", \"(\")\n && left.operator !== \"--\" && left.operator !== \"++\")\n unexpected(left.start);\n var prec = op != null ? PRECEDENCE[op] : null;\n if (prec != null && (prec > min_prec || (op === \"**\" && min_prec === prec))) {\n next();\n var right = expr_op(maybe_unary(true), prec, no_in);\n return expr_op(new AST_Binary({\n start : left.start,\n left : left,\n operator : op,\n right : right,\n end : right.end\n }), min_prec, no_in);\n }\n return left;\n };\n\n function expr_ops(no_in) {\n return expr_op(maybe_unary(true, true), 0, no_in);\n }\n\n var maybe_conditional = function(no_in) {\n var start = S.token;\n var expr = expr_ops(no_in);\n if (is(\"operator\", \"?\")) {\n next();\n var yes = expression(false);\n expect(\":\");\n return new AST_Conditional({\n start : start,\n condition : expr,\n consequent : yes,\n alternative : expression(false, no_in),\n end : prev()\n });\n }\n return expr;\n };\n\n function is_assignable(expr) {\n return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef;\n }\n\n function to_destructuring(node) {\n if (node instanceof AST_Object) {\n node = new AST_Destructuring({\n start: node.start,\n names: node.properties.map(to_destructuring),\n is_array: false,\n end: node.end\n });\n } else if (node instanceof AST_Array) {\n var names = [];\n\n for (var i = 0; i < node.elements.length; i++) {\n // Only allow expansion as last element\n if (node.elements[i] instanceof AST_Expansion) {\n if (i + 1 !== node.elements.length) {\n token_error(node.elements[i].start, \"Spread must the be last element in destructuring array\");\n }\n node.elements[i].expression = to_destructuring(node.elements[i].expression);\n }\n\n names.push(to_destructuring(node.elements[i]));\n }\n\n node = new AST_Destructuring({\n start: node.start,\n names: names,\n is_array: true,\n end: node.end\n });\n } else if (node instanceof AST_ObjectProperty) {\n node.value = to_destructuring(node.value);\n } else if (node instanceof AST_Assign) {\n node = new AST_DefaultAssign({\n start: node.start,\n left: node.left,\n operator: \"=\",\n right: node.right,\n end: node.end\n });\n }\n return node;\n }\n\n // In ES6, AssignmentExpression can also be an ArrowFunction\n var maybe_assign = function(no_in) {\n handle_regexp();\n var start = S.token;\n\n if (start.type == \"name\" && start.value == \"yield\") {\n if (is_in_generator()) {\n next();\n return _yield_expression();\n } else if (S.input.has_directive(\"use strict\")) {\n token_error(S.token, \"Unexpected yield identifier inside strict mode\");\n }\n }\n\n var left = maybe_conditional(no_in);\n var val = S.token.value;\n\n if (is(\"operator\") && ASSIGNMENT(val)) {\n if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) {\n next();\n return new AST_Assign({\n start : start,\n left : left,\n operator : val,\n right : maybe_assign(no_in),\n end : prev()\n });\n }\n croak(\"Invalid assignment\");\n }\n return left;\n };\n\n var expression = function(commas, no_in) {\n var start = S.token;\n var exprs = [];\n while (true) {\n exprs.push(maybe_assign(no_in));\n if (!commas || !is(\"punc\", \",\")) break;\n next();\n commas = true;\n }\n return exprs.length == 1 ? exprs[0] : new AST_Sequence({\n start : start,\n expressions : exprs,\n end : peek()\n });\n };\n\n function in_loop(cont) {\n ++S.in_loop;\n var ret = cont();\n --S.in_loop;\n return ret;\n }\n\n if (options.expression) {\n return expression(true);\n }\n\n return (function() {\n var start = S.token;\n var body = [];\n S.input.push_directives_stack();\n if (options.module) S.input.add_directive(\"use strict\");\n while (!is(\"eof\"))\n body.push(statement());\n S.input.pop_directives_stack();\n var end = prev();\n var toplevel = options.toplevel;\n if (toplevel) {\n toplevel.body = toplevel.body.concat(body);\n toplevel.end = end;\n } else {\n toplevel = new AST_Toplevel({ start: start, body: body, end: end });\n }\n return toplevel;\n })();\n\n}\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n// Tree transformer helpers.\n\nfunction TreeTransformer(before, after) {\n TreeWalker.call(this);\n this.before = before;\n this.after = after;\n}\nTreeTransformer.prototype = new TreeWalker;\n\n(function(undefined) {\n\n function _(node, descend) {\n node.DEFMETHOD(\"transform\", function(tw, in_list) {\n var x, y;\n tw.push(this);\n if (tw.before) x = tw.before(this, descend, in_list);\n if (x === undefined) {\n x = this;\n descend(x, tw);\n if (tw.after) {\n y = tw.after(x, in_list);\n if (y !== undefined) x = y;\n }\n }\n tw.pop();\n return x;\n });\n }\n\n function do_list(list, tw) {\n return MAP(list, function(node) {\n return node.transform(tw, true);\n });\n }\n\n _(AST_Node, noop);\n\n _(AST_LabeledStatement, function(self, tw) {\n self.label = self.label.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_SimpleStatement, function(self, tw) {\n self.body = self.body.transform(tw);\n });\n\n _(AST_Block, function(self, tw) {\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Do, function(self, tw) {\n self.body = self.body.transform(tw);\n self.condition = self.condition.transform(tw);\n });\n\n _(AST_While, function(self, tw) {\n self.condition = self.condition.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_For, function(self, tw) {\n if (self.init) self.init = self.init.transform(tw);\n if (self.condition) self.condition = self.condition.transform(tw);\n if (self.step) self.step = self.step.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_ForIn, function(self, tw) {\n self.init = self.init.transform(tw);\n self.object = self.object.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_With, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_Exit, function(self, tw) {\n if (self.value) self.value = self.value.transform(tw);\n });\n\n _(AST_LoopControl, function(self, tw) {\n if (self.label) self.label = self.label.transform(tw);\n });\n\n _(AST_If, function(self, tw) {\n self.condition = self.condition.transform(tw);\n self.body = self.body.transform(tw);\n if (self.alternative) self.alternative = self.alternative.transform(tw);\n });\n\n _(AST_Switch, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Case, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Try, function(self, tw) {\n self.body = do_list(self.body, tw);\n if (self.bcatch) self.bcatch = self.bcatch.transform(tw);\n if (self.bfinally) self.bfinally = self.bfinally.transform(tw);\n });\n\n _(AST_Catch, function(self, tw) {\n if (self.argname) self.argname = self.argname.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Definitions, function(self, tw) {\n self.definitions = do_list(self.definitions, tw);\n });\n\n _(AST_VarDef, function(self, tw) {\n self.name = self.name.transform(tw);\n if (self.value) self.value = self.value.transform(tw);\n });\n\n _(AST_Destructuring, function(self, tw) {\n self.names = do_list(self.names, tw);\n });\n\n _(AST_Lambda, function(self, tw) {\n if (self.name) self.name = self.name.transform(tw);\n self.argnames = do_list(self.argnames, tw);\n if (self.body instanceof AST_Node) {\n self.body = self.body.transform(tw);\n } else {\n self.body = do_list(self.body, tw);\n }\n });\n\n _(AST_Call, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.args = do_list(self.args, tw);\n });\n\n _(AST_Sequence, function(self, tw) {\n self.expressions = do_list(self.expressions, tw);\n });\n\n _(AST_Dot, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Sub, function(self, tw) {\n self.expression = self.expression.transform(tw);\n self.property = self.property.transform(tw);\n });\n\n _(AST_Yield, function(self, tw) {\n if (self.expression) self.expression = self.expression.transform(tw);\n });\n\n _(AST_Await, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Unary, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Binary, function(self, tw) {\n self.left = self.left.transform(tw);\n self.right = self.right.transform(tw);\n });\n\n _(AST_Conditional, function(self, tw) {\n self.condition = self.condition.transform(tw);\n self.consequent = self.consequent.transform(tw);\n self.alternative = self.alternative.transform(tw);\n });\n\n _(AST_Array, function(self, tw) {\n self.elements = do_list(self.elements, tw);\n });\n\n _(AST_Object, function(self, tw) {\n self.properties = do_list(self.properties, tw);\n });\n\n _(AST_ObjectProperty, function(self, tw) {\n if (self.key instanceof AST_Node) {\n self.key = self.key.transform(tw);\n }\n self.value = self.value.transform(tw);\n });\n\n _(AST_Class, function(self, tw) {\n if (self.name) self.name = self.name.transform(tw);\n if (self.extends) self.extends = self.extends.transform(tw);\n self.properties = do_list(self.properties, tw);\n });\n\n _(AST_Expansion, function(self, tw) {\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_NameMapping, function(self, tw) {\n self.foreign_name = self.foreign_name.transform(tw);\n self.name = self.name.transform(tw);\n });\n\n _(AST_Import, function(self, tw) {\n if (self.imported_name) self.imported_name = self.imported_name.transform(tw);\n if (self.imported_names) do_list(self.imported_names, tw);\n self.module_name = self.module_name.transform(tw);\n });\n\n _(AST_Export, function(self, tw) {\n if (self.exported_definition) self.exported_definition = self.exported_definition.transform(tw);\n if (self.exported_value) self.exported_value = self.exported_value.transform(tw);\n if (self.exported_names) do_list(self.exported_names, tw);\n if (self.module_name) self.module_name = self.module_name.transform(tw);\n });\n\n _(AST_TemplateString, function(self, tw) {\n self.segments = do_list(self.segments, tw);\n });\n\n _(AST_PrefixedTemplateString, function(self, tw) {\n self.prefix = self.prefix.transform(tw);\n self.template_string = self.template_string.transform(tw);\n });\n\n})();\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction SymbolDef(scope, orig, init) {\n this.name = orig.name;\n this.orig = [ orig ];\n this.init = init;\n this.eliminated = 0;\n this.scope = scope;\n this.references = [];\n this.replaced = 0;\n this.global = false;\n this.export = false;\n this.mangled_name = null;\n this.undeclared = false;\n this.id = SymbolDef.next_id++;\n}\n\nSymbolDef.next_id = 1;\n\nvar MASK_EXPORT_DONT_MANGLE = 1 << 0;\nvar MASK_EXPORT_WANT_MANGLE = 1 << 1;\n\nSymbolDef.prototype = {\n unmangleable: function(options) {\n if (!options) options = {};\n\n return this.global && !options.toplevel\n || (this.export & MASK_EXPORT_DONT_MANGLE)\n || this.undeclared\n || !options.eval && this.scope.pinned()\n || (this.orig[0] instanceof AST_SymbolLambda\n || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name)\n || this.orig[0] instanceof AST_SymbolMethod\n || (this.orig[0] instanceof AST_SymbolClass\n || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name);\n },\n mangle: function(options) {\n var cache = options.cache && options.cache.props;\n if (this.global && cache && cache.has(this.name)) {\n this.mangled_name = cache.get(this.name);\n } else if (!this.mangled_name && !this.unmangleable(options)) {\n var s = this.scope;\n var sym = this.orig[0];\n if (options.ie8 && sym instanceof AST_SymbolLambda)\n s = s.parent_scope;\n var def;\n if (def = this.redefined()) {\n this.mangled_name = def.mangled_name || def.name;\n } else\n this.mangled_name = s.next_mangled(options, this);\n if (this.global && cache) {\n cache.set(this.name, this.mangled_name);\n }\n }\n },\n redefined: function() {\n return this.defun && this.defun.variables.get(this.name);\n }\n};\n\nAST_Toplevel.DEFMETHOD(\"figure_out_scope\", function(options) {\n options = defaults(options, {\n cache: null,\n ie8: false,\n safari10: false,\n });\n\n // pass 1: setup scope chaining and handle definitions\n var self = this;\n var scope = self.parent_scope = null;\n var labels = new Dictionary();\n var defun = null;\n var in_destructuring = null;\n var for_scopes = [];\n var tw = new TreeWalker(function(node, descend) {\n if (node.is_block_scope()) {\n var save_scope = scope;\n node.block_scope = scope = new AST_Scope(node);\n scope.init_scope_vars(save_scope);\n if (!(node instanceof AST_Scope)) {\n scope.uses_with = save_scope.uses_with;\n scope.uses_eval = save_scope.uses_eval;\n scope.directives = save_scope.directives;\n }\n if (options.safari10) {\n if (node instanceof AST_For || node instanceof AST_ForIn) {\n for_scopes.push(scope);\n }\n }\n descend();\n scope = save_scope;\n return true;\n }\n if (node instanceof AST_Destructuring) {\n in_destructuring = node; // These don't nest\n descend();\n in_destructuring = null;\n return true;\n }\n if (node instanceof AST_Scope) {\n node.init_scope_vars(scope);\n var save_scope = scope;\n var save_defun = defun;\n var save_labels = labels;\n defun = scope = node;\n labels = new Dictionary();\n descend();\n scope = save_scope;\n defun = save_defun;\n labels = save_labels;\n return true; // don't descend again in TreeWalker\n }\n if (node instanceof AST_LabeledStatement) {\n var l = node.label;\n if (labels.has(l.name)) {\n throw new Error(string_template(\"Label {name} defined twice\", l));\n }\n labels.set(l.name, l);\n descend();\n labels.del(l.name);\n return true; // no descend again\n }\n if (node instanceof AST_With) {\n for (var s = scope; s; s = s.parent_scope)\n s.uses_with = true;\n return;\n }\n if (node instanceof AST_Symbol) {\n node.scope = scope;\n }\n if (node instanceof AST_Label) {\n node.thedef = node;\n node.references = [];\n }\n if (node instanceof AST_SymbolLambda) {\n defun.def_function(node, node.name == \"arguments\" ? undefined : defun);\n } else if (node instanceof AST_SymbolDefun) {\n // Careful here, the scope where this should be defined is\n // the parent scope. The reason is that we enter a new\n // scope when we encounter the AST_Defun node (which is\n // instanceof AST_Scope) but we get to the symbol a bit\n // later.\n mark_export((node.scope = defun.parent_scope.get_defun_scope()).def_function(node, defun), 1);\n } else if (node instanceof AST_SymbolClass) {\n mark_export(defun.def_variable(node, defun), 1);\n } else if (node instanceof AST_SymbolImport) {\n scope.def_variable(node);\n } else if (node instanceof AST_SymbolDefClass) {\n // This deals with the name of the class being available\n // inside the class.\n mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1);\n } else if (node instanceof AST_SymbolVar\n || node instanceof AST_SymbolLet\n || node instanceof AST_SymbolConst) {\n var def;\n if (node instanceof AST_SymbolBlockDeclaration) {\n def = scope.def_variable(node, null);\n } else {\n def = defun.def_variable(node, node.TYPE == \"SymbolVar\" ? null : undefined);\n }\n if (!all(def.orig, function(sym) {\n if (sym === node) return true;\n if (node instanceof AST_SymbolBlockDeclaration) {\n return sym instanceof AST_SymbolLambda;\n }\n return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst);\n })) {\n js_error(\n node.name + \" redeclared\",\n node.start.file,\n node.start.line,\n node.start.col,\n node.start.pos\n );\n }\n if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2);\n def.destructuring = in_destructuring;\n if (defun !== scope) {\n node.mark_enclosed(options);\n var def = scope.find_variable(node);\n if (node.thedef !== def) {\n node.thedef = def;\n node.reference(options);\n }\n }\n } else if (node instanceof AST_SymbolCatch) {\n scope.def_variable(node).defun = defun;\n } else if (node instanceof AST_LabelRef) {\n var sym = labels.get(node.name);\n if (!sym) throw new Error(string_template(\"Undefined label {name} [{line},{col}]\", {\n name: node.name,\n line: node.start.line,\n col: node.start.col\n }));\n node.thedef = sym;\n }\n if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) {\n js_error(\n node.TYPE + \" statement may only appear at top level\",\n node.start.file,\n node.start.line,\n node.start.col,\n node.start.pos\n );\n }\n\n function mark_export(def, level) {\n if (in_destructuring) {\n var i = 0;\n do {\n level++;\n } while (tw.parent(i++) !== in_destructuring);\n }\n var node = tw.parent(level);\n if (def.export = node instanceof AST_Export && MASK_EXPORT_DONT_MANGLE) {\n var exported = node.exported_definition;\n if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) {\n def.export = MASK_EXPORT_WANT_MANGLE;\n }\n }\n }\n });\n self.walk(tw);\n\n // pass 2: find back references and eval\n self.globals = new Dictionary();\n var tw = new TreeWalker(function(node, descend) {\n if (node instanceof AST_LoopControl && node.label) {\n node.label.thedef.references.push(node);\n return true;\n }\n if (node instanceof AST_SymbolRef) {\n var name = node.name;\n if (name == \"eval\" && tw.parent() instanceof AST_Call) {\n for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) {\n s.uses_eval = true;\n }\n }\n var sym;\n if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name\n || !(sym = node.scope.find_variable(name))) {\n sym = self.def_global(node);\n if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE;\n } else if (sym.scope instanceof AST_Lambda && name == \"arguments\") {\n sym.scope.uses_arguments = true;\n }\n node.thedef = sym;\n node.reference(options);\n if (node.scope.is_block_scope()\n && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) {\n node.scope = node.scope.get_defun_scope();\n }\n return true;\n }\n // ensure mangling works if catch reuses a scope variable\n var def;\n if (node instanceof AST_SymbolCatch && (def = node.definition().redefined())) {\n var s = node.scope;\n while (s) {\n push_uniq(s.enclosed, def);\n if (s === def.scope) break;\n s = s.parent_scope;\n }\n }\n });\n self.walk(tw);\n\n // pass 3: work around IE8 and Safari catch scope bugs\n if (options.ie8 || options.safari10) {\n self.walk(new TreeWalker(function(node, descend) {\n if (node instanceof AST_SymbolCatch) {\n var name = node.name;\n var refs = node.thedef.references;\n var scope = node.thedef.defun;\n var def = scope.find_variable(name) || self.globals.get(name) || scope.def_variable(node);\n refs.forEach(function(ref) {\n ref.thedef = def;\n ref.reference(options);\n });\n node.thedef = def;\n node.reference(options);\n return true;\n }\n }));\n }\n\n // pass 4: add symbol definitions to loop scopes\n // Safari/Webkit bug workaround - loop init let variable shadowing argument.\n // https://github.com/mishoo/UglifyJS2/issues/1753\n // https://bugs.webkit.org/show_bug.cgi?id=171041\n if (options.safari10) {\n for (var i = 0; i < for_scopes.length; i++) {\n var scope = for_scopes[i];\n scope.parent_scope.variables.each(function(def) {\n push_uniq(scope.enclosed, def);\n });\n }\n }\n});\n\nAST_Toplevel.DEFMETHOD(\"def_global\", function(node) {\n var globals = this.globals, name = node.name;\n if (globals.has(name)) {\n return globals.get(name);\n } else {\n var g = new SymbolDef(this, node);\n g.undeclared = true;\n g.global = true;\n globals.set(name, g);\n return g;\n }\n});\n\nAST_Scope.DEFMETHOD(\"init_scope_vars\", function(parent_scope) {\n this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions)\n this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope)\n this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement\n this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval`\n this.parent_scope = parent_scope; // the parent scope\n this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes\n this.cname = -1; // the current index for mangling functions/variables\n});\n\nAST_Node.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Class.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Lambda.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Toplevel.DEFMETHOD(\"is_block_scope\", return_false);\nAST_SwitchBranch.DEFMETHOD(\"is_block_scope\", return_false);\nAST_Block.DEFMETHOD(\"is_block_scope\", return_true);\nAST_IterationStatement.DEFMETHOD(\"is_block_scope\", return_true);\n\nAST_Lambda.DEFMETHOD(\"init_scope_vars\", function() {\n AST_Scope.prototype.init_scope_vars.apply(this, arguments);\n this.uses_arguments = false;\n this.def_variable(new AST_SymbolFunarg({\n name: \"arguments\",\n start: this.start,\n end: this.end\n }));\n});\n\nAST_Arrow.DEFMETHOD(\"init_scope_vars\", function() {\n AST_Scope.prototype.init_scope_vars.apply(this, arguments);\n this.uses_arguments = false;\n});\n\nAST_Symbol.DEFMETHOD(\"mark_enclosed\", function(options) {\n var def = this.definition();\n var s = this.scope;\n while (s) {\n push_uniq(s.enclosed, def);\n if (options.keep_fnames) {\n s.functions.each(function(d) {\n if (keep_name(options.keep_fnames, d.name)) {\n push_uniq(def.scope.enclosed, d);\n }\n });\n }\n if (s === def.scope) break;\n s = s.parent_scope;\n }\n});\n\nAST_Symbol.DEFMETHOD(\"reference\", function(options) {\n this.definition().references.push(this);\n this.mark_enclosed(options);\n});\n\nAST_Scope.DEFMETHOD(\"find_variable\", function(name) {\n if (name instanceof AST_Symbol) name = name.name;\n return this.variables.get(name)\n || (this.parent_scope && this.parent_scope.find_variable(name));\n});\n\nAST_Scope.DEFMETHOD(\"def_function\", function(symbol, init) {\n var def = this.def_variable(symbol, init);\n if (!def.init || def.init instanceof AST_Defun) def.init = init;\n this.functions.set(symbol.name, def);\n return def;\n});\n\nAST_Scope.DEFMETHOD(\"def_variable\", function(symbol, init) {\n var def = this.variables.get(symbol.name);\n if (def) {\n def.orig.push(symbol);\n if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) {\n def.init = init;\n }\n } else {\n def = new SymbolDef(this, symbol, init);\n this.variables.set(symbol.name, def);\n def.global = !this.parent_scope;\n }\n return symbol.thedef = def;\n});\n\nfunction next_mangled(scope, options) {\n var ext = scope.enclosed;\n out: while (true) {\n var m = base54(++scope.cname);\n if (!is_identifier(m)) continue; // skip over \"do\"\n\n // https://github.com/mishoo/UglifyJS2/issues/242 -- do not\n // shadow a name reserved from mangling.\n if (member(m, options.reserved)) continue;\n\n // we must ensure that the mangled name does not shadow a name\n // from some parent scope that is referenced in this or in\n // inner scopes.\n for (var i = ext.length; --i >= 0;) {\n var sym = ext[i];\n var name = sym.mangled_name || (sym.unmangleable(options) && sym.name);\n if (m == name) continue out;\n }\n return m;\n }\n}\n\nAST_Scope.DEFMETHOD(\"next_mangled\", function(options) {\n return next_mangled(this, options);\n});\n\nAST_Toplevel.DEFMETHOD(\"next_mangled\", function(options) {\n var name;\n do {\n name = next_mangled(this, options);\n } while (member(name, this.mangled_names));\n return name;\n});\n\nAST_Function.DEFMETHOD(\"next_mangled\", function(options, def) {\n // #179, #326\n // in Safari strict mode, something like (function x(x){...}) is a syntax error;\n // a function expression's argument cannot shadow the function expression's name\n\n var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition();\n\n // the function's mangled_name is null when keep_fnames is true\n var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null;\n\n while (true) {\n var name = next_mangled(this, options);\n if (!tricky_name || tricky_name != name)\n return name;\n }\n});\n\nAST_Symbol.DEFMETHOD(\"unmangleable\", function(options) {\n var def = this.definition();\n return !def || def.unmangleable(options);\n});\n\n// labels are always mangleable\nAST_Label.DEFMETHOD(\"unmangleable\", return_false);\n\nAST_Symbol.DEFMETHOD(\"unreferenced\", function() {\n return !this.definition().references.length && !this.scope.pinned();\n});\n\nAST_Symbol.DEFMETHOD(\"definition\", function() {\n return this.thedef;\n});\n\nAST_Symbol.DEFMETHOD(\"global\", function() {\n return this.definition().global;\n});\n\nAST_Toplevel.DEFMETHOD(\"_default_mangler_options\", function(options) {\n options = defaults(options, {\n eval : false,\n ie8 : false,\n keep_classnames: false,\n keep_fnames : false,\n module : false,\n reserved : [],\n toplevel : false,\n });\n if (options[\"module\"]) {\n options.toplevel = true;\n }\n if (!Array.isArray(options.reserved)) options.reserved = [];\n // Never mangle arguments\n push_uniq(options.reserved, \"arguments\");\n return options;\n});\n\nAST_Toplevel.DEFMETHOD(\"mangle_names\", function(options) {\n options = this._default_mangler_options(options);\n\n // We only need to mangle declaration nodes. Special logic wired\n // into the code generator will display the mangled name if it's\n // present (and for AST_SymbolRef-s it'll use the mangled name of\n // the AST_SymbolDeclaration that it points to).\n var lname = -1;\n var to_mangle = [];\n\n var mangled_names = this.mangled_names = [];\n if (options.cache) {\n this.globals.each(collect);\n if (options.cache.props) {\n options.cache.props.each(function(mangled_name) {\n push_uniq(mangled_names, mangled_name);\n });\n }\n }\n\n var tw = new TreeWalker(function(node, descend) {\n if (node instanceof AST_LabeledStatement) {\n // lname is incremented when we get to the AST_Label\n var save_nesting = lname;\n descend();\n lname = save_nesting;\n return true; // don't descend again in TreeWalker\n }\n if (node instanceof AST_Scope) {\n node.variables.each(collect);\n return;\n }\n if (node.is_block_scope()) {\n node.block_scope.variables.each(collect);\n return;\n }\n if (node instanceof AST_Label) {\n var name;\n do name = base54(++lname); while (!is_identifier(name));\n node.mangled_name = name;\n return true;\n }\n if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) {\n to_mangle.push(node.definition());\n return;\n }\n });\n this.walk(tw);\n to_mangle.forEach(function(def) { def.mangle(options); });\n\n function collect(symbol) {\n if (!member(symbol.name, options.reserved)) {\n if (!(symbol.export & MASK_EXPORT_DONT_MANGLE)) {\n to_mangle.push(symbol);\n }\n }\n }\n});\n\nAST_Toplevel.DEFMETHOD(\"find_colliding_names\", function(options) {\n var cache = options.cache && options.cache.props;\n var avoid = Object.create(null);\n options.reserved.forEach(to_avoid);\n this.globals.each(add_def);\n this.walk(new TreeWalker(function(node) {\n if (node instanceof AST_Scope) node.variables.each(add_def);\n if (node instanceof AST_SymbolCatch) add_def(node.definition());\n }));\n return avoid;\n\n function to_avoid(name) {\n avoid[name] = true;\n }\n\n function add_def(def) {\n var name = def.name;\n if (def.global && cache && cache.has(name)) name = cache.get(name);\n else if (!def.unmangleable(options)) return;\n to_avoid(name);\n }\n});\n\nAST_Toplevel.DEFMETHOD(\"expand_names\", function(options) {\n base54.reset();\n base54.sort();\n options = this._default_mangler_options(options);\n var avoid = this.find_colliding_names(options);\n var cname = 0;\n this.globals.each(rename);\n this.walk(new TreeWalker(function(node) {\n if (node instanceof AST_Scope) node.variables.each(rename);\n if (node instanceof AST_SymbolCatch) rename(node.definition());\n }));\n\n function next_name() {\n var name;\n do {\n name = base54(cname++);\n } while (avoid[name] || !is_identifier(name));\n return name;\n }\n\n function rename(def) {\n if (def.global && options.cache) return;\n if (def.unmangleable(options)) return;\n if (member(def.name, options.reserved)) return;\n var d = def.redefined();\n def.name = d ? d.name : next_name();\n def.orig.forEach(function(sym) {\n sym.name = def.name;\n });\n def.references.forEach(function(sym) {\n sym.name = def.name;\n });\n }\n});\n\nAST_Node.DEFMETHOD(\"tail_node\", return_this);\nAST_Sequence.DEFMETHOD(\"tail_node\", function() {\n return this.expressions[this.expressions.length - 1];\n});\n\nAST_Toplevel.DEFMETHOD(\"compute_char_frequency\", function(options) {\n options = this._default_mangler_options(options);\n try {\n AST_Node.prototype.print = function(stream, force_parens) {\n this._print(stream, force_parens);\n if (this instanceof AST_Symbol && !this.unmangleable(options)) {\n base54.consider(this.name, -1);\n } else if (options.properties) {\n if (this instanceof AST_Dot) {\n base54.consider(this.property, -1);\n } else if (this instanceof AST_Sub) {\n skip_string(this.property);\n }\n }\n };\n base54.consider(this.print_to_string(), 1);\n } finally {\n AST_Node.prototype.print = AST_Node.prototype._print;\n }\n base54.sort();\n\n function skip_string(node) {\n if (node instanceof AST_String) {\n base54.consider(node.value, -1);\n } else if (node instanceof AST_Conditional) {\n skip_string(node.consequent);\n skip_string(node.alternative);\n } else if (node instanceof AST_Sequence) {\n skip_string(node.tail_node());\n }\n }\n});\n\nvar base54 = (function() {\n var leading = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_\".split(\"\");\n var digits = \"0123456789\".split(\"\");\n var chars, frequency;\n function reset() {\n frequency = Object.create(null);\n leading.forEach(function(ch) {\n frequency[ch] = 0;\n });\n digits.forEach(function(ch) {\n frequency[ch] = 0;\n });\n }\n base54.consider = function(str, delta) {\n for (var i = str.length; --i >= 0;) {\n frequency[str[i]] += delta;\n }\n };\n function compare(a, b) {\n return frequency[b] - frequency[a];\n }\n base54.sort = function() {\n chars = mergeSort(leading, compare).concat(mergeSort(digits, compare));\n };\n base54.reset = reset;\n reset();\n function base54(num) {\n var ret = \"\", base = 54;\n num++;\n do {\n num--;\n ret += chars[num % base];\n num = Math.floor(num / base);\n base = 64;\n } while (num > 0);\n return ret;\n }\n return base54;\n})();\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nvar EXPECT_DIRECTIVE = /^$|[;{][\\s\\n]*$/;\n\nfunction is_some_comments(comment) {\n // multiline comment\n return comment.type == \"comment2\" && /@preserve|@license|@cc_on/i.test(comment.value);\n}\n\nfunction OutputStream(options) {\n\n var readonly = !options;\n options = defaults(options, {\n ascii_only : false,\n beautify : false,\n braces : false,\n comments : false,\n ecma : 5,\n ie8 : false,\n indent_level : 4,\n indent_start : 0,\n inline_script : true,\n keep_quoted_props: false,\n max_line_len : false,\n preamble : null,\n quote_keys : false,\n quote_style : 0,\n safari10 : false,\n semicolons : true,\n shebang : true,\n shorthand : undefined,\n source_map : null,\n webkit : false,\n width : 80,\n wrap_iife : false,\n }, true);\n\n if (options.shorthand === undefined)\n options.shorthand = options.ecma > 5;\n\n // Convert comment option to RegExp if neccessary and set up comments filter\n var comment_filter = return_false; // Default case, throw all comments away\n if (options.comments) {\n var comments = options.comments;\n if (typeof options.comments === \"string\" && /^\\/.*\\/[a-zA-Z]*$/.test(options.comments)) {\n var regex_pos = options.comments.lastIndexOf(\"/\");\n comments = new RegExp(\n options.comments.substr(1, regex_pos - 1),\n options.comments.substr(regex_pos + 1)\n );\n }\n if (comments instanceof RegExp) {\n comment_filter = function(comment) {\n return comment.type != \"comment5\" && comments.test(comment.value);\n };\n } else if (typeof comments === \"function\") {\n comment_filter = function(comment) {\n return comment.type != \"comment5\" && comments(this, comment);\n };\n } else if (comments === \"some\") {\n comment_filter = is_some_comments;\n } else { // NOTE includes \"all\" option\n comment_filter = return_true;\n }\n }\n\n var indentation = 0;\n var current_col = 0;\n var current_line = 1;\n var current_pos = 0;\n var OUTPUT = \"\";\n\n var to_utf8 = options.ascii_only ? function(str, identifier) {\n if (options.ecma >= 6) {\n str = str.replace(/[\\ud800-\\udbff][\\udc00-\\udfff]/g, function(ch) {\n var code = get_full_char_code(ch, 0).toString(16);\n return \"\\\\u{\" + code + \"}\";\n });\n }\n return str.replace(/[\\u0000-\\u001f\\u007f-\\uffff]/g, function(ch) {\n var code = ch.charCodeAt(0).toString(16);\n if (code.length <= 2 && !identifier) {\n while (code.length < 2) code = \"0\" + code;\n return \"\\\\x\" + code;\n } else {\n while (code.length < 4) code = \"0\" + code;\n return \"\\\\u\" + code;\n }\n });\n } : function(str) {\n var s = \"\";\n for (var i = 0, len = str.length; i < len; i++) {\n if (is_surrogate_pair_head(str[i]) && !is_surrogate_pair_tail(str[i + 1])\n || is_surrogate_pair_tail(str[i]) && !is_surrogate_pair_head(str[i - 1])) {\n s += \"\\\\u\" + str.charCodeAt(i).toString(16);\n } else {\n s += str[i];\n }\n }\n return s;\n };\n\n function make_string(str, quote) {\n var dq = 0, sq = 0;\n str = str.replace(/[\\\\\\b\\f\\n\\r\\v\\t\\x22\\x27\\u2028\\u2029\\0\\ufeff]/g,\n function(s, i) {\n switch (s) {\n case '\"': ++dq; return '\"';\n case \"'\": ++sq; return \"'\";\n case \"\\\\\": return \"\\\\\\\\\";\n case \"\\n\": return \"\\\\n\";\n case \"\\r\": return \"\\\\r\";\n case \"\\t\": return \"\\\\t\";\n case \"\\b\": return \"\\\\b\";\n case \"\\f\": return \"\\\\f\";\n case \"\\x0B\": return options.ie8 ? \"\\\\x0B\" : \"\\\\v\";\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n case \"\\ufeff\": return \"\\\\ufeff\";\n case \"\\0\":\n return /[0-9]/.test(get_full_char(str, i+1)) ? \"\\\\x00\" : \"\\\\0\";\n }\n return s;\n });\n function quote_single() {\n return \"'\" + str.replace(/\\x27/g, \"\\\\'\") + \"'\";\n }\n function quote_double() {\n return '\"' + str.replace(/\\x22/g, '\\\\\"') + '\"';\n }\n function quote_template() {\n return \"`\" + str.replace(/`/g, \"\\\\`\") + \"`\";\n }\n str = to_utf8(str);\n if (quote === \"`\") return quote_template();\n switch (options.quote_style) {\n case 1:\n return quote_single();\n case 2:\n return quote_double();\n case 3:\n return quote == \"'\" ? quote_single() : quote_double();\n default:\n return dq > sq ? quote_single() : quote_double();\n }\n }\n\n function encode_string(str, quote) {\n var ret = make_string(str, quote);\n if (options.inline_script) {\n ret = ret.replace(/<\\x2f(script)([>\\/\\t\\n\\f\\r ])/gi, \"<\\\\/$1$2\");\n ret = ret.replace(/\\x3c!--/g, \"\\\\x3c!--\");\n ret = ret.replace(/--\\x3e/g, \"--\\\\x3e\");\n }\n return ret;\n }\n\n function make_name(name) {\n name = name.toString();\n name = to_utf8(name, true);\n return name;\n }\n\n function make_indent(back) {\n return repeat_string(\" \", options.indent_start + indentation - back * options.indent_level);\n }\n\n /* -----[ beautification/minification ]----- */\n\n var has_parens = false;\n var might_need_space = false;\n var might_need_semicolon = false;\n var might_add_newline = 0;\n var need_newline_indented = false;\n var need_space = false;\n var newline_insert = -1;\n var last = \"\";\n var mapping_token, mapping_name, mappings = options.source_map && [];\n\n var do_add_mapping = mappings ? function() {\n mappings.forEach(function(mapping) {\n try {\n options.source_map.add(\n mapping.token.file,\n mapping.line, mapping.col,\n mapping.token.line, mapping.token.col,\n !mapping.name && mapping.token.type == \"name\" ? mapping.token.value : mapping.name\n );\n } catch(ex) {\n mapping.token.file != null && AST_Node.warn(\"Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]\", {\n file: mapping.token.file,\n line: mapping.token.line,\n col: mapping.token.col,\n cline: mapping.line,\n ccol: mapping.col,\n name: mapping.name || \"\"\n });\n }\n });\n mappings = [];\n } : noop;\n\n var ensure_line_len = options.max_line_len ? function() {\n if (current_col > options.max_line_len) {\n if (might_add_newline) {\n var left = OUTPUT.slice(0, might_add_newline);\n var right = OUTPUT.slice(might_add_newline);\n if (mappings) {\n var delta = right.length - current_col;\n mappings.forEach(function(mapping) {\n mapping.line++;\n mapping.col += delta;\n });\n }\n OUTPUT = left + \"\\n\" + right;\n current_line++;\n current_pos++;\n current_col = right.length;\n }\n if (current_col > options.max_line_len) {\n AST_Node.warn(\"Output exceeds {max_line_len} characters\", options);\n }\n }\n if (might_add_newline) {\n might_add_newline = 0;\n do_add_mapping();\n }\n } : noop;\n\n var requireSemicolonChars = makePredicate(\"( [ + * / - , . `\");\n\n function print(str) {\n str = String(str);\n var ch = get_full_char(str, 0);\n var prev = get_full_char(last, last.length - 1);\n if (need_newline_indented && ch) {\n need_newline_indented = false;\n if (ch != \"\\n\") {\n print(\"\\n\");\n indent();\n }\n }\n if (need_space && ch) {\n need_space = false;\n if (!/[\\s;})]/.test(ch)) {\n space();\n }\n }\n newline_insert = -1;\n var prev = last.charAt(last.length - 1);\n if (might_need_semicolon) {\n might_need_semicolon = false;\n\n if (prev == \":\" && ch == \"}\" || (!ch || \";}\".indexOf(ch) < 0) && prev != \";\") {\n if (options.semicolons || requireSemicolonChars(ch)) {\n OUTPUT += \";\";\n current_col++;\n current_pos++;\n } else {\n ensure_line_len();\n OUTPUT += \"\\n\";\n current_pos++;\n current_line++;\n current_col = 0;\n\n if (/^\\s+$/.test(str)) {\n // reset the semicolon flag, since we didn't print one\n // now and might still have to later\n might_need_semicolon = true;\n }\n }\n\n if (!options.beautify)\n might_need_space = false;\n }\n }\n\n if (might_need_space) {\n if ((is_identifier_char(prev)\n && (is_identifier_char(ch) || ch == \"\\\\\"))\n || (ch == \"/\" && ch == prev)\n || ((ch == \"+\" || ch == \"-\") && ch == last)\n ) {\n OUTPUT += \" \";\n current_col++;\n current_pos++;\n }\n might_need_space = false;\n }\n\n if (mapping_token) {\n mappings.push({\n token: mapping_token,\n name: mapping_name,\n line: current_line,\n col: current_col\n });\n mapping_token = false;\n if (!might_add_newline) do_add_mapping();\n }\n\n OUTPUT += str;\n has_parens = str[str.length - 1] == \"(\";\n current_pos += str.length;\n var a = str.split(/\\r?\\n/), n = a.length - 1;\n current_line += n;\n current_col += a[0].length;\n if (n > 0) {\n ensure_line_len();\n current_col = a[n].length;\n }\n last = str;\n }\n\n var star = function() {\n print(\"*\");\n };\n\n var space = options.beautify ? function() {\n print(\" \");\n } : function() {\n might_need_space = true;\n };\n\n var indent = options.beautify ? function(half) {\n if (options.beautify) {\n print(make_indent(half ? 0.5 : 0));\n }\n } : noop;\n\n var with_indent = options.beautify ? function(col, cont) {\n if (col === true) col = next_indent();\n var save_indentation = indentation;\n indentation = col;\n var ret = cont();\n indentation = save_indentation;\n return ret;\n } : function(col, cont) { return cont(); };\n\n var newline = options.beautify ? function() {\n if (newline_insert < 0) return print(\"\\n\");\n if (OUTPUT[newline_insert] != \"\\n\") {\n OUTPUT = OUTPUT.slice(0, newline_insert) + \"\\n\" + OUTPUT.slice(newline_insert);\n current_pos++;\n current_line++;\n }\n newline_insert++;\n } : options.max_line_len ? function() {\n ensure_line_len();\n might_add_newline = OUTPUT.length;\n } : noop;\n\n var semicolon = options.beautify ? function() {\n print(\";\");\n } : function() {\n might_need_semicolon = true;\n };\n\n function force_semicolon() {\n might_need_semicolon = false;\n print(\";\");\n }\n\n function next_indent() {\n return indentation + options.indent_level;\n }\n\n function with_block(cont) {\n var ret;\n print(\"{\");\n newline();\n with_indent(next_indent(), function() {\n ret = cont();\n });\n indent();\n print(\"}\");\n return ret;\n }\n\n function with_parens(cont) {\n print(\"(\");\n //XXX: still nice to have that for argument lists\n //var ret = with_indent(current_col, cont);\n var ret = cont();\n print(\")\");\n return ret;\n }\n\n function with_square(cont) {\n print(\"[\");\n //var ret = with_indent(current_col, cont);\n var ret = cont();\n print(\"]\");\n return ret;\n }\n\n function comma() {\n print(\",\");\n space();\n }\n\n function colon() {\n print(\":\");\n space();\n }\n\n var add_mapping = mappings ? function(token, name) {\n mapping_token = token;\n mapping_name = name;\n } : noop;\n\n function get() {\n if (might_add_newline) {\n ensure_line_len();\n }\n return OUTPUT;\n }\n\n function has_nlb() {\n var index = OUTPUT.lastIndexOf(\"\\n\");\n return /^ *$/.test(OUTPUT.slice(index + 1));\n }\n\n function prepend_comments(node) {\n var self = this;\n var start = node.start;\n if (!start) return;\n if (start.comments_before && start.comments_before._dumped === self) return;\n var comments = start.comments_before;\n if (!comments) {\n comments = start.comments_before = [];\n }\n comments._dumped = self;\n\n if (node instanceof AST_Exit && node.value) {\n var tw = new TreeWalker(function(node) {\n var parent = tw.parent();\n if (parent instanceof AST_Exit\n || parent instanceof AST_Binary && parent.left === node\n || parent.TYPE == \"Call\" && parent.expression === node\n || parent instanceof AST_Conditional && parent.condition === node\n || parent instanceof AST_Dot && parent.expression === node\n || parent instanceof AST_Sequence && parent.expressions[0] === node\n || parent instanceof AST_Sub && parent.expression === node\n || parent instanceof AST_UnaryPostfix) {\n if (!node.start) return;\n var text = node.start.comments_before;\n if (text && text._dumped !== self) {\n text._dumped = self;\n comments = comments.concat(text);\n }\n } else {\n return true;\n }\n });\n tw.push(node);\n node.value.walk(tw);\n }\n\n if (current_pos == 0) {\n if (comments.length > 0 && options.shebang && comments[0].type == \"comment5\") {\n print(\"#!\" + comments.shift().value + \"\\n\");\n indent();\n }\n var preamble = options.preamble;\n if (preamble) {\n print(preamble.replace(/\\r\\n?|[\\n\\u2028\\u2029]|\\s*$/g, \"\\n\"));\n }\n }\n\n comments = comments.filter(comment_filter, node);\n if (comments.length == 0) return;\n var last_nlb = has_nlb();\n comments.forEach(function(c, i) {\n if (!last_nlb) {\n if (c.nlb) {\n print(\"\\n\");\n indent();\n last_nlb = true;\n } else if (i > 0) {\n space();\n }\n }\n if (/comment[134]/.test(c.type)) {\n print(\"//\" + c.value.replace(/[@#]__PURE__/g, \" \") + \"\\n\");\n indent();\n last_nlb = true;\n } else if (c.type == \"comment2\") {\n print(\"/*\" + c.value.replace(/[@#]__PURE__/g, \" \") + \"*/\");\n last_nlb = false;\n }\n });\n if (!last_nlb) {\n if (start.nlb) {\n print(\"\\n\");\n indent();\n } else {\n space();\n }\n }\n }\n\n function append_comments(node, tail) {\n var self = this;\n var token = node.end;\n if (!token) return;\n var comments = token[tail ? \"comments_before\" : \"comments_after\"];\n if (!comments || comments._dumped === self) return;\n if (!(node instanceof AST_Statement || all(comments, function(c) {\n return !/comment[134]/.test(c.type);\n }))) return;\n comments._dumped = self;\n var insert = OUTPUT.length;\n comments.filter(comment_filter, node).forEach(function(c, i) {\n need_space = false;\n if (need_newline_indented) {\n print(\"\\n\");\n indent();\n need_newline_indented = false;\n } else if (c.nlb && (i > 0 || !has_nlb())) {\n print(\"\\n\");\n indent();\n } else if (i > 0 || !tail) {\n space();\n }\n if (/comment[134]/.test(c.type)) {\n print(\"//\" + c.value.replace(/[@#]__PURE__/g, \" \"));\n need_newline_indented = true;\n } else if (c.type == \"comment2\") {\n print(\"/*\" + c.value.replace(/[@#]__PURE__/g, \" \") + \"*/\");\n need_space = true;\n }\n });\n if (OUTPUT.length > insert) newline_insert = insert;\n }\n\n var stack = [];\n return {\n get : get,\n toString : get,\n indent : indent,\n indentation : function() { return indentation; },\n current_width : function() { return current_col - indentation; },\n should_break : function() { return options.width && this.current_width() >= options.width; },\n has_parens : function() { return has_parens; },\n newline : newline,\n print : print,\n star : star,\n space : space,\n comma : comma,\n colon : colon,\n last : function() { return last; },\n semicolon : semicolon,\n force_semicolon : force_semicolon,\n to_utf8 : to_utf8,\n print_name : function(name) { print(make_name(name)); },\n print_string : function(str, quote, escape_directive) {\n var encoded = encode_string(str, quote);\n if (escape_directive === true && encoded.indexOf(\"\\\\\") === -1) {\n // Insert semicolons to break directive prologue\n if (!EXPECT_DIRECTIVE.test(OUTPUT)) {\n force_semicolon();\n }\n force_semicolon();\n }\n print(encoded);\n },\n print_template_string_chars: function(str) {\n var encoded = encode_string(str, \"`\").replace(/\\${/g, \"\\\\${\");\n return print(encoded.substr(1, encoded.length - 2));\n },\n encode_string : encode_string,\n next_indent : next_indent,\n with_indent : with_indent,\n with_block : with_block,\n with_parens : with_parens,\n with_square : with_square,\n add_mapping : add_mapping,\n option : function(opt) { return options[opt]; },\n prepend_comments: readonly ? noop : prepend_comments,\n append_comments : readonly || comment_filter === return_false ? noop : append_comments,\n line : function() { return current_line; },\n col : function() { return current_col; },\n pos : function() { return current_pos; },\n push_node : function(node) { stack.push(node); },\n pop_node : function() { return stack.pop(); },\n parent : function(n) {\n return stack[stack.length - 2 - (n || 0)];\n }\n };\n\n}\n\n/* -----[ code generators ]----- */\n\n(function() {\n\n /* -----[ utils ]----- */\n\n function DEFPRINT(nodetype, generator) {\n nodetype.DEFMETHOD(\"_codegen\", generator);\n }\n\n var in_directive = false;\n var active_scope = null;\n var use_asm = null;\n\n AST_Node.DEFMETHOD(\"print\", function(stream, force_parens) {\n var self = this, generator = self._codegen;\n if (self instanceof AST_Scope) {\n active_scope = self;\n } else if (!use_asm && self instanceof AST_Directive && self.value == \"use asm\") {\n use_asm = active_scope;\n }\n function doit() {\n stream.prepend_comments(self);\n self.add_source_map(stream);\n generator(self, stream);\n stream.append_comments(self);\n }\n stream.push_node(self);\n if (force_parens || self.needs_parens(stream)) {\n stream.with_parens(doit);\n } else {\n doit();\n }\n stream.pop_node();\n if (self === use_asm) {\n use_asm = null;\n }\n });\n AST_Node.DEFMETHOD(\"_print\", AST_Node.prototype.print);\n\n AST_Node.DEFMETHOD(\"print_to_string\", function(options) {\n var s = OutputStream(options);\n this.print(s);\n return s.get();\n });\n\n /* -----[ PARENTHESES ]----- */\n\n function PARENS(nodetype, func) {\n if (Array.isArray(nodetype)) {\n nodetype.forEach(function(nodetype) {\n PARENS(nodetype, func);\n });\n } else {\n nodetype.DEFMETHOD(\"needs_parens\", func);\n }\n }\n\n PARENS(AST_Node, return_false);\n\n // a function expression needs parens around it when it's provably\n // the first token to appear in a statement.\n PARENS(AST_Function, function(output) {\n if (!output.has_parens() && first_in_statement(output)) {\n return true;\n }\n\n if (output.option(\"webkit\")) {\n var p = output.parent();\n if (p instanceof AST_PropAccess && p.expression === this) {\n return true;\n }\n }\n\n if (output.option(\"wrap_iife\")) {\n var p = output.parent();\n return p instanceof AST_Call && p.expression === this;\n }\n\n return false;\n });\n\n PARENS(AST_Arrow, function(output) {\n var p = output.parent();\n return p instanceof AST_PropAccess && p.expression === this;\n });\n\n // same goes for an object literal, because otherwise it would be\n // interpreted as a block of code.\n PARENS(AST_Object, function(output) {\n return !output.has_parens() && first_in_statement(output);\n });\n\n PARENS(AST_ClassExpression, first_in_statement);\n\n PARENS(AST_Unary, function(output) {\n var p = output.parent();\n return p instanceof AST_PropAccess && p.expression === this\n || p instanceof AST_Call && p.expression === this\n || p instanceof AST_Binary\n && p.operator === \"**\"\n && this instanceof AST_UnaryPrefix\n && p.left === this\n && this.operator !== \"++\"\n && this.operator !== \"--\";\n });\n\n PARENS(AST_Await, function(output) {\n var p = output.parent();\n return p instanceof AST_PropAccess && p.expression === this\n || p instanceof AST_Call && p.expression === this\n || output.option(\"safari10\") && p instanceof AST_UnaryPrefix;\n });\n\n PARENS(AST_Sequence, function(output) {\n var p = output.parent();\n return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)\n || p instanceof AST_Unary // !(foo, bar, baz)\n || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8\n || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4\n || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})[\"foo\"] ==> 2\n || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]\n || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2\n || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)\n * ==> 20 (side effect, set a := 10 and b := 20) */\n || p instanceof AST_Arrow // x => (x, x)\n || p instanceof AST_DefaultAssign // x => (x = (0, function(){}))\n || p instanceof AST_Expansion // [...(a, b)]\n || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}\n || p instanceof AST_Yield // yield (foo, bar)\n || p instanceof AST_Export // export default (foo, bar)\n ;\n });\n\n PARENS(AST_Binary, function(output) {\n var p = output.parent();\n // (foo && bar)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // typeof (foo && bar)\n if (p instanceof AST_Unary)\n return true;\n // (foo && bar)[\"prop\"], (foo && bar).prop\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n // this deals with precedence: 3 * (2 + 1)\n if (p instanceof AST_Binary) {\n var po = p.operator, pp = PRECEDENCE[po];\n var so = this.operator, sp = PRECEDENCE[so];\n if (pp > sp\n || (pp == sp\n && (this === p.right || po == \"**\"))) {\n return true;\n }\n }\n });\n\n PARENS(AST_Yield, function(output) {\n var p = output.parent();\n // (yield 1) + (yield 2)\n // a = yield 3\n if (p instanceof AST_Binary && p.operator !== \"=\")\n return true;\n // (yield 1)()\n // new (yield 1)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // (yield 1) ? yield 2 : yield 3\n if (p instanceof AST_Conditional && p.condition === this)\n return true;\n // -(yield 4)\n if (p instanceof AST_Unary)\n return true;\n // (yield x).foo\n // (yield x)['foo']\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n });\n\n PARENS(AST_PropAccess, function(output) {\n var p = output.parent();\n if (p instanceof AST_New && p.expression === this) {\n // i.e. new (foo.bar().baz)\n //\n // if there's one call into this subtree, then we need\n // parens around it too, otherwise the call will be\n // interpreted as passing the arguments to the upper New\n // expression.\n var parens = false;\n this.walk(new TreeWalker(function(node) {\n if (parens || node instanceof AST_Scope) return true;\n if (node instanceof AST_Call) {\n parens = true;\n return true;\n }\n }));\n return parens;\n }\n });\n\n PARENS(AST_Call, function(output) {\n var p = output.parent(), p1;\n if (p instanceof AST_New && p.expression === this\n || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function)\n return true;\n\n // workaround for Safari bug.\n // https://bugs.webkit.org/show_bug.cgi?id=123506\n return this.expression instanceof AST_Function\n && p instanceof AST_PropAccess\n && p.expression === this\n && (p1 = output.parent(1)) instanceof AST_Assign\n && p1.left === p;\n });\n\n PARENS(AST_New, function(output) {\n var p = output.parent();\n if (!need_constructor_parens(this, output)\n && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)[\"getTime\"]()\n || p instanceof AST_Call && p.expression === this)) // (new foo)(bar)\n return true;\n });\n\n PARENS(AST_Number, function(output) {\n var p = output.parent();\n if (p instanceof AST_PropAccess && p.expression === this) {\n var value = this.getValue();\n if (value < 0 || /^0/.test(make_num(value))) {\n return true;\n }\n }\n });\n\n PARENS([ AST_Assign, AST_Conditional ], function(output) {\n var p = output.parent();\n // !(a = false) → true\n if (p instanceof AST_Unary)\n return true;\n // 1 + (a = 2) + 3 → 6, side effect setting a = 2\n if (p instanceof AST_Binary && !(p instanceof AST_Assign))\n return true;\n // (a = func)() —or— new (a = Object)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // (a = foo) ? bar : baz\n if (p instanceof AST_Conditional && p.condition === this)\n return true;\n // (a = foo)[\"prop\"] —or— (a = foo).prop\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n // ({a, b} = {a: 1, b: 2}), a destructuring assignment\n if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false)\n return true;\n });\n\n /* -----[ PRINTERS ]----- */\n\n DEFPRINT(AST_Directive, function(self, output) {\n output.print_string(self.value, self.quote);\n output.semicolon();\n });\n\n DEFPRINT(AST_Expansion, function (self, output) {\n output.print(\"...\");\n self.expression.print(output);\n });\n\n DEFPRINT(AST_Destructuring, function (self, output) {\n output.print(self.is_array ? \"[\" : \"{\");\n var len = self.names.length;\n self.names.forEach(function (name, i) {\n if (i > 0) output.comma();\n name.print(output);\n // If the final element is a hole, we need to make sure it\n // doesn't look like a trailing comma, by inserting an actual\n // trailing comma.\n if (i == len - 1 && name instanceof AST_Hole) output.comma();\n });\n output.print(self.is_array ? \"]\" : \"}\");\n });\n\n DEFPRINT(AST_Debugger, function(self, output) {\n output.print(\"debugger\");\n output.semicolon();\n });\n\n /* -----[ statements ]----- */\n\n function display_body(body, is_toplevel, output, allow_directives) {\n var last = body.length - 1;\n in_directive = allow_directives;\n body.forEach(function(stmt, i) {\n if (in_directive === true && !(stmt instanceof AST_Directive ||\n stmt instanceof AST_EmptyStatement ||\n (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String)\n )) {\n in_directive = false;\n }\n if (!(stmt instanceof AST_EmptyStatement)) {\n output.indent();\n stmt.print(output);\n if (!(i == last && is_toplevel)) {\n output.newline();\n if (is_toplevel) output.newline();\n }\n }\n if (in_directive === true &&\n stmt instanceof AST_SimpleStatement &&\n stmt.body instanceof AST_String\n ) {\n in_directive = false;\n }\n });\n in_directive = false;\n }\n\n AST_StatementWithBody.DEFMETHOD(\"_do_print_body\", function(output) {\n force_statement(this.body, output);\n });\n\n DEFPRINT(AST_Statement, function(self, output) {\n self.body.print(output);\n output.semicolon();\n });\n DEFPRINT(AST_Toplevel, function(self, output) {\n display_body(self.body, true, output, true);\n output.print(\"\");\n });\n DEFPRINT(AST_LabeledStatement, function(self, output) {\n self.label.print(output);\n output.colon();\n self.body.print(output);\n });\n DEFPRINT(AST_SimpleStatement, function(self, output) {\n self.body.print(output);\n output.semicolon();\n });\n function print_braced_empty(self, output) {\n output.print(\"{\");\n output.with_indent(output.next_indent(), function() {\n output.append_comments(self, true);\n });\n output.print(\"}\");\n }\n function print_braced(self, output, allow_directives) {\n if (self.body.length > 0) {\n output.with_block(function() {\n display_body(self.body, false, output, allow_directives);\n });\n } else print_braced_empty(self, output);\n }\n DEFPRINT(AST_BlockStatement, function(self, output) {\n print_braced(self, output);\n });\n DEFPRINT(AST_EmptyStatement, function(self, output) {\n output.semicolon();\n });\n DEFPRINT(AST_Do, function(self, output) {\n output.print(\"do\");\n output.space();\n make_block(self.body, output);\n output.space();\n output.print(\"while\");\n output.space();\n output.with_parens(function() {\n self.condition.print(output);\n });\n output.semicolon();\n });\n DEFPRINT(AST_While, function(self, output) {\n output.print(\"while\");\n output.space();\n output.with_parens(function() {\n self.condition.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_For, function(self, output) {\n output.print(\"for\");\n output.space();\n output.with_parens(function() {\n if (self.init) {\n if (self.init instanceof AST_Definitions) {\n self.init.print(output);\n } else {\n parenthesize_for_noin(self.init, output, true);\n }\n output.print(\";\");\n output.space();\n } else {\n output.print(\";\");\n }\n if (self.condition) {\n self.condition.print(output);\n output.print(\";\");\n output.space();\n } else {\n output.print(\";\");\n }\n if (self.step) {\n self.step.print(output);\n }\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_ForIn, function(self, output) {\n output.print(\"for\");\n if (self.await) {\n output.space();\n output.print(\"await\");\n }\n output.space();\n output.with_parens(function() {\n self.init.print(output);\n output.space();\n output.print(self instanceof AST_ForOf ? \"of\" : \"in\");\n output.space();\n self.object.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_With, function(self, output) {\n output.print(\"with\");\n output.space();\n output.with_parens(function() {\n self.expression.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n\n /* -----[ functions ]----- */\n AST_Lambda.DEFMETHOD(\"_do_print\", function(output, nokeyword) {\n var self = this;\n if (!nokeyword) {\n if (self.async) {\n output.print(\"async\");\n output.space();\n }\n output.print(\"function\");\n if (self.is_generator) {\n output.star();\n }\n if (self.name) {\n output.space();\n }\n }\n if (self.name instanceof AST_Symbol) {\n self.name.print(output);\n } else if (nokeyword && self.name instanceof AST_Node) {\n output.with_square(function() {\n self.name.print(output); // Computed method name\n });\n }\n output.with_parens(function() {\n self.argnames.forEach(function(arg, i) {\n if (i) output.comma();\n arg.print(output);\n });\n });\n output.space();\n print_braced(self, output, true);\n });\n DEFPRINT(AST_Lambda, function(self, output) {\n self._do_print(output);\n });\n\n DEFPRINT(AST_PrefixedTemplateString, function(self, output) {\n var tag = self.prefix;\n var parenthesize_tag = tag instanceof AST_Arrow\n || tag instanceof AST_Binary\n || tag instanceof AST_Conditional\n || tag instanceof AST_Sequence\n || tag instanceof AST_Unary;\n if (parenthesize_tag) output.print(\"(\");\n self.prefix.print(output);\n if (parenthesize_tag) output.print(\")\");\n self.template_string.print(output);\n });\n DEFPRINT(AST_TemplateString, function(self, output) {\n var is_tagged = output.parent() instanceof AST_PrefixedTemplateString;\n\n output.print(\"`\");\n for (var i = 0; i < self.segments.length; i++) {\n if (!(self.segments[i] instanceof AST_TemplateSegment)) {\n output.print(\"${\");\n self.segments[i].print(output);\n output.print(\"}\");\n } else if (is_tagged) {\n output.print(self.segments[i].raw);\n } else {\n output.print_template_string_chars(self.segments[i].value);\n }\n }\n output.print(\"`\");\n });\n\n AST_Arrow.DEFMETHOD(\"_do_print\", function(output) {\n var self = this;\n var parent = output.parent();\n var needs_parens = parent instanceof AST_Binary ||\n parent instanceof AST_Unary ||\n (parent instanceof AST_Call && self === parent.expression);\n if (needs_parens) { output.print(\"(\"); }\n if (self.async) {\n output.print(\"async\");\n output.space();\n }\n if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) {\n self.argnames[0].print(output);\n } else {\n output.with_parens(function() {\n self.argnames.forEach(function(arg, i) {\n if (i) output.comma();\n arg.print(output);\n });\n });\n }\n output.space();\n output.print(\"=>\");\n output.space();\n if (self.body instanceof AST_Node) {\n self.body.print(output);\n } else {\n print_braced(self, output);\n }\n if (needs_parens) { output.print(\")\"); }\n });\n\n /* -----[ exits ]----- */\n AST_Exit.DEFMETHOD(\"_do_print\", function(output, kind) {\n output.print(kind);\n if (this.value) {\n output.space();\n this.value.print(output);\n }\n output.semicolon();\n });\n DEFPRINT(AST_Return, function(self, output) {\n self._do_print(output, \"return\");\n });\n DEFPRINT(AST_Throw, function(self, output) {\n self._do_print(output, \"throw\");\n });\n\n /* -----[ yield ]----- */\n\n DEFPRINT(AST_Yield, function(self, output) {\n var star = self.is_star ? \"*\" : \"\";\n output.print(\"yield\" + star);\n if (self.expression) {\n output.space();\n self.expression.print(output);\n }\n });\n\n DEFPRINT(AST_Await, function(self, output) {\n output.print(\"await\");\n output.space();\n var e = self.expression;\n var parens = !(\n e instanceof AST_Call\n || e instanceof AST_SymbolRef\n || e instanceof AST_PropAccess\n || e instanceof AST_Unary\n || e instanceof AST_Constant\n );\n if (parens) output.print(\"(\");\n self.expression.print(output);\n if (parens) output.print(\")\");\n });\n\n /* -----[ loop control ]----- */\n AST_LoopControl.DEFMETHOD(\"_do_print\", function(output, kind) {\n output.print(kind);\n if (this.label) {\n output.space();\n this.label.print(output);\n }\n output.semicolon();\n });\n DEFPRINT(AST_Break, function(self, output) {\n self._do_print(output, \"break\");\n });\n DEFPRINT(AST_Continue, function(self, output) {\n self._do_print(output, \"continue\");\n });\n\n /* -----[ if ]----- */\n function make_then(self, output) {\n var b = self.body;\n if (output.option(\"braces\")\n || output.option(\"ie8\") && b instanceof AST_Do)\n return make_block(b, output);\n // The squeezer replaces \"block\"-s that contain only a single\n // statement with the statement itself; technically, the AST\n // is correct, but this can create problems when we output an\n // IF having an ELSE clause where the THEN clause ends in an\n // IF *without* an ELSE block (then the outer ELSE would refer\n // to the inner IF). This function checks for this case and\n // adds the block braces if needed.\n if (!b) return output.force_semicolon();\n while (true) {\n if (b instanceof AST_If) {\n if (!b.alternative) {\n make_block(self.body, output);\n return;\n }\n b = b.alternative;\n } else if (b instanceof AST_StatementWithBody) {\n b = b.body;\n } else break;\n }\n force_statement(self.body, output);\n }\n DEFPRINT(AST_If, function(self, output) {\n output.print(\"if\");\n output.space();\n output.with_parens(function() {\n self.condition.print(output);\n });\n output.space();\n if (self.alternative) {\n make_then(self, output);\n output.space();\n output.print(\"else\");\n output.space();\n if (self.alternative instanceof AST_If)\n self.alternative.print(output);\n else\n force_statement(self.alternative, output);\n } else {\n self._do_print_body(output);\n }\n });\n\n /* -----[ switch ]----- */\n DEFPRINT(AST_Switch, function(self, output) {\n output.print(\"switch\");\n output.space();\n output.with_parens(function() {\n self.expression.print(output);\n });\n output.space();\n var last = self.body.length - 1;\n if (last < 0) print_braced_empty(self, output);\n else output.with_block(function() {\n self.body.forEach(function(branch, i) {\n output.indent(true);\n branch.print(output);\n if (i < last && branch.body.length > 0)\n output.newline();\n });\n });\n });\n AST_SwitchBranch.DEFMETHOD(\"_do_print_body\", function(output) {\n output.newline();\n this.body.forEach(function(stmt) {\n output.indent();\n stmt.print(output);\n output.newline();\n });\n });\n DEFPRINT(AST_Default, function(self, output) {\n output.print(\"default:\");\n self._do_print_body(output);\n });\n DEFPRINT(AST_Case, function(self, output) {\n output.print(\"case\");\n output.space();\n self.expression.print(output);\n output.print(\":\");\n self._do_print_body(output);\n });\n\n /* -----[ exceptions ]----- */\n DEFPRINT(AST_Try, function(self, output) {\n output.print(\"try\");\n output.space();\n print_braced(self, output);\n if (self.bcatch) {\n output.space();\n self.bcatch.print(output);\n }\n if (self.bfinally) {\n output.space();\n self.bfinally.print(output);\n }\n });\n DEFPRINT(AST_Catch, function(self, output) {\n output.print(\"catch\");\n if (self.argname) {\n output.space();\n output.with_parens(function() {\n self.argname.print(output);\n });\n }\n output.space();\n print_braced(self, output);\n });\n DEFPRINT(AST_Finally, function(self, output) {\n output.print(\"finally\");\n output.space();\n print_braced(self, output);\n });\n\n /* -----[ var/const ]----- */\n AST_Definitions.DEFMETHOD(\"_do_print\", function(output, kind) {\n output.print(kind);\n output.space();\n this.definitions.forEach(function(def, i) {\n if (i) output.comma();\n def.print(output);\n });\n var p = output.parent();\n var in_for = p instanceof AST_For || p instanceof AST_ForIn;\n var output_semicolon = !in_for || p && p.init !== this;\n if (output_semicolon)\n output.semicolon();\n });\n DEFPRINT(AST_Let, function(self, output) {\n self._do_print(output, \"let\");\n });\n DEFPRINT(AST_Var, function(self, output) {\n self._do_print(output, \"var\");\n });\n DEFPRINT(AST_Const, function(self, output) {\n self._do_print(output, \"const\");\n });\n DEFPRINT(AST_Import, function(self, output) {\n output.print(\"import\");\n output.space();\n if (self.imported_name) {\n self.imported_name.print(output);\n }\n if (self.imported_name && self.imported_names) {\n output.print(\",\");\n output.space();\n }\n if (self.imported_names) {\n if (self.imported_names.length === 1 && self.imported_names[0].foreign_name.name === \"*\") {\n self.imported_names[0].print(output);\n } else {\n output.print(\"{\");\n self.imported_names.forEach(function (name_import, i) {\n output.space();\n name_import.print(output);\n if (i < self.imported_names.length - 1) {\n output.print(\",\");\n }\n });\n output.space();\n output.print(\"}\");\n }\n }\n if (self.imported_name || self.imported_names) {\n output.space();\n output.print(\"from\");\n output.space();\n }\n self.module_name.print(output);\n output.semicolon();\n });\n\n DEFPRINT(AST_NameMapping, function(self, output) {\n var is_import = output.parent() instanceof AST_Import;\n var definition = self.name.definition();\n var names_are_different =\n (definition && definition.mangled_name || self.name.name) !==\n self.foreign_name.name;\n if (names_are_different) {\n if (is_import) {\n output.print(self.foreign_name.name);\n } else {\n self.name.print(output);\n }\n output.space();\n output.print(\"as\");\n output.space();\n if (is_import) {\n self.name.print(output);\n } else {\n output.print(self.foreign_name.name);\n }\n } else {\n self.name.print(output);\n }\n });\n\n DEFPRINT(AST_Export, function(self, output) {\n output.print(\"export\");\n output.space();\n if (self.is_default) {\n output.print(\"default\");\n output.space();\n }\n if (self.exported_names) {\n if (self.exported_names.length === 1 && self.exported_names[0].name.name === \"*\") {\n self.exported_names[0].print(output);\n } else {\n output.print(\"{\");\n self.exported_names.forEach(function(name_export, i) {\n output.space();\n name_export.print(output);\n if (i < self.exported_names.length - 1) {\n output.print(\",\");\n }\n });\n output.space();\n output.print(\"}\");\n }\n } else if (self.exported_value) {\n self.exported_value.print(output);\n } else if (self.exported_definition) {\n self.exported_definition.print(output);\n if (self.exported_definition instanceof AST_Definitions) return;\n }\n if (self.module_name) {\n output.space();\n output.print(\"from\");\n output.space();\n self.module_name.print(output);\n }\n if (self.exported_value\n && !(self.exported_value instanceof AST_Defun ||\n self.exported_value instanceof AST_Function ||\n self.exported_value instanceof AST_Class)\n || self.module_name\n || self.exported_names\n ) {\n output.semicolon();\n }\n });\n\n function parenthesize_for_noin(node, output, noin) {\n var parens = false;\n // need to take some precautions here:\n // https://github.com/mishoo/UglifyJS2/issues/60\n if (noin) node.walk(new TreeWalker(function(node) {\n if (parens || node instanceof AST_Scope) return true;\n if (node instanceof AST_Binary && node.operator == \"in\") {\n parens = true;\n return true;\n }\n }));\n node.print(output, parens);\n }\n\n DEFPRINT(AST_VarDef, function(self, output) {\n self.name.print(output);\n if (self.value) {\n output.space();\n output.print(\"=\");\n output.space();\n var p = output.parent(1);\n var noin = p instanceof AST_For || p instanceof AST_ForIn;\n parenthesize_for_noin(self.value, output, noin);\n }\n });\n\n /* -----[ other expressions ]----- */\n DEFPRINT(AST_Call, function(self, output) {\n self.expression.print(output);\n if (self instanceof AST_New && !need_constructor_parens(self, output))\n return;\n if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) {\n output.add_mapping(self.start);\n }\n output.with_parens(function() {\n self.args.forEach(function(expr, i) {\n if (i) output.comma();\n expr.print(output);\n });\n });\n });\n DEFPRINT(AST_New, function(self, output) {\n output.print(\"new\");\n output.space();\n AST_Call.prototype._codegen(self, output);\n });\n\n AST_Sequence.DEFMETHOD(\"_do_print\", function(output) {\n this.expressions.forEach(function(node, index) {\n if (index > 0) {\n output.comma();\n if (output.should_break()) {\n output.newline();\n output.indent();\n }\n }\n node.print(output);\n });\n });\n DEFPRINT(AST_Sequence, function(self, output) {\n self._do_print(output);\n // var p = output.parent();\n // if (p instanceof AST_Statement) {\n // output.with_indent(output.next_indent(), function(){\n // self._do_print(output);\n // });\n // } else {\n // self._do_print(output);\n // }\n });\n DEFPRINT(AST_Dot, function(self, output) {\n var expr = self.expression;\n expr.print(output);\n var prop = self.property;\n if (output.option(\"ie8\") && RESERVED_WORDS(prop)) {\n output.print(\"[\");\n output.add_mapping(self.end);\n output.print_string(prop);\n output.print(\"]\");\n } else {\n if (expr instanceof AST_Number && expr.getValue() >= 0) {\n if (!/[xa-f.)]/i.test(output.last())) {\n output.print(\".\");\n }\n }\n output.print(\".\");\n // the name after dot would be mapped about here.\n output.add_mapping(self.end);\n output.print_name(prop);\n }\n });\n DEFPRINT(AST_Sub, function(self, output) {\n self.expression.print(output);\n output.print(\"[\");\n self.property.print(output);\n output.print(\"]\");\n });\n DEFPRINT(AST_UnaryPrefix, function(self, output) {\n var op = self.operator;\n output.print(op);\n if (/^[a-z]/i.test(op)\n || (/[+-]$/.test(op)\n && self.expression instanceof AST_UnaryPrefix\n && /^[+-]/.test(self.expression.operator))) {\n output.space();\n }\n self.expression.print(output);\n });\n DEFPRINT(AST_UnaryPostfix, function(self, output) {\n self.expression.print(output);\n output.print(self.operator);\n });\n DEFPRINT(AST_Binary, function(self, output) {\n var op = self.operator;\n self.left.print(output);\n if (op[0] == \">\" /* \">>\" \">>>\" \">\" \">=\" */\n && self.left instanceof AST_UnaryPostfix\n && self.left.operator == \"--\") {\n // space is mandatory to avoid outputting -->\n output.print(\" \");\n } else {\n // the space is optional depending on \"beautify\"\n output.space();\n }\n output.print(op);\n if ((op == \"<\" || op == \"<<\")\n && self.right instanceof AST_UnaryPrefix\n && self.right.operator == \"!\"\n && self.right.expression instanceof AST_UnaryPrefix\n && self.right.expression.operator == \"--\") {\n // space is mandatory to avoid outputting x ? y : false\n if (self.left.operator == \"||\") {\n var lr = self.left.right.evaluate(compressor);\n if (!lr) return make_node(AST_Conditional, self, {\n condition: self.left.left,\n consequent: self.right,\n alternative: self.left.right\n }).optimize(compressor);\n }\n break;\n case \"||\":\n var ll = self.left.truthy ? true : self.left.falsy ? false : self.left.evaluate(compressor);\n if (!ll) {\n compressor.warn(\"Condition left of || always false [{file}:{line},{col}]\", self.start);\n return make_sequence(self, [ self.left, self.right ]).optimize(compressor);\n } else if (!(ll instanceof AST_Node)) {\n compressor.warn(\"Condition left of || always true [{file}:{line},{col}]\", self.start);\n return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor);\n }\n var rr = self.right.evaluate(compressor);\n if (!rr) {\n var parent = compressor.parent();\n if (parent.operator == \"||\" && parent.left === compressor.self() || compressor.in_boolean_context()) {\n compressor.warn(\"Dropping side-effect-free || [{file}:{line},{col}]\", self.start);\n return self.left.optimize(compressor);\n }\n } else if (!(rr instanceof AST_Node)) {\n if (compressor.in_boolean_context()) {\n compressor.warn(\"Boolean || always true [{file}:{line},{col}]\", self.start);\n return make_sequence(self, [\n self.left,\n make_node(AST_True, self)\n ]).optimize(compressor);\n } else self.truthy = true;\n }\n if (self.left.operator == \"&&\") {\n var lr = self.left.right.evaluate(compressor);\n if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, {\n condition: self.left.left,\n consequent: self.left.right,\n alternative: self.right\n }).optimize(compressor);\n }\n break;\n }\n var associative = true;\n switch (self.operator) {\n case \"+\":\n // \"foo\" + (\"bar\" + x) => \"foobar\" + x\n if (self.left instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == \"+\"\n && self.right.left instanceof AST_Constant\n && self.right.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: make_node(AST_String, self.left, {\n value: \"\" + self.left.getValue() + self.right.left.getValue(),\n start: self.left.start,\n end: self.right.left.end\n }),\n right: self.right.right\n });\n }\n // (x + \"foo\") + \"bar\" => x + \"foobar\"\n if (self.right instanceof AST_Constant\n && self.left instanceof AST_Binary\n && self.left.operator == \"+\"\n && self.left.right instanceof AST_Constant\n && self.left.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: self.left.left,\n right: make_node(AST_String, self.right, {\n value: \"\" + self.left.right.getValue() + self.right.getValue(),\n start: self.left.right.start,\n end: self.right.end\n })\n });\n }\n // (x + \"foo\") + (\"bar\" + y) => (x + \"foobar\") + y\n if (self.left instanceof AST_Binary\n && self.left.operator == \"+\"\n && self.left.is_string(compressor)\n && self.left.right instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == \"+\"\n && self.right.left instanceof AST_Constant\n && self.right.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: make_node(AST_Binary, self.left, {\n operator: \"+\",\n left: self.left.left,\n right: make_node(AST_String, self.left.right, {\n value: \"\" + self.left.right.getValue() + self.right.left.getValue(),\n start: self.left.right.start,\n end: self.right.left.end\n })\n }),\n right: self.right.right\n });\n }\n // a + -b => a - b\n if (self.right instanceof AST_UnaryPrefix\n && self.right.operator == \"-\"\n && self.left.is_number(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"-\",\n left: self.left,\n right: self.right.expression\n });\n break;\n }\n // -a + b => b - a\n if (self.left instanceof AST_UnaryPrefix\n && self.left.operator == \"-\"\n && reversible()\n && self.right.is_number(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"-\",\n left: self.right,\n right: self.left.expression\n });\n break;\n }\n case \"*\":\n associative = compressor.option(\"unsafe_math\");\n case \"&\":\n case \"|\":\n case \"^\":\n // a + +b => +b + a\n if (self.left.is_number(compressor)\n && self.right.is_number(compressor)\n && reversible()\n && !(self.left instanceof AST_Binary\n && self.left.operator != self.operator\n && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {\n var reversed = make_node(AST_Binary, self, {\n operator: self.operator,\n left: self.right,\n right: self.left\n });\n if (self.right instanceof AST_Constant\n && !(self.left instanceof AST_Constant)) {\n self = best_of(compressor, reversed, self);\n } else {\n self = best_of(compressor, self, reversed);\n }\n }\n if (associative && self.is_number(compressor)) {\n // a + (b + c) => (a + b) + c\n if (self.right instanceof AST_Binary\n && self.right.operator == self.operator) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: self.left,\n right: self.right.left,\n start: self.left.start,\n end: self.right.left.end\n }),\n right: self.right.right\n });\n }\n // (n + 2) + 3 => 5 + n\n // (2 * n) * 3 => 6 + n\n if (self.right instanceof AST_Constant\n && self.left instanceof AST_Binary\n && self.left.operator == self.operator) {\n if (self.left.left instanceof AST_Constant) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: self.left.left,\n right: self.right,\n start: self.left.left.start,\n end: self.right.end\n }),\n right: self.left.right\n });\n } else if (self.left.right instanceof AST_Constant) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: self.left.right,\n right: self.right,\n start: self.left.right.start,\n end: self.right.end\n }),\n right: self.left.left\n });\n }\n }\n // (a | 1) | (2 | d) => (3 | a) | b\n if (self.left instanceof AST_Binary\n && self.left.operator == self.operator\n && self.left.right instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == self.operator\n && self.right.left instanceof AST_Constant) {\n self = make_node(AST_Binary, self, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left, {\n operator: self.operator,\n left: make_node(AST_Binary, self.left.left, {\n operator: self.operator,\n left: self.left.right,\n right: self.right.left,\n start: self.left.right.start,\n end: self.right.left.end\n }),\n right: self.left.left\n }),\n right: self.right.right\n });\n }\n }\n }\n }\n // x && (y && z) ==> x && y && z\n // x || (y || z) ==> x || y || z\n // x + (\"y\" + z) ==> x + \"y\" + z\n // \"x\" + (y + \"z\")==> \"x\" + y + \"z\"\n if (self.right instanceof AST_Binary\n && self.right.operator == self.operator\n && (lazy_op(self.operator)\n || (self.operator == \"+\"\n && (self.right.left.is_string(compressor)\n || (self.left.is_string(compressor)\n && self.right.right.is_string(compressor)))))\n ) {\n self.left = make_node(AST_Binary, self.left, {\n operator : self.operator,\n left : self.left,\n right : self.right.left\n });\n self.right = self.right.right;\n return self.transform(compressor);\n }\n var ev = self.evaluate(compressor);\n if (ev !== self) {\n ev = make_node_from_constant(ev, self).optimize(compressor);\n return best_of(compressor, ev, self);\n }\n return self;\n });\n\n OPT(AST_SymbolExport, function(self, compressor) {\n return self;\n });\n\n function recursive_ref(compressor, def) {\n var node;\n for (var i = 0; node = compressor.parent(i); i++) {\n if (node instanceof AST_Lambda) {\n var name = node.name;\n if (name && name.definition() === def) break;\n }\n }\n return node;\n }\n\n function within_array_or_object_literal(compressor) {\n var node, level = 0;\n while (node = compressor.parent(level++)) {\n if (node instanceof AST_Statement) return false;\n if (node instanceof AST_Array\n || node instanceof AST_ObjectKeyVal\n || node instanceof AST_Object) {\n return true;\n }\n }\n return false;\n }\n\n OPT(AST_SymbolRef, function(self, compressor) {\n if (!compressor.option(\"ie8\")\n && is_undeclared_ref(self)\n && (!self.scope.uses_with || !compressor.find_parent(AST_With))) {\n switch (self.name) {\n case \"undefined\":\n return make_node(AST_Undefined, self).optimize(compressor);\n case \"NaN\":\n return make_node(AST_NaN, self).optimize(compressor);\n case \"Infinity\":\n return make_node(AST_Infinity, self).optimize(compressor);\n }\n }\n var parent = compressor.parent();\n if (compressor.option(\"reduce_vars\") && is_lhs(self, parent) !== self) {\n var d = self.definition();\n if (compressor.top_retain && d.global && compressor.top_retain(d)) {\n d.fixed = false;\n d.should_replace = false;\n d.single_use = false;\n return self;\n }\n var fixed = self.fixed_value();\n var single_use = d.single_use\n && !(parent instanceof AST_Call && parent.is_expr_pure(compressor));\n if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) {\n if (retain_top_func(fixed, compressor)) {\n single_use = false;\n } else if (d.scope !== self.scope\n && (!compressor.option(\"reduce_funcs\") && fixed instanceof AST_Lambda\n || d.escaped == 1\n || fixed.inlined\n || within_array_or_object_literal(compressor))) {\n single_use = false;\n } else if (recursive_ref(compressor, d)) {\n single_use = false;\n } else if (d.scope !== self.scope || d.orig[0] instanceof AST_SymbolFunarg) {\n single_use = fixed.is_constant_expression(self.scope);\n if (single_use == \"f\") {\n var scope = self.scope;\n do {\n if (scope instanceof AST_Defun || is_func_expr(scope)) {\n scope.inlined = true;\n }\n } while (scope = scope.parent_scope);\n }\n }\n }\n if (single_use && fixed) {\n if (fixed instanceof AST_DefClass) {\n fixed = make_node(AST_ClassExpression, fixed, fixed);\n }\n if (fixed instanceof AST_Defun) {\n fixed._squeezed = true;\n fixed = make_node(AST_Function, fixed, fixed);\n }\n var value;\n if (d.recursive_refs > 0 && fixed.name instanceof AST_SymbolDefun) {\n value = fixed.clone(true);\n var defun_def = value.name.definition();\n var lambda_def = value.variables.get(value.name.name);\n var name = lambda_def && lambda_def.orig[0];\n if (!(name instanceof AST_SymbolLambda)) {\n name = make_node(AST_SymbolLambda, value.name, value.name);\n name.scope = value;\n value.name = name;\n lambda_def = value.def_function(name);\n }\n value.walk(new TreeWalker(function(node) {\n if (node instanceof AST_SymbolRef && node.definition() === defun_def) {\n node.thedef = lambda_def;\n lambda_def.references.push(node);\n }\n }));\n } else {\n value = fixed.optimize(compressor);\n if (value === fixed) value = fixed.clone(true);\n }\n return value;\n }\n if (fixed && d.should_replace === undefined) {\n var init;\n if (fixed instanceof AST_This) {\n if (!(d.orig[0] instanceof AST_SymbolFunarg)\n && all(d.references, function(ref) {\n return d.scope === ref.scope;\n })) {\n init = fixed;\n }\n } else {\n var ev = fixed.evaluate(compressor);\n if (ev !== fixed && (compressor.option(\"unsafe_regexp\") || !(ev instanceof RegExp))) {\n init = make_node_from_constant(ev, fixed);\n }\n }\n if (init) {\n var value_length = init.optimize(compressor).print_to_string().length;\n var fn;\n if (has_symbol_ref(fixed)) {\n fn = function() {\n var result = init.optimize(compressor);\n return result === init ? result.clone(true) : result;\n };\n } else {\n value_length = Math.min(value_length, fixed.print_to_string().length);\n fn = function() {\n var result = best_of_expression(init.optimize(compressor), fixed);\n return result === init || result === fixed ? result.clone(true) : result;\n };\n }\n var name_length = d.name.length;\n var overhead = 0;\n if (compressor.option(\"unused\") && !compressor.exposed(d)) {\n overhead = (name_length + 2 + value_length) / (d.references.length - d.assignments);\n }\n d.should_replace = value_length <= name_length + overhead ? fn : false;\n } else {\n d.should_replace = false;\n }\n }\n if (d.should_replace) {\n return d.should_replace();\n }\n }\n return self;\n\n function has_symbol_ref(value) {\n var found;\n value.walk(new TreeWalker(function(node) {\n if (node instanceof AST_SymbolRef) found = true;\n if (found) return true;\n }));\n return found;\n }\n });\n\n function is_atomic(lhs, self) {\n return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE;\n }\n\n OPT(AST_Undefined, function(self, compressor) {\n if (compressor.option(\"unsafe_undefined\")) {\n var undef = find_variable(compressor, \"undefined\");\n if (undef) {\n var ref = make_node(AST_SymbolRef, self, {\n name : \"undefined\",\n scope : undef.scope,\n thedef : undef\n });\n ref.is_undefined = true;\n return ref;\n }\n }\n var lhs = is_lhs(compressor.self(), compressor.parent());\n if (lhs && is_atomic(lhs, self)) return self;\n return make_node(AST_UnaryPrefix, self, {\n operator: \"void\",\n expression: make_node(AST_Number, self, {\n value: 0\n })\n });\n });\n\n OPT(AST_Infinity, function(self, compressor) {\n var lhs = is_lhs(compressor.self(), compressor.parent());\n if (lhs && is_atomic(lhs, self)) return self;\n if (compressor.option(\"keep_infinity\")\n && !(lhs && !is_atomic(lhs, self))\n && !find_variable(compressor, \"Infinity\"))\n return self;\n return make_node(AST_Binary, self, {\n operator: \"/\",\n left: make_node(AST_Number, self, {\n value: 1\n }),\n right: make_node(AST_Number, self, {\n value: 0\n })\n });\n });\n\n OPT(AST_NaN, function(self, compressor) {\n var lhs = is_lhs(compressor.self(), compressor.parent());\n if (lhs && !is_atomic(lhs, self)\n || find_variable(compressor, \"NaN\")) {\n return make_node(AST_Binary, self, {\n operator: \"/\",\n left: make_node(AST_Number, self, {\n value: 0\n }),\n right: make_node(AST_Number, self, {\n value: 0\n })\n });\n }\n return self;\n });\n\n function is_reachable(self, defs) {\n var reachable = false;\n var find_ref = new TreeWalker(function(node) {\n if (reachable) return true;\n if (node instanceof AST_SymbolRef && member(node.definition(), defs)) {\n return reachable = true;\n }\n });\n var scan_scope = new TreeWalker(function(node) {\n if (reachable) return true;\n if (node instanceof AST_Scope && node !== self) {\n var parent = scan_scope.parent();\n if (parent instanceof AST_Call && parent.expression === node) return;\n node.walk(find_ref);\n return true;\n }\n });\n self.walk(scan_scope);\n return reachable;\n }\n\n var ASSIGN_OPS = [ \"+\", \"-\", \"/\", \"*\", \"%\", \">>\", \"<<\", \">>>\", \"|\", \"^\", \"&\" ];\n var ASSIGN_OPS_COMMUTATIVE = [ \"*\", \"|\", \"^\", \"&\" ];\n OPT(AST_Assign, function(self, compressor) {\n var def;\n if (compressor.option(\"dead_code\")\n && self.left instanceof AST_SymbolRef\n && (def = self.left.definition()).scope === compressor.find_parent(AST_Lambda)) {\n var level = 0, node, parent = self;\n do {\n node = parent;\n parent = compressor.parent(level++);\n if (parent instanceof AST_Exit) {\n if (in_try(level, parent)) break;\n if (is_reachable(def.scope, [ def ])) break;\n if (self.operator == \"=\") return self.right;\n def.fixed = false;\n return make_node(AST_Binary, self, {\n operator: self.operator.slice(0, -1),\n left: self.left,\n right: self.right\n }).optimize(compressor);\n }\n } while (parent instanceof AST_Binary && parent.right === node\n || parent instanceof AST_Sequence && parent.tail_node() === node);\n }\n self = self.lift_sequences(compressor);\n if (self.operator == \"=\" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary) {\n // x = expr1 OP expr2\n if (self.right.left instanceof AST_SymbolRef\n && self.right.left.name == self.left.name\n && member(self.right.operator, ASSIGN_OPS)) {\n // x = x - 2 ---> x -= 2\n self.operator = self.right.operator + \"=\";\n self.right = self.right.right;\n } else if (self.right.right instanceof AST_SymbolRef\n && self.right.right.name == self.left.name\n && member(self.right.operator, ASSIGN_OPS_COMMUTATIVE)\n && !self.right.left.has_side_effects(compressor)) {\n // x = 2 & x ---> x &= 2\n self.operator = self.right.operator + \"=\";\n self.right = self.right.left;\n }\n }\n return self;\n\n function in_try(level, node) {\n var right = self.right;\n self.right = make_node(AST_Null, right);\n var may_throw = node.may_throw(compressor);\n self.right = right;\n var scope = self.left.definition().scope;\n var parent;\n while ((parent = compressor.parent(level++)) !== scope) {\n if (parent instanceof AST_Try) {\n if (parent.bfinally) return true;\n if (may_throw && parent.bcatch) return true;\n }\n }\n }\n });\n\n OPT(AST_DefaultAssign, function(self, compressor) {\n if (!compressor.option(\"evaluate\")) {\n return self;\n }\n var evaluateRight = self.right.evaluate(compressor);\n\n // `[x = undefined] = foo` ---> `[x] = foo`\n if (evaluateRight === undefined) {\n self = self.left;\n } else if (evaluateRight !== self.right) {\n evaluateRight = make_node_from_constant(evaluateRight, self.right);\n self.right = best_of_expression(evaluateRight, self.right);\n }\n\n return self;\n });\n\n OPT(AST_Conditional, function(self, compressor) {\n if (!compressor.option(\"conditionals\")) return self;\n // This looks like lift_sequences(), should probably be under \"sequences\"\n if (self.condition instanceof AST_Sequence) {\n var expressions = self.condition.expressions.slice();\n self.condition = expressions.pop();\n expressions.push(self);\n return make_sequence(self, expressions);\n }\n var cond = self.condition.evaluate(compressor);\n if (cond !== self.condition) {\n if (cond) {\n compressor.warn(\"Condition always true [{file}:{line},{col}]\", self.start);\n return maintain_this_binding(compressor.parent(), compressor.self(), self.consequent);\n } else {\n compressor.warn(\"Condition always false [{file}:{line},{col}]\", self.start);\n return maintain_this_binding(compressor.parent(), compressor.self(), self.alternative);\n }\n }\n var negated = cond.negate(compressor, first_in_statement(compressor));\n if (best_of(compressor, cond, negated) === negated) {\n self = make_node(AST_Conditional, self, {\n condition: negated,\n consequent: self.alternative,\n alternative: self.consequent\n });\n }\n var condition = self.condition;\n var consequent = self.consequent;\n var alternative = self.alternative;\n // x?x:y --> x||y\n if (condition instanceof AST_SymbolRef\n && consequent instanceof AST_SymbolRef\n && condition.definition() === consequent.definition()) {\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: condition,\n right: alternative\n });\n }\n // if (foo) exp = something; else exp = something_else;\n // |\n // v\n // exp = foo ? something : something_else;\n if (consequent instanceof AST_Assign\n && alternative instanceof AST_Assign\n && consequent.operator == alternative.operator\n && consequent.left.equivalent_to(alternative.left)\n && (!self.condition.has_side_effects(compressor)\n || consequent.operator == \"=\"\n && !consequent.left.has_side_effects(compressor))) {\n return make_node(AST_Assign, self, {\n operator: consequent.operator,\n left: consequent.left,\n right: make_node(AST_Conditional, self, {\n condition: self.condition,\n consequent: consequent.right,\n alternative: alternative.right\n })\n });\n }\n // x ? y(a) : y(b) --> y(x ? a : b)\n var arg_index;\n if (consequent instanceof AST_Call\n && alternative.TYPE === consequent.TYPE\n && consequent.args.length > 0\n && consequent.args.length == alternative.args.length\n && consequent.expression.equivalent_to(alternative.expression)\n && !self.condition.has_side_effects(compressor)\n && !consequent.expression.has_side_effects(compressor)\n && typeof (arg_index = single_arg_diff()) == \"number\") {\n var node = consequent.clone();\n node.args[arg_index] = make_node(AST_Conditional, self, {\n condition: self.condition,\n consequent: consequent.args[arg_index],\n alternative: alternative.args[arg_index]\n });\n return node;\n }\n // x?y?z:a:a --> x&&y?z:a\n if (consequent instanceof AST_Conditional\n && consequent.alternative.equivalent_to(alternative)) {\n return make_node(AST_Conditional, self, {\n condition: make_node(AST_Binary, self, {\n left: self.condition,\n operator: \"&&\",\n right: consequent.condition\n }),\n consequent: consequent.consequent,\n alternative: alternative\n });\n }\n // x ? y : y --> x, y\n if (consequent.equivalent_to(alternative)) {\n return make_sequence(self, [\n self.condition,\n consequent\n ]).optimize(compressor);\n }\n // x ? y || z : z --> x && y || z\n if (consequent instanceof AST_Binary\n && consequent.operator == \"||\"\n && consequent.right.equivalent_to(alternative)) {\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: make_node(AST_Binary, self, {\n operator: \"&&\",\n left: self.condition,\n right: consequent.left\n }),\n right: alternative\n }).optimize(compressor);\n }\n var in_bool = compressor.in_boolean_context();\n if (is_true(self.consequent)) {\n if (is_false(self.alternative)) {\n // c ? true : false ---> !!c\n return booleanize(self.condition);\n }\n // c ? true : x ---> !!c || x\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: booleanize(self.condition),\n right: self.alternative\n });\n }\n if (is_false(self.consequent)) {\n if (is_true(self.alternative)) {\n // c ? false : true ---> !c\n return booleanize(self.condition.negate(compressor));\n }\n // c ? false : x ---> !c && x\n return make_node(AST_Binary, self, {\n operator: \"&&\",\n left: booleanize(self.condition.negate(compressor)),\n right: self.alternative\n });\n }\n if (is_true(self.alternative)) {\n // c ? x : true ---> !c || x\n return make_node(AST_Binary, self, {\n operator: \"||\",\n left: booleanize(self.condition.negate(compressor)),\n right: self.consequent\n });\n }\n if (is_false(self.alternative)) {\n // c ? x : false ---> !!c && x\n return make_node(AST_Binary, self, {\n operator: \"&&\",\n left: booleanize(self.condition),\n right: self.consequent\n });\n }\n\n return self;\n\n function booleanize(node) {\n if (node.is_boolean()) return node;\n // !!expression\n return make_node(AST_UnaryPrefix, node, {\n operator: \"!\",\n expression: node.negate(compressor)\n });\n }\n\n // AST_True or !0\n function is_true(node) {\n return node instanceof AST_True\n || in_bool\n && node instanceof AST_Constant\n && node.getValue()\n || (node instanceof AST_UnaryPrefix\n && node.operator == \"!\"\n && node.expression instanceof AST_Constant\n && !node.expression.getValue());\n }\n // AST_False or !1\n function is_false(node) {\n return node instanceof AST_False\n || in_bool\n && node instanceof AST_Constant\n && !node.getValue()\n || (node instanceof AST_UnaryPrefix\n && node.operator == \"!\"\n && node.expression instanceof AST_Constant\n && node.expression.getValue());\n }\n\n function single_arg_diff() {\n var a = consequent.args;\n var b = alternative.args;\n for (var i = 0, len = a.length; i < len; i++) {\n if (a[i] instanceof AST_Expansion) return;\n if (!a[i].equivalent_to(b[i])) {\n if (b[i] instanceof AST_Expansion) return;\n for (var j = i + 1; j < len; j++) {\n if (a[j] instanceof AST_Expansion) return;\n if (!a[j].equivalent_to(b[j])) return;\n }\n return i;\n }\n }\n }\n });\n\n OPT(AST_Boolean, function(self, compressor) {\n if (compressor.in_boolean_context()) return make_node(AST_Number, self, {\n value: +self.value\n });\n var p = compressor.parent();\n if (compressor.option(\"booleans_as_integers\")) {\n if (p instanceof AST_Binary && (p.operator == \"===\" || p.operator == \"!==\")) {\n p.operator = p.operator.replace(/=$/, \"\");\n }\n return make_node(AST_Number, self, {\n value: +self.value\n });\n }\n if (compressor.option(\"booleans\")) {\n if (p instanceof AST_Binary && (p.operator == \"==\"\n || p.operator == \"!=\")) {\n compressor.warn(\"Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]\", {\n operator : p.operator,\n value : self.value,\n file : p.start.file,\n line : p.start.line,\n col : p.start.col,\n });\n return make_node(AST_Number, self, {\n value: +self.value\n });\n }\n return make_node(AST_UnaryPrefix, self, {\n operator: \"!\",\n expression: make_node(AST_Number, self, {\n value: 1 - self.value\n })\n });\n }\n return self;\n });\n\n function safe_to_flatten(value, compressor) {\n if (value instanceof AST_SymbolRef) {\n value = value.fixed_value();\n }\n if (!value) return false;\n return !(value instanceof AST_Lambda || value instanceof AST_Class)\n || compressor.parent() instanceof AST_New\n || !value.contains_this();\n }\n\n OPT(AST_Sub, function(self, compressor) {\n var expr = self.expression;\n var prop = self.property;\n if (compressor.option(\"properties\")) {\n var key = prop.evaluate(compressor);\n if (key !== prop) {\n if (typeof key == \"string\") {\n if (key == \"undefined\") {\n key = undefined;\n } else {\n var value = parseFloat(key);\n if (value.toString() == key) {\n key = value;\n }\n }\n }\n prop = self.property = best_of_expression(prop, make_node_from_constant(key, prop).transform(compressor));\n var property = \"\" + key;\n if (is_identifier_string(property)\n && property.length <= prop.print_to_string().length + 1) {\n return make_node(AST_Dot, self, {\n expression: expr,\n property: property\n }).optimize(compressor);\n }\n }\n }\n var fn;\n OPT_ARGUMENTS: if (compressor.option(\"arguments\")\n && expr instanceof AST_SymbolRef\n && expr.name == \"arguments\"\n && expr.definition().orig.length == 1\n && (fn = expr.scope) instanceof AST_Lambda\n && fn.uses_arguments\n && !(fn instanceof AST_Arrow)\n && prop instanceof AST_Number) {\n var index = prop.getValue();\n var params = Object.create(null);\n var argnames = fn.argnames;\n for (var n = 0; n < argnames.length; n++) {\n if (!(argnames[n] instanceof AST_SymbolFunarg)) {\n break OPT_ARGUMENTS; // destructuring parameter - bail\n }\n var param = argnames[n].name;\n if (param in params) {\n break OPT_ARGUMENTS; // duplicate parameter - bail\n }\n params[param] = true;\n }\n var argname = fn.argnames[index];\n if (argname && compressor.has_directive(\"use strict\")) {\n var def = argname.definition();\n if (!compressor.option(\"reduce_vars\") || def.assignments || def.orig.length > 1) {\n argname = null;\n }\n } else if (!argname && !compressor.option(\"keep_fargs\") && index < fn.argnames.length + 5) {\n while (index >= fn.argnames.length) {\n argname = make_node(AST_SymbolFunarg, fn, {\n name: fn.make_var_name(\"argument_\" + fn.argnames.length),\n scope: fn\n });\n fn.argnames.push(argname);\n fn.enclosed.push(fn.def_variable(argname));\n }\n }\n if (argname) {\n var sym = make_node(AST_SymbolRef, self, argname);\n sym.reference({});\n delete argname.__unused;\n return sym;\n }\n }\n if (is_lhs(self, compressor.parent())) return self;\n if (key !== prop) {\n var sub = self.flatten_object(property, compressor);\n if (sub) {\n expr = self.expression = sub.expression;\n prop = self.property = sub.property;\n }\n }\n if (compressor.option(\"properties\") && compressor.option(\"side_effects\")\n && prop instanceof AST_Number && expr instanceof AST_Array) {\n var index = prop.getValue();\n var elements = expr.elements;\n var retValue = elements[index];\n FLATTEN: if (safe_to_flatten(retValue, compressor)) {\n var flatten = true;\n var values = [];\n for (var i = elements.length; --i > index;) {\n var value = elements[i].drop_side_effect_free(compressor);\n if (value) {\n values.unshift(value);\n if (flatten && value.has_side_effects(compressor)) flatten = false;\n }\n }\n if (retValue instanceof AST_Expansion) break FLATTEN;\n retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue;\n if (!flatten) values.unshift(retValue);\n while (--i >= 0) {\n var value = elements[i];\n if (value instanceof AST_Expansion) break FLATTEN;\n value = value.drop_side_effect_free(compressor);\n if (value) values.unshift(value);\n else index--;\n }\n if (flatten) {\n values.push(retValue);\n return make_sequence(self, values).optimize(compressor);\n } else return make_node(AST_Sub, self, {\n expression: make_node(AST_Array, expr, {\n elements: values\n }),\n property: make_node(AST_Number, prop, {\n value: index\n })\n });\n }\n }\n var ev = self.evaluate(compressor);\n if (ev !== self) {\n ev = make_node_from_constant(ev, self).optimize(compressor);\n return best_of(compressor, ev, self);\n }\n return self;\n });\n\n AST_Lambda.DEFMETHOD(\"contains_this\", function() {\n var result;\n var self = this;\n self.walk(new TreeWalker(function(node) {\n if (result) return true;\n if (node instanceof AST_This) return result = true;\n if (node !== self && node instanceof AST_Scope && !(node instanceof AST_Arrow)) return true;\n }));\n return result;\n });\n\n AST_PropAccess.DEFMETHOD(\"flatten_object\", function(key, compressor) {\n if (!compressor.option(\"properties\")) return;\n var arrows = compressor.option(\"unsafe_arrows\") && compressor.option(\"ecma\") >= 6;\n var expr = this.expression;\n if (expr instanceof AST_Object) {\n var props = expr.properties;\n for (var i = props.length; --i >= 0;) {\n var prop = props[i];\n if (\"\" + (prop instanceof AST_ConciseMethod ? prop.key.name : prop.key) == key) {\n if (!all(props, function(prop) {\n return prop instanceof AST_ObjectKeyVal\n || arrows && prop instanceof AST_ConciseMethod && !prop.is_generator;\n })) break;\n if (!safe_to_flatten(prop.value, compressor)) break;\n return make_node(AST_Sub, this, {\n expression: make_node(AST_Array, expr, {\n elements: props.map(function(prop) {\n var v = prop.value;\n if (v instanceof AST_Accessor) v = make_node(AST_Function, v, v);\n var k = prop.key;\n if (k instanceof AST_Node && !(k instanceof AST_SymbolMethod)) {\n return make_sequence(prop, [ k, v ]);\n }\n return v;\n })\n }),\n property: make_node(AST_Number, this, {\n value: i\n })\n });\n }\n }\n }\n });\n\n OPT(AST_Dot, function(self, compressor) {\n if (self.property == \"arguments\" || self.property == \"caller\") {\n compressor.warn(\"Function.protoype.{prop} not supported [{file}:{line},{col}]\", {\n prop: self.property,\n file: self.start.file,\n line: self.start.line,\n col: self.start.col\n });\n }\n if (is_lhs(self, compressor.parent())) return self;\n if (compressor.option(\"unsafe_proto\")\n && self.expression instanceof AST_Dot\n && self.expression.property == \"prototype\") {\n var exp = self.expression.expression;\n if (is_undeclared_ref(exp)) switch (exp.name) {\n case \"Array\":\n self.expression = make_node(AST_Array, self.expression, {\n elements: []\n });\n break;\n case \"Function\":\n self.expression = make_node(AST_Function, self.expression, {\n argnames: [],\n body: []\n });\n break;\n case \"Number\":\n self.expression = make_node(AST_Number, self.expression, {\n value: 0\n });\n break;\n case \"Object\":\n self.expression = make_node(AST_Object, self.expression, {\n properties: []\n });\n break;\n case \"RegExp\":\n self.expression = make_node(AST_RegExp, self.expression, {\n value: /t/\n });\n break;\n case \"String\":\n self.expression = make_node(AST_String, self.expression, {\n value: \"\"\n });\n break;\n }\n }\n var sub = self.flatten_object(self.property, compressor);\n if (sub) return sub.optimize(compressor);\n var ev = self.evaluate(compressor);\n if (ev !== self) {\n ev = make_node_from_constant(ev, self).optimize(compressor);\n return best_of(compressor, ev, self);\n }\n return self;\n });\n\n function literals_in_boolean_context(self, compressor) {\n if (compressor.in_boolean_context()) {\n return best_of(compressor, self, make_sequence(self, [\n self,\n make_node(AST_True, self)\n ]).optimize(compressor));\n }\n return self;\n }\n OPT(AST_Array, literals_in_boolean_context);\n OPT(AST_Object, literals_in_boolean_context);\n OPT(AST_RegExp, literals_in_boolean_context);\n\n OPT(AST_Return, function(self, compressor) {\n if (self.value && is_undefined(self.value, compressor)) {\n self.value = null;\n }\n return self;\n });\n\n OPT(AST_Arrow, function(self, compressor) {\n if (!(self.body instanceof AST_Node)) {\n self = opt_AST_Lambda(self, compressor);\n }\n if (compressor.option(\"arrows\")\n && self.body.length == 1\n && self.body[0] instanceof AST_Return) {\n var value = self.body[0].value;\n self.body = value ? value : [];\n }\n return self;\n });\n\n OPT(AST_Function, function(self, compressor) {\n self = opt_AST_Lambda(self, compressor);\n if (compressor.option(\"unsafe_arrows\")\n && compressor.option(\"ecma\") >= 6\n && !self.name\n && !self.is_generator\n && !self.uses_arguments\n && !self.pinned()) {\n var has_special_symbol = false;\n self.walk(new TreeWalker(function(node) {\n if (has_special_symbol) return true;\n if (node instanceof AST_This) {\n has_special_symbol = true;\n return true;\n }\n }));\n if (!has_special_symbol) return make_node(AST_Arrow, self, self).optimize(compressor);\n }\n return self;\n });\n\n OPT(AST_Class, function(self, compressor) {\n // HACK to avoid compress failure.\n // AST_Class is not really an AST_Scope/AST_Block as it lacks a body.\n return self;\n });\n\n OPT(AST_Yield, function(self, compressor) {\n if (self.expression && !self.is_star && is_undefined(self.expression, compressor)) {\n self.expression = null;\n }\n return self;\n });\n\n OPT(AST_TemplateString, function(self, compressor) {\n if (!compressor.option(\"evaluate\")\n || compressor.parent() instanceof AST_PrefixedTemplateString)\n return self;\n\n var segments = [];\n for (var i = 0; i < self.segments.length; i++) {\n var segment = self.segments[i];\n if (segment instanceof AST_Node) {\n var result = segment.evaluate(compressor);\n // Evaluate to constant value\n // Constant value shorter than ${segment}\n if (result !== segment && (result + \"\").length <= segment.print_to_string().length + \"${}\".length) {\n // There should always be a previous and next segment if segment is a node\n segments[segments.length - 1].value = segments[segments.length - 1].value + result + self.segments[++i].value;\n continue;\n }\n }\n segments.push(segment);\n }\n self.segments = segments;\n\n return segments.length == 1 ? make_node(AST_String, self, segments[0]) : self;\n });\n\n OPT(AST_PrefixedTemplateString, function(self, compressor) {\n return self;\n });\n\n // [\"p\"]:1 ---> p:1\n // [42]:1 ---> 42:1\n function lift_key(self, compressor) {\n if (!compressor.option(\"computed_props\")) return self;\n // save a comparison in the typical case\n if (!(self.key instanceof AST_Constant)) return self;\n // whitelist acceptable props as not all AST_Constants are true constants\n if (self.key instanceof AST_String || self.key instanceof AST_Number) {\n if (self.key.value === \"__proto__\") return self;\n if (self.key.value == \"constructor\"\n && compressor.parent() instanceof AST_Class) return self;\n if (self instanceof AST_ObjectKeyVal) {\n self.key = self.key.value;\n } else {\n self.key = make_node(AST_SymbolMethod, self.key, {\n name: self.key.value\n });\n }\n }\n return self;\n }\n\n OPT(AST_ObjectProperty, lift_key);\n\n OPT(AST_ConciseMethod, function(self, compressor) {\n lift_key(self, compressor);\n // p(){return x;} ---> p:()=>x\n if (compressor.option(\"arrows\")\n && compressor.parent() instanceof AST_Object\n && !self.is_generator\n && !self.value.uses_arguments\n && !self.value.pinned()\n && self.value.body.length == 1\n && self.value.body[0] instanceof AST_Return\n && self.value.body[0].value\n && !self.value.contains_this()) {\n var arrow = make_node(AST_Arrow, self.value, self.value);\n arrow.async = self.async;\n arrow.is_generator = self.is_generator;\n return make_node(AST_ObjectKeyVal, self, {\n key: self.key instanceof AST_SymbolMethod ? self.key.name : self.key,\n value: arrow,\n quote: self.quote,\n });\n }\n return self;\n });\n\n OPT(AST_ObjectKeyVal, function(self, compressor) {\n lift_key(self, compressor);\n // p:function(){} ---> p(){}\n // p:function*(){} ---> *p(){}\n // p:async function(){} ---> async p(){}\n // p:()=>{} ---> p(){}\n // p:async()=>{} ---> async p(){}\n var unsafe_methods = compressor.option(\"unsafe_methods\");\n if (unsafe_methods\n && compressor.option(\"ecma\") >= 6\n && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + \"\"))) {\n var key = self.key;\n var value = self.value;\n var is_arrow_with_block = value instanceof AST_Arrow\n && Array.isArray(value.body)\n && !value.contains_this();\n if ((is_arrow_with_block || value instanceof AST_Function) && !value.name) {\n return make_node(AST_ConciseMethod, self, {\n async: value.async,\n is_generator: value.is_generator,\n key: key instanceof AST_Node ? key : make_node(AST_SymbolMethod, self, {\n name: key,\n }),\n value: make_node(AST_Accessor, value, value),\n quote: self.quote,\n });\n }\n }\n return self;\n });\n\n OPT(AST_Destructuring, function(self, compressor) {\n if (compressor.option(\"pure_getters\") == true\n && compressor.option(\"unused\")\n && !self.is_array\n && Array.isArray(self.names)\n && !is_destructuring_export_decl(compressor)) {\n var keep = [];\n for (var i = 0; i < self.names.length; i++) {\n var elem = self.names[i];\n if (!(elem instanceof AST_ObjectKeyVal\n && typeof elem.key == \"string\"\n && elem.value instanceof AST_SymbolDeclaration\n && !should_retain(compressor, elem.value.definition()))) {\n keep.push(elem);\n }\n }\n if (keep.length != self.names.length) {\n self.names = keep;\n }\n }\n return self;\n\n function is_destructuring_export_decl(compressor) {\n var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/];\n for (var a = 0, p = 0, len = ancestors.length; a < len; p++) {\n var parent = compressor.parent(p);\n if (!parent) return false;\n if (a === 0 && parent.TYPE == \"Destructuring\") continue;\n if (!ancestors[a].test(parent.TYPE)) {\n return false;\n }\n a++;\n }\n return true;\n }\n\n function should_retain(compressor, def) {\n if (def.references.length) return true;\n if (!def.global) return false;\n if (compressor.toplevel.vars) {\n if (compressor.top_retain) {\n return compressor.top_retain(def);\n }\n return false;\n }\n return true;\n }\n });\n})();\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction find_builtins(reserved) {\n reserved.push.apply(reserved, domprops);\n\n // Compatibility fix for some standard defined globals not defined on every js environment\n var new_globals = [\"Symbol\", \"Map\", \"Promise\", \"Proxy\", \"Reflect\", \"Set\", \"WeakMap\", \"WeakSet\"];\n var objects = {};\n var global_ref = typeof global === \"object\" ? global : self;\n\n new_globals.forEach(function (new_global) {\n objects[new_global] = global_ref[new_global] || new Function();\n });\n\n // NaN will be included due to Number.NaN\n [\n \"null\",\n \"true\",\n \"false\",\n \"Infinity\",\n \"-Infinity\",\n \"undefined\",\n ].forEach(add);\n [ Object, Array, Function, Number,\n String, Boolean, Error, Math,\n Date, RegExp, objects.Symbol, ArrayBuffer,\n DataView, decodeURI, decodeURIComponent,\n encodeURI, encodeURIComponent, eval, EvalError,\n Float32Array, Float64Array, Int8Array, Int16Array,\n Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat,\n parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError,\n objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array,\n Uint8ClampedArray, Uint16Array, Uint32Array, URIError,\n objects.WeakMap, objects.WeakSet\n ].forEach(function(ctor) {\n Object.getOwnPropertyNames(ctor).map(add);\n if (ctor.prototype) {\n Object.getOwnPropertyNames(ctor.prototype).map(add);\n }\n });\n function add(name) {\n push_uniq(reserved, name);\n }\n}\n\nfunction reserve_quoted_keys(ast, reserved) {\n function add(name) {\n push_uniq(reserved, name);\n }\n\n ast.walk(new TreeWalker(function(node) {\n if (node instanceof AST_ObjectKeyVal && node.quote) {\n add(node.key);\n } else if (node instanceof AST_ObjectProperty && node.quote) {\n add(node.key.name);\n } else if (node instanceof AST_Sub) {\n addStrings(node.property, add);\n }\n }));\n}\n\nfunction addStrings(node, add) {\n node.walk(new TreeWalker(function(node) {\n if (node instanceof AST_Sequence) {\n addStrings(node.tail_node(), add);\n } else if (node instanceof AST_String) {\n add(node.value);\n } else if (node instanceof AST_Conditional) {\n addStrings(node.consequent, add);\n addStrings(node.alternative, add);\n }\n return true;\n }));\n}\n\nfunction mangle_properties(ast, options) {\n options = defaults(options, {\n builtins: false,\n cache: null,\n debug: false,\n keep_quoted: false,\n only_cache: false,\n regex: null,\n reserved: null,\n }, true);\n\n var reserved = options.reserved;\n if (!Array.isArray(reserved)) reserved = [reserved];\n if (!options.builtins) find_builtins(reserved);\n\n var cname = -1;\n var cache;\n if (options.cache) {\n cache = options.cache.props;\n cache.each(function(mangled_name) {\n push_uniq(reserved, mangled_name);\n });\n } else {\n cache = new Dictionary();\n }\n\n var regex = options.regex;\n\n // note debug is either false (disabled), or a string of the debug suffix to use (enabled).\n // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true'\n // the same as passing an empty string.\n var debug = options.debug !== false;\n var debug_name_suffix;\n if (debug) {\n debug_name_suffix = (options.debug === true ? \"\" : options.debug);\n }\n\n var names_to_mangle = [];\n var unmangleable = [];\n\n // step 1: find candidates to mangle\n ast.walk(new TreeWalker(function(node) {\n if (node instanceof AST_ObjectKeyVal) {\n if (typeof node.key == \"string\") {\n add(node.key);\n }\n } else if (node instanceof AST_ObjectProperty) {\n // setter or getter, since KeyVal is handled above\n add(node.key.name);\n } else if (node instanceof AST_Dot) {\n var root = node;\n while (root.expression) {\n root = root.expression;\n }\n if (!(root.thedef && root.thedef.undeclared)) add(node.property);\n } else if (node instanceof AST_Sub) {\n addStrings(node.property, add);\n } else if (node instanceof AST_Call\n && node.expression.print_to_string() == \"Object.defineProperty\") {\n addStrings(node.args[1], add);\n }\n }));\n\n // step 2: transform the tree, renaming properties\n return ast.transform(new TreeTransformer(function(node) {\n if (node instanceof AST_ObjectKeyVal) {\n if (typeof node.key == \"string\") {\n node.key = mangle(node.key);\n }\n } else if (node instanceof AST_ObjectProperty) {\n // setter or getter\n node.key.name = mangle(node.key.name);\n } else if (node instanceof AST_Dot) {\n node.property = mangle(node.property);\n } else if (!options.keep_quoted && node instanceof AST_Sub) {\n node.property = mangleStrings(node.property);\n } else if (node instanceof AST_Call\n && node.expression.print_to_string() == \"Object.defineProperty\") {\n node.args[1] = mangleStrings(node.args[1]);\n }\n }));\n\n // only function declarations after this line\n\n function can_mangle(name) {\n if (unmangleable.indexOf(name) >= 0) return false;\n if (reserved.indexOf(name) >= 0) return false;\n if (options.only_cache) {\n return cache.has(name);\n }\n if (/^-?[0-9]+(\\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false;\n return true;\n }\n\n function should_mangle(name) {\n if (regex && !regex.test(name)) return false;\n if (reserved.indexOf(name) >= 0) return false;\n return cache.has(name)\n || names_to_mangle.indexOf(name) >= 0;\n }\n\n function add(name) {\n if (can_mangle(name))\n push_uniq(names_to_mangle, name);\n\n if (!should_mangle(name)) {\n push_uniq(unmangleable, name);\n }\n }\n\n function mangle(name) {\n if (!should_mangle(name)) {\n return name;\n }\n\n var mangled = cache.get(name);\n if (!mangled) {\n if (debug) {\n // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo -> o._$foo$NNN_.\n var debug_mangled = \"_$\" + name + \"$\" + debug_name_suffix + \"_\";\n\n if (can_mangle(debug_mangled)) {\n mangled = debug_mangled;\n }\n }\n\n // either debug mode is off, or it is on and we could not use the mangled name\n if (!mangled) {\n do {\n mangled = base54(++cname);\n } while (!can_mangle(mangled));\n }\n\n cache.set(name, mangled);\n }\n return mangled;\n }\n\n function mangleStrings(node) {\n return node.transform(new TreeTransformer(function(node) {\n if (node instanceof AST_Sequence) {\n var last = node.expressions.length - 1;\n node.expressions[last] = mangleStrings(node.expressions[last]);\n } else if (node instanceof AST_String) {\n node.value = mangle(node.value);\n } else if (node instanceof AST_Conditional) {\n node.consequent = mangleStrings(node.consequent);\n node.alternative = mangleStrings(node.alternative);\n }\n return node;\n }));\n }\n}\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n(function() {\n\n var normalize_directives = function(body) {\n var in_directive = true;\n\n for (var i = 0; i < body.length; i++) {\n if (in_directive && body[i] instanceof AST_Statement && body[i].body instanceof AST_String) {\n body[i] = new AST_Directive({\n start: body[i].start,\n end: body[i].end,\n value: body[i].body.value\n });\n } else if (in_directive && !(body[i] instanceof AST_Statement && body[i].body instanceof AST_String)) {\n in_directive = false;\n }\n }\n\n return body;\n };\n\n var MOZ_TO_ME = {\n Program: function(M) {\n return new AST_Toplevel({\n start: my_start_token(M),\n end: my_end_token(M),\n body: normalize_directives(M.body.map(from_moz))\n });\n },\n ArrayPattern: function(M) {\n return new AST_Destructuring({\n start: my_start_token(M),\n end: my_end_token(M),\n names: M.elements.map(function(elm) {\n if (elm === null) {\n return new AST_Hole();\n }\n return from_moz(elm);\n }),\n is_array: true\n });\n },\n ObjectPattern: function(M) {\n return new AST_Destructuring({\n start: my_start_token(M),\n end: my_end_token(M),\n names: M.properties.map(from_moz),\n is_array: false\n });\n },\n AssignmentPattern: function(M) {\n return new AST_Binary({\n start: my_start_token(M),\n end: my_end_token(M),\n left: from_moz(M.left),\n operator: \"=\",\n right: from_moz(M.right)\n });\n },\n SpreadElement: function(M) {\n return new AST_Expansion({\n start: my_start_token(M),\n end: my_end_token(M),\n expression: from_moz(M.argument)\n });\n },\n RestElement: function(M) {\n return new AST_Expansion({\n start: my_start_token(M),\n end: my_end_token(M),\n expression: from_moz(M.argument)\n });\n },\n TemplateElement: function(M) {\n return new AST_TemplateSegment({\n start: my_start_token(M),\n end: my_end_token(M),\n value: M.value.cooked,\n raw: M.value.raw\n });\n },\n TemplateLiteral: function(M) {\n var segments = [];\n for (var i = 0; i < M.quasis.length; i++) {\n segments.push(from_moz(M.quasis[i]));\n if (M.expressions[i]) {\n segments.push(from_moz(M.expressions[i]));\n }\n }\n return new AST_TemplateString({\n start: my_start_token(M),\n end: my_end_token(M),\n segments: segments\n });\n },\n TaggedTemplateExpression: function(M) {\n return new AST_PrefixedTemplateString({\n start: my_start_token(M),\n end: my_end_token(M),\n template_string: from_moz(M.quasi),\n prefix: from_moz(M.tag)\n });\n },\n FunctionDeclaration: function(M) {\n return new AST_Defun({\n start: my_start_token(M),\n end: my_end_token(M),\n name: from_moz(M.id),\n argnames: M.params.map(from_moz),\n is_generator: M.generator,\n async: M.async,\n body: normalize_directives(from_moz(M.body).body)\n });\n },\n FunctionExpression: function(M) {\n return new AST_Function({\n start: my_start_token(M),\n end: my_end_token(M),\n name: from_moz(M.id),\n argnames: M.params.map(from_moz),\n is_generator: M.generator,\n async: M.async,\n body: normalize_directives(from_moz(M.body).body)\n });\n },\n ArrowFunctionExpression: function(M) {\n return new AST_Arrow({\n start: my_start_token(M),\n end: my_end_token(M),\n argnames: M.params.map(from_moz),\n body: from_moz(M.body),\n async: M.async,\n });\n },\n ExpressionStatement: function(M) {\n return new AST_SimpleStatement({\n start: my_start_token(M),\n end: my_end_token(M),\n body: from_moz(M.expression)\n });\n },\n TryStatement: function(M) {\n var handlers = M.handlers || [M.handler];\n if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) {\n throw new Error(\"Multiple catch clauses are not supported.\");\n }\n return new AST_Try({\n start : my_start_token(M),\n end : my_end_token(M),\n body : from_moz(M.block).body,\n bcatch : from_moz(handlers[0]),\n bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null\n });\n },\n Property: function(M) {\n var key = M.key;\n var args = {\n start : my_start_token(key || M.value),\n end : my_end_token(M.value),\n key : key.type == \"Identifier\" ? key.name : key.value,\n value : from_moz(M.value)\n };\n if (M.computed) {\n args.key = from_moz(M.key);\n }\n if (M.method) {\n args.is_generator = M.value.generator;\n args.async = M.value.async;\n if (!M.computed) {\n args.key = new AST_SymbolMethod({ name: args.key });\n } else {\n args.key = from_moz(M.key);\n }\n return new AST_ConciseMethod(args);\n }\n if (M.kind == \"init\") {\n if (key.type != \"Identifier\" && key.type != \"Literal\") {\n args.key = from_moz(key);\n }\n return new AST_ObjectKeyVal(args);\n }\n if (typeof args.key === \"string\" || typeof args.key === \"number\") {\n args.key = new AST_SymbolMethod({\n name: args.key\n });\n }\n args.value = new AST_Accessor(args.value);\n if (M.kind == \"get\") return new AST_ObjectGetter(args);\n if (M.kind == \"set\") return new AST_ObjectSetter(args);\n if (M.kind == \"method\") {\n args.async = M.value.async;\n args.is_generator = M.value.generator;\n args.quote = M.computed ? \"\\\"\" : null;\n return new AST_ConciseMethod(args);\n }\n },\n MethodDefinition: function(M) {\n var args = {\n start : my_start_token(M),\n end : my_end_token(M),\n key : M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }),\n value : from_moz(M.value),\n static : M.static,\n };\n if (M.kind == \"get\") {\n return new AST_ObjectGetter(args);\n }\n if (M.kind == \"set\") {\n return new AST_ObjectSetter(args);\n }\n args.is_generator = M.value.generator;\n args.async = M.value.async;\n return new AST_ConciseMethod(args);\n },\n ArrayExpression: function(M) {\n return new AST_Array({\n start : my_start_token(M),\n end : my_end_token(M),\n elements : M.elements.map(function(elem) {\n return elem === null ? new AST_Hole() : from_moz(elem);\n })\n });\n },\n ObjectExpression: function(M) {\n return new AST_Object({\n start : my_start_token(M),\n end : my_end_token(M),\n properties : M.properties.map(function(prop) {\n if (prop.type === \"SpreadElement\") {\n return from_moz(prop);\n }\n prop.type = \"Property\";\n return from_moz(prop);\n })\n });\n },\n SequenceExpression: function(M) {\n return new AST_Sequence({\n start : my_start_token(M),\n end : my_end_token(M),\n expressions: M.expressions.map(from_moz)\n });\n },\n MemberExpression: function(M) {\n return new (M.computed ? AST_Sub : AST_Dot)({\n start : my_start_token(M),\n end : my_end_token(M),\n property : M.computed ? from_moz(M.property) : M.property.name,\n expression : from_moz(M.object)\n });\n },\n SwitchCase: function(M) {\n return new (M.test ? AST_Case : AST_Default)({\n start : my_start_token(M),\n end : my_end_token(M),\n expression : from_moz(M.test),\n body : M.consequent.map(from_moz)\n });\n },\n VariableDeclaration: function(M) {\n return new (M.kind === \"const\" ? AST_Const :\n M.kind === \"let\" ? AST_Let : AST_Var)({\n start : my_start_token(M),\n end : my_end_token(M),\n definitions : M.declarations.map(from_moz)\n });\n },\n \n ImportDeclaration: function(M) {\n var imported_name = null;\n var imported_names = null;\n M.specifiers.forEach(function (specifier) {\n if (specifier.type === \"ImportSpecifier\") {\n if (!imported_names) { imported_names = []; }\n imported_names.push(new AST_NameMapping({\n start: my_start_token(specifier),\n end: my_end_token(specifier),\n foreign_name: from_moz(specifier.imported),\n name: from_moz(specifier.local)\n }));\n } else if (specifier.type === \"ImportDefaultSpecifier\") {\n imported_name = from_moz(specifier.local);\n } else if (specifier.type === \"ImportNamespaceSpecifier\") {\n if (!imported_names) { imported_names = []; }\n imported_names.push(new AST_NameMapping({\n start: my_start_token(specifier),\n end: my_end_token(specifier),\n foreign_name: new AST_SymbolImportForeign({ name: \"*\" }),\n name: from_moz(specifier.local)\n }));\n }\n });\n return new AST_Import({\n start : my_start_token(M),\n end : my_end_token(M),\n imported_name: imported_name,\n imported_names : imported_names,\n module_name : from_moz(M.source)\n });\n },\n ExportAllDeclaration: function(M) {\n return new AST_Export({\n start: my_start_token(M),\n end: my_end_token(M),\n exported_names: [\n new AST_NameMapping({\n name: new AST_SymbolExportForeign({ name: \"*\" }),\n foreign_name: new AST_SymbolExportForeign({ name: \"*\" })\n })\n ],\n module_name: from_moz(M.source)\n });\n },\n ExportNamedDeclaration: function(M) {\n return new AST_Export({\n start: my_start_token(M),\n end: my_end_token(M),\n exported_definition: from_moz(M.declaration),\n exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(function (specifier) {\n return new AST_NameMapping({\n foreign_name: from_moz(specifier.exported),\n name: from_moz(specifier.local)\n });\n }) : null,\n module_name: from_moz(M.source)\n });\n },\n ExportDefaultDeclaration: function(M) {\n return new AST_Export({\n start: my_start_token(M),\n end: my_end_token(M),\n exported_value: from_moz(M.declaration),\n is_default: true\n });\n },\n Literal: function(M) {\n var val = M.value, args = {\n start : my_start_token(M),\n end : my_end_token(M)\n };\n if (val === null) return new AST_Null(args);\n var rx = M.regex;\n if (rx && rx.pattern) {\n // RegExpLiteral as per ESTree AST spec\n args.value = new RegExp(rx.pattern, rx.flags);\n var raw = args.value.toString();\n args.value.raw_source = rx.flags\n ? raw.substring(0, raw.length - rx.flags.length) + rx.flags\n : raw;\n return new AST_RegExp(args);\n } else if (rx) {\n // support legacy RegExp\n args.value = M.regex && M.raw ? M.raw : val;\n return new AST_RegExp(args);\n }\n switch (typeof val) {\n case \"string\":\n args.value = val;\n return new AST_String(args);\n case \"number\":\n args.value = val;\n return new AST_Number(args);\n case \"boolean\":\n return new (val ? AST_True : AST_False)(args);\n }\n },\n MetaProperty: function(M) {\n if (M.meta.name === \"new\" && M.property.name === \"target\") {\n return new AST_NewTarget({\n start: my_start_token(M),\n end: my_end_token(M)\n });\n }\n },\n Identifier: function(M) {\n var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2];\n return new ( p.type == \"LabeledStatement\" ? AST_Label\n : p.type == \"VariableDeclarator\" && p.id === M ? (p.kind == \"const\" ? AST_SymbolConst : p.kind == \"let\" ? AST_SymbolLet : AST_SymbolVar)\n : /Import.*Specifier/.test(p.type) ? (p.local === M ? AST_SymbolImport : AST_SymbolImportForeign)\n : p.type == \"ExportSpecifier\" ? (p.local === M ? AST_SymbolExport : AST_SymbolExportForeign)\n : p.type == \"FunctionExpression\" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg)\n : p.type == \"FunctionDeclaration\" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg)\n : p.type == \"ArrowFunctionExpression\" ? (p.params.indexOf(M) !== -1) ? AST_SymbolFunarg : AST_SymbolRef\n : p.type == \"ClassExpression\" ? (p.id === M ? AST_SymbolClass : AST_SymbolRef)\n : p.type == \"Property\" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolMethod)\n : p.type == \"ClassDeclaration\" ? (p.id === M ? AST_SymbolDefClass : AST_SymbolRef)\n : p.type == \"MethodDefinition\" ? (p.computed ? AST_SymbolRef : AST_SymbolMethod)\n : p.type == \"CatchClause\" ? AST_SymbolCatch\n : p.type == \"BreakStatement\" || p.type == \"ContinueStatement\" ? AST_LabelRef\n : AST_SymbolRef)({\n start : my_start_token(M),\n end : my_end_token(M),\n name : M.name\n });\n }\n };\n\n MOZ_TO_ME.UpdateExpression =\n MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) {\n var prefix = \"prefix\" in M ? M.prefix\n : M.type == \"UnaryExpression\" ? true : false;\n return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({\n start : my_start_token(M),\n end : my_end_token(M),\n operator : M.operator,\n expression : from_moz(M.argument)\n });\n };\n\n MOZ_TO_ME.ClassDeclaration =\n MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) {\n return new (M.type === \"ClassDeclaration\" ? AST_DefClass : AST_ClassExpression)({\n start : my_start_token(M),\n end : my_end_token(M),\n name : from_moz(M.id),\n extends : from_moz(M.superClass),\n properties: M.body.body.map(from_moz)\n });\n };\n\n map(\"EmptyStatement\", AST_EmptyStatement);\n map(\"BlockStatement\", AST_BlockStatement, \"body@body\");\n map(\"IfStatement\", AST_If, \"test>condition, consequent>body, alternate>alternative\");\n map(\"LabeledStatement\", AST_LabeledStatement, \"label>label, body>body\");\n map(\"BreakStatement\", AST_Break, \"label>label\");\n map(\"ContinueStatement\", AST_Continue, \"label>label\");\n map(\"WithStatement\", AST_With, \"object>expression, body>body\");\n map(\"SwitchStatement\", AST_Switch, \"discriminant>expression, cases@body\");\n map(\"ReturnStatement\", AST_Return, \"argument>value\");\n map(\"ThrowStatement\", AST_Throw, \"argument>value\");\n map(\"WhileStatement\", AST_While, \"test>condition, body>body\");\n map(\"DoWhileStatement\", AST_Do, \"test>condition, body>body\");\n map(\"ForStatement\", AST_For, \"init>init, test>condition, update>step, body>body\");\n map(\"ForInStatement\", AST_ForIn, \"left>init, right>object, body>body\");\n map(\"ForOfStatement\", AST_ForOf, \"left>init, right>object, body>body, await=await\");\n map(\"AwaitExpression\", AST_Await, \"argument>expression\");\n map(\"YieldExpression\", AST_Yield, \"argument>expression, delegate=is_star\");\n map(\"DebuggerStatement\", AST_Debugger);\n map(\"VariableDeclarator\", AST_VarDef, \"id>name, init>value\");\n map(\"CatchClause\", AST_Catch, \"param>argname, body%body\");\n\n map(\"ThisExpression\", AST_This);\n map(\"Super\", AST_Super);\n map(\"BinaryExpression\", AST_Binary, \"operator=operator, left>left, right>right\");\n map(\"LogicalExpression\", AST_Binary, \"operator=operator, left>left, right>right\");\n map(\"AssignmentExpression\", AST_Assign, \"operator=operator, left>left, right>right\");\n map(\"ConditionalExpression\", AST_Conditional, \"test>condition, consequent>consequent, alternate>alternative\");\n map(\"NewExpression\", AST_New, \"callee>expression, arguments@args\");\n map(\"CallExpression\", AST_Call, \"callee>expression, arguments@args\");\n\n def_to_moz(AST_Toplevel, function To_Moz_Program(M) {\n return to_moz_scope(\"Program\", M);\n });\n\n def_to_moz(AST_Expansion, function To_Moz_Spread(M, parent) {\n return {\n type: to_moz_in_destructuring() ? \"RestElement\" : \"SpreadElement\",\n argument: to_moz(M.expression)\n };\n });\n\n def_to_moz(AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) {\n return {\n type: \"TaggedTemplateExpression\",\n tag: to_moz(M.prefix),\n quasi: to_moz(M.template_string)\n };\n });\n\n def_to_moz(AST_TemplateString, function To_Moz_TemplateLiteral(M) {\n var quasis = [];\n var expressions = [];\n for (var i = 0; i < M.segments.length; i++) {\n if (i % 2 !== 0) {\n expressions.push(to_moz(M.segments[i]));\n } else {\n quasis.push({\n type: \"TemplateElement\",\n value: {\n raw: M.segments[i].raw,\n cooked: M.segments[i].value\n },\n tail: i === M.segments.length - 1\n });\n }\n }\n return {\n type: \"TemplateLiteral\",\n quasis: quasis,\n expressions: expressions\n };\n });\n\n def_to_moz(AST_Defun, function To_Moz_FunctionDeclaration(M) {\n return {\n type: \"FunctionDeclaration\",\n id: to_moz(M.name),\n params: M.argnames.map(to_moz),\n generator: M.is_generator,\n async: M.async,\n body: to_moz_scope(\"BlockStatement\", M)\n };\n });\n\n def_to_moz(AST_Function, function To_Moz_FunctionExpression(M, parent) {\n var is_generator = parent.is_generator !== undefined ?\n parent.is_generator : M.is_generator;\n return {\n type: \"FunctionExpression\",\n id: to_moz(M.name),\n params: M.argnames.map(to_moz),\n generator: is_generator,\n async: M.async,\n body: to_moz_scope(\"BlockStatement\", M)\n };\n });\n\n def_to_moz(AST_Arrow, function To_Moz_ArrowFunctionExpression(M) {\n var body = M.body instanceof Array ? {\n type: \"BlockStatement\",\n body: M.body.map(to_moz)\n } : to_moz(M.body);\n return {\n type: \"ArrowFunctionExpression\",\n params: M.argnames.map(to_moz),\n async: M.async,\n body: body\n };\n });\n\n def_to_moz(AST_Destructuring, function To_Moz_ObjectPattern(M) {\n if (M.is_array) {\n return {\n type: \"ArrayPattern\",\n elements: M.names.map(to_moz)\n };\n }\n return {\n type: \"ObjectPattern\",\n properties: M.names.map(to_moz)\n };\n });\n\n def_to_moz(AST_Directive, function To_Moz_Directive(M) {\n return {\n type: \"ExpressionStatement\",\n expression: {\n type: \"Literal\",\n value: M.value\n }\n };\n });\n\n def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) {\n return {\n type: \"ExpressionStatement\",\n expression: to_moz(M.body)\n };\n });\n\n def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) {\n return {\n type: \"SwitchCase\",\n test: to_moz(M.expression),\n consequent: M.body.map(to_moz)\n };\n });\n\n def_to_moz(AST_Try, function To_Moz_TryStatement(M) {\n return {\n type: \"TryStatement\",\n block: to_moz_block(M),\n handler: to_moz(M.bcatch),\n guardedHandlers: [],\n finalizer: to_moz(M.bfinally)\n };\n });\n\n def_to_moz(AST_Catch, function To_Moz_CatchClause(M) {\n return {\n type: \"CatchClause\",\n param: to_moz(M.argname),\n guard: null,\n body: to_moz_block(M)\n };\n });\n\n def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) {\n return {\n type: \"VariableDeclaration\",\n kind:\n M instanceof AST_Const ? \"const\" :\n M instanceof AST_Let ? \"let\" : \"var\",\n declarations: M.definitions.map(to_moz)\n };\n });\n\n def_to_moz(AST_Export, function To_Moz_ExportDeclaration(M) {\n if (M.exported_names) {\n if (M.exported_names[0].name.name === \"*\") {\n return {\n type: \"ExportAllDeclaration\",\n source: to_moz(M.module_name)\n };\n }\n return {\n type: \"ExportNamedDeclaration\",\n specifiers: M.exported_names.map(function (name_mapping) {\n return {\n type: \"ExportSpecifier\",\n exported: to_moz(name_mapping.foreign_name),\n local: to_moz(name_mapping.name)\n };\n }),\n declaration: to_moz(M.exported_definition),\n source: to_moz(M.module_name)\n };\n }\n return {\n type: M.is_default ? \"ExportDefaultDeclaration\" : \"ExportNamedDeclaration\",\n declaration: to_moz(M.exported_value || M.exported_definition)\n };\n });\n\n def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) {\n var specifiers = [];\n if (M.imported_name) {\n specifiers.push({\n type: \"ImportDefaultSpecifier\",\n local: to_moz(M.imported_name)\n });\n }\n if (M.imported_names && M.imported_names[0].foreign_name.name === \"*\") {\n specifiers.push({\n type: \"ImportNamespaceSpecifier\",\n local: to_moz(M.imported_names[0].name)\n });\n } else if (M.imported_names) {\n M.imported_names.forEach(function(name_mapping) {\n specifiers.push({\n type: \"ImportSpecifier\",\n local: to_moz(name_mapping.name),\n imported: to_moz(name_mapping.foreign_name)\n });\n });\n }\n return {\n type: \"ImportDeclaration\",\n specifiers: specifiers,\n source: to_moz(M.module_name)\n };\n });\n\n def_to_moz(AST_Sequence, function To_Moz_SequenceExpression(M) {\n return {\n type: \"SequenceExpression\",\n expressions: M.expressions.map(to_moz)\n };\n });\n\n def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) {\n var isComputed = M instanceof AST_Sub;\n return {\n type: \"MemberExpression\",\n object: to_moz(M.expression),\n computed: isComputed,\n property: isComputed ? to_moz(M.property) : {type: \"Identifier\", name: M.property}\n };\n });\n\n def_to_moz(AST_Unary, function To_Moz_Unary(M) {\n return {\n type: M.operator == \"++\" || M.operator == \"--\" ? \"UpdateExpression\" : \"UnaryExpression\",\n operator: M.operator,\n prefix: M instanceof AST_UnaryPrefix,\n argument: to_moz(M.expression)\n };\n });\n\n def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) {\n if (M.operator == \"=\" && to_moz_in_destructuring()) {\n return {\n type: \"AssignmentPattern\",\n left: to_moz(M.left),\n right: to_moz(M.right)\n };\n }\n return {\n type: M.operator == \"&&\" || M.operator == \"||\" ? \"LogicalExpression\" : \"BinaryExpression\",\n left: to_moz(M.left),\n operator: M.operator,\n right: to_moz(M.right)\n };\n });\n\n def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) {\n return {\n type: \"ArrayExpression\",\n elements: M.elements.map(to_moz)\n };\n });\n\n def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) {\n return {\n type: \"ObjectExpression\",\n properties: M.properties.map(to_moz)\n };\n });\n\n def_to_moz(AST_ObjectProperty, function To_Moz_Property(M, parent) {\n var key = M.key instanceof AST_Node ? to_moz(M.key) : {\n type: \"Identifier\",\n value: M.key\n };\n if (typeof M.key === \"number\") {\n key = {\n type: \"Literal\",\n value: Number(M.key)\n };\n }\n if (typeof M.key === \"string\") {\n key = {\n type: \"Identifier\",\n name: M.key\n };\n }\n var kind;\n var string_or_num = typeof M.key === \"string\" || typeof M.key === \"number\";\n var computed = string_or_num ? false : !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef;\n if (M instanceof AST_ObjectKeyVal) {\n kind = \"init\";\n computed = !string_or_num;\n } else\n if (M instanceof AST_ObjectGetter) {\n kind = \"get\";\n } else\n if (M instanceof AST_ObjectSetter) {\n kind = \"set\";\n }\n if (parent instanceof AST_Class) {\n return {\n type: \"MethodDefinition\",\n computed: computed,\n kind: kind,\n static: M.static,\n key: to_moz(M.key),\n value: to_moz(M.value)\n };\n }\n return {\n type: \"Property\",\n computed: computed,\n kind: kind,\n key: key,\n value: to_moz(M.value)\n };\n });\n\n def_to_moz(AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) {\n if (parent instanceof AST_Object) {\n return {\n type: \"Property\",\n computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef,\n kind: \"init\",\n method: true,\n shorthand: false,\n key: to_moz(M.key),\n value: to_moz(M.value)\n };\n }\n return {\n type: \"MethodDefinition\",\n computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef,\n kind: M.key === \"constructor\" ? \"constructor\" : \"method\",\n static: M.static,\n key: to_moz(M.key),\n value: to_moz(M.value)\n };\n });\n\n def_to_moz(AST_Class, function To_Moz_Class(M) {\n var type = M instanceof AST_ClassExpression ? \"ClassExpression\" : \"ClassDeclaration\";\n return {\n type: type,\n superClass: to_moz(M.extends),\n id: M.name ? to_moz(M.name) : null,\n body: {\n type: \"ClassBody\",\n body: M.properties.map(to_moz)\n }\n };\n });\n\n def_to_moz(AST_NewTarget, function To_Moz_MetaProperty(M) {\n return {\n type: \"MetaProperty\",\n meta: {\n type: \"Identifier\",\n name: \"new\"\n },\n property: {\n type: \"Identifier\",\n name: \"target\"\n }\n };\n });\n\n def_to_moz(AST_Symbol, function To_Moz_Identifier(M, parent) {\n if (M instanceof AST_SymbolMethod && parent.quote) {\n return {\n type: \"Literal\",\n value: M.name\n };\n }\n var def = M.definition();\n return {\n type: \"Identifier\",\n name: def ? def.mangled_name || def.name : M.name\n };\n });\n\n def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) {\n var pattern = M.value.source;\n var flags = M.value.toString().match(/[gimuys]*$/)[0];\n return {\n type: \"Literal\",\n value: new RegExp(pattern, flags),\n raw: M.value.raw_source,\n regex: {\n pattern: pattern,\n flags: flags,\n }\n };\n });\n\n def_to_moz(AST_Constant, function To_Moz_Literal(M) {\n var value = M.value;\n if (typeof value === \"number\" && (value < 0 || (value === 0 && 1 / value < 0))) {\n return {\n type: \"UnaryExpression\",\n operator: \"-\",\n prefix: true,\n argument: {\n type: \"Literal\",\n value: -value,\n raw: M.start.raw\n }\n };\n }\n return {\n type: \"Literal\",\n value: value,\n raw: M.start.raw\n };\n });\n\n def_to_moz(AST_Atom, function To_Moz_Atom(M) {\n return {\n type: \"Identifier\",\n name: String(M.value)\n };\n });\n\n AST_Boolean.DEFMETHOD(\"to_mozilla_ast\", AST_Constant.prototype.to_mozilla_ast);\n AST_Null.DEFMETHOD(\"to_mozilla_ast\", AST_Constant.prototype.to_mozilla_ast);\n AST_Hole.DEFMETHOD(\"to_mozilla_ast\", function To_Moz_ArrayHole() { return null; });\n\n AST_Block.DEFMETHOD(\"to_mozilla_ast\", AST_BlockStatement.prototype.to_mozilla_ast);\n AST_Lambda.DEFMETHOD(\"to_mozilla_ast\", AST_Function.prototype.to_mozilla_ast);\n\n /* -----[ tools ]----- */\n\n function raw_token(moznode) {\n if (moznode.type == \"Literal\") {\n return moznode.raw != null ? moznode.raw : moznode.value + \"\";\n }\n }\n\n function my_start_token(moznode) {\n var loc = moznode.loc, start = loc && loc.start;\n var range = moznode.range;\n return new AST_Token({\n file : loc && loc.source,\n line : start && start.line,\n col : start && start.column,\n pos : range ? range[0] : moznode.start,\n endline : start && start.line,\n endcol : start && start.column,\n endpos : range ? range[0] : moznode.start,\n raw : raw_token(moznode),\n });\n }\n\n function my_end_token(moznode) {\n var loc = moznode.loc, end = loc && loc.end;\n var range = moznode.range;\n return new AST_Token({\n file : loc && loc.source,\n line : end && end.line,\n col : end && end.column,\n pos : range ? range[1] : moznode.end,\n endline : end && end.line,\n endcol : end && end.column,\n endpos : range ? range[1] : moznode.end,\n raw : raw_token(moznode),\n });\n }\n\n function map(moztype, mytype, propmap) {\n var moz_to_me = \"function From_Moz_\" + moztype + \"(M){\\n\";\n moz_to_me += \"return new U2.\" + mytype.name + \"({\\n\" +\n \"start: my_start_token(M),\\n\" +\n \"end: my_end_token(M)\";\n\n var me_to_moz = \"function To_Moz_\" + moztype + \"(M){\\n\";\n me_to_moz += \"return {\\n\" +\n \"type: \" + JSON.stringify(moztype);\n\n if (propmap) propmap.split(/\\s*,\\s*/).forEach(function(prop) {\n var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop);\n if (!m) throw new Error(\"Can't understand property map: \" + prop);\n var moz = m[1], how = m[2], my = m[3];\n moz_to_me += \",\\n\" + my + \": \";\n me_to_moz += \",\\n\" + moz + \": \";\n switch (how) {\n case \"@\":\n moz_to_me += \"M.\" + moz + \".map(from_moz)\";\n me_to_moz += \"M.\" + my + \".map(to_moz)\";\n break;\n case \">\":\n moz_to_me += \"from_moz(M.\" + moz + \")\";\n me_to_moz += \"to_moz(M.\" + my + \")\";\n break;\n case \"=\":\n moz_to_me += \"M.\" + moz;\n me_to_moz += \"M.\" + my;\n break;\n case \"%\":\n moz_to_me += \"from_moz(M.\" + moz + \").body\";\n me_to_moz += \"to_moz_block(M)\";\n break;\n default:\n throw new Error(\"Can't understand operator in propmap: \" + prop);\n }\n });\n\n moz_to_me += \"\\n})\\n}\";\n me_to_moz += \"\\n}\\n}\";\n\n //moz_to_me = parse(moz_to_me).print_to_string({ beautify: true });\n //me_to_moz = parse(me_to_moz).print_to_string({ beautify: true });\n //console.log(moz_to_me);\n\n moz_to_me = new Function(\"U2\", \"my_start_token\", \"my_end_token\", \"from_moz\", \"return(\" + moz_to_me + \")\")(\n exports, my_start_token, my_end_token, from_moz\n );\n me_to_moz = new Function(\"to_moz\", \"to_moz_block\", \"to_moz_scope\", \"return(\" + me_to_moz + \")\")(\n to_moz, to_moz_block, to_moz_scope\n );\n MOZ_TO_ME[moztype] = moz_to_me;\n def_to_moz(mytype, me_to_moz);\n }\n\n var FROM_MOZ_STACK = null;\n\n function from_moz(node) {\n FROM_MOZ_STACK.push(node);\n var ret = node != null ? MOZ_TO_ME[node.type](node) : null;\n FROM_MOZ_STACK.pop();\n return ret;\n }\n\n AST_Node.from_mozilla_ast = function(node) {\n var save_stack = FROM_MOZ_STACK;\n FROM_MOZ_STACK = [];\n var ast = from_moz(node);\n FROM_MOZ_STACK = save_stack;\n return ast;\n };\n\n function set_moz_loc(mynode, moznode, myparent) {\n var start = mynode.start;\n var end = mynode.end;\n if (start.pos != null && end.endpos != null) {\n moznode.range = [start.pos, end.endpos];\n }\n if (start.line) {\n moznode.loc = {\n start: {line: start.line, column: start.col},\n end: end.endline ? {line: end.endline, column: end.endcol} : null\n };\n if (start.file) {\n moznode.loc.source = start.file;\n }\n }\n return moznode;\n }\n\n function def_to_moz(mytype, handler) {\n mytype.DEFMETHOD(\"to_mozilla_ast\", function(parent) {\n return set_moz_loc(this, handler(this, parent));\n });\n }\n\n var TO_MOZ_STACK = null;\n\n function to_moz(node) {\n if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; }\n TO_MOZ_STACK.push(node);\n var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null;\n TO_MOZ_STACK.pop();\n if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; }\n return ast;\n }\n\n function to_moz_in_destructuring() {\n var i = TO_MOZ_STACK.length;\n while (i--) {\n if (TO_MOZ_STACK[i] instanceof AST_Destructuring) {\n return true;\n }\n }\n return false;\n }\n\n function to_moz_block(node) {\n return {\n type: \"BlockStatement\",\n body: node.body.map(to_moz)\n };\n }\n\n function to_moz_scope(type, node) {\n var body = node.body.map(to_moz);\n if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) {\n body.unshift(to_moz(new AST_EmptyStatement(node.body[0])));\n }\n return {\n type: type,\n body: body\n };\n }\n})();\n","\"use strict\";\n\nvar to_ascii = typeof atob == \"undefined\" ? function(b64) {\n if (Buffer.from && Buffer.from !== Uint8Array.from) {\n // Node >= 4.5.0\n return Buffer.from(b64, \"base64\").toString();\n } else {\n // Node < 4.5.0, old API, manual safeguards\n if (typeof b64 !== \"string\") throw new Errror(\"\\\"b64\\\" must be a string\");\n return new Buffer(b64, \"base64\").toString();\n }\n} : atob;\nvar to_base64 = typeof btoa == \"undefined\" ? function(str) {\n if (Buffer.from && Buffer.from !== Uint8Array.from) {\n // Node >= 4.5.0\n return Buffer.from(str).toString(\"base64\");\n } else {\n // Node < 4.5.0, old API, manual safeguards\n if (typeof str !== \"string\") throw new Errror(\"\\\"str\\\" must be a string\");\n return new Buffer(str).toString(\"base64\");\n }\n} : btoa;\n\nfunction read_source_map(code) {\n var match = /\\n\\/\\/# sourceMappingURL=data:application\\/json(;.*?)?;base64,(.*)/.exec(code);\n if (!match) {\n AST_Node.warn(\"inline source map not found\");\n return null;\n }\n return to_ascii(match[2]);\n}\n\nfunction set_shorthand(name, options, keys) {\n if (options[name]) {\n keys.forEach(function(key) {\n if (options[key]) {\n if (typeof options[key] != \"object\") options[key] = {};\n if (!(name in options[key])) options[key][name] = options[name];\n }\n });\n }\n}\n\nfunction init_cache(cache) {\n if (!cache) return;\n if (!(\"props\" in cache)) {\n cache.props = new Dictionary();\n } else if (!(cache.props instanceof Dictionary)) {\n cache.props = Dictionary.fromObject(cache.props);\n }\n}\n\nfunction to_json(cache) {\n return {\n props: cache.props.toObject()\n };\n}\n\nfunction minify(files, options) {\n var warn_function = AST_Node.warn_function;\n try {\n options = defaults(options, {\n compress: {},\n ecma: undefined,\n enclose: false,\n ie8: false,\n keep_classnames: undefined,\n keep_fnames: false,\n mangle: {},\n module: false,\n nameCache: null,\n output: {},\n parse: {},\n rename: undefined,\n safari10: false,\n sourceMap: false,\n timings: false,\n toplevel: false,\n warnings: false,\n wrap: false,\n }, true);\n var timings = options.timings && {\n start: Date.now()\n };\n if (options.keep_classnames === undefined) {\n options.keep_classnames = options.keep_fnames;\n }\n if (options.rename === undefined) {\n options.rename = options.compress && options.mangle;\n }\n set_shorthand(\"ecma\", options, [ \"parse\", \"compress\", \"output\" ]);\n set_shorthand(\"ie8\", options, [ \"compress\", \"mangle\", \"output\" ]);\n set_shorthand(\"keep_classnames\", options, [ \"compress\", \"mangle\" ]);\n set_shorthand(\"keep_fnames\", options, [ \"compress\", \"mangle\" ]);\n set_shorthand(\"module\", options, [ \"parse\", \"compress\", \"mangle\" ]);\n set_shorthand(\"safari10\", options, [ \"mangle\", \"output\" ]);\n set_shorthand(\"toplevel\", options, [ \"compress\", \"mangle\" ]);\n set_shorthand(\"warnings\", options, [ \"compress\" ]);\n var quoted_props;\n if (options.mangle) {\n options.mangle = defaults(options.mangle, {\n cache: options.nameCache && (options.nameCache.vars || {}),\n eval: false,\n ie8: false,\n keep_classnames: false,\n keep_fnames: false,\n module: false,\n properties: false,\n reserved: [],\n safari10: false,\n toplevel: false,\n }, true);\n if (options.mangle.properties) {\n if (typeof options.mangle.properties != \"object\") {\n options.mangle.properties = {};\n }\n if (options.mangle.properties.keep_quoted) {\n quoted_props = options.mangle.properties.reserved;\n if (!Array.isArray(quoted_props)) quoted_props = [];\n options.mangle.properties.reserved = quoted_props;\n }\n if (options.nameCache && !(\"cache\" in options.mangle.properties)) {\n options.mangle.properties.cache = options.nameCache.props || {};\n }\n }\n init_cache(options.mangle.cache);\n init_cache(options.mangle.properties.cache);\n }\n if (options.sourceMap) {\n options.sourceMap = defaults(options.sourceMap, {\n content: null,\n filename: null,\n includeSources: false,\n root: null,\n url: null,\n }, true);\n }\n var warnings = [];\n if (options.warnings && !AST_Node.warn_function) {\n AST_Node.warn_function = function(warning) {\n warnings.push(warning);\n };\n }\n if (timings) timings.parse = Date.now();\n var toplevel;\n if (files instanceof AST_Toplevel) {\n toplevel = files;\n } else {\n if (typeof files == \"string\") {\n files = [ files ];\n }\n options.parse = options.parse || {};\n options.parse.toplevel = null;\n for (var name in files) if (HOP(files, name)) {\n options.parse.filename = name;\n options.parse.toplevel = parse(files[name], options.parse);\n if (options.sourceMap && options.sourceMap.content == \"inline\") {\n if (Object.keys(files).length > 1)\n throw new Error(\"inline source map only works with singular input\");\n options.sourceMap.content = read_source_map(files[name]);\n }\n }\n toplevel = options.parse.toplevel;\n }\n if (quoted_props) {\n reserve_quoted_keys(toplevel, quoted_props);\n }\n if (options.wrap) {\n toplevel = toplevel.wrap_commonjs(options.wrap);\n }\n if (options.enclose) {\n toplevel = toplevel.wrap_enclose(options.enclose);\n }\n if (timings) timings.rename = Date.now();\n // disable rename on harmony due to expand_names bug in for-of loops\n // https://github.com/mishoo/UglifyJS2/issues/2794\n if (0 && options.rename) {\n toplevel.figure_out_scope(options.mangle);\n toplevel.expand_names(options.mangle);\n }\n if (timings) timings.compress = Date.now();\n if (options.compress) toplevel = new Compressor(options.compress).compress(toplevel);\n if (timings) timings.scope = Date.now();\n if (options.mangle) toplevel.figure_out_scope(options.mangle);\n if (timings) timings.mangle = Date.now();\n if (options.mangle) {\n base54.reset();\n toplevel.compute_char_frequency(options.mangle);\n toplevel.mangle_names(options.mangle);\n }\n if (timings) timings.properties = Date.now();\n if (options.mangle && options.mangle.properties) {\n toplevel = mangle_properties(toplevel, options.mangle.properties);\n }\n if (timings) timings.output = Date.now();\n var result = {};\n if (options.output.ast) {\n result.ast = toplevel;\n }\n if (!HOP(options.output, \"code\") || options.output.code) {\n if (options.sourceMap) {\n if (typeof options.sourceMap.content == \"string\") {\n options.sourceMap.content = JSON.parse(options.sourceMap.content);\n }\n options.output.source_map = SourceMap({\n file: options.sourceMap.filename,\n orig: options.sourceMap.content,\n root: options.sourceMap.root\n });\n if (options.sourceMap.includeSources) {\n if (files instanceof AST_Toplevel) {\n throw new Error(\"original source content unavailable\");\n } else for (var name in files) if (HOP(files, name)) {\n options.output.source_map.get().setSourceContent(name, files[name]);\n }\n }\n }\n delete options.output.ast;\n delete options.output.code;\n var stream = OutputStream(options.output);\n toplevel.print(stream);\n result.code = stream.get();\n if (options.sourceMap) {\n result.map = options.output.source_map.toString();\n if (options.sourceMap.url == \"inline\") {\n result.code += \"\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,\" + to_base64(result.map);\n } else if (options.sourceMap.url) {\n result.code += \"\\n//# sourceMappingURL=\" + options.sourceMap.url;\n }\n }\n }\n if (options.nameCache && options.mangle) {\n if (options.mangle.cache) options.nameCache.vars = to_json(options.mangle.cache);\n if (options.mangle.properties && options.mangle.properties.cache) {\n options.nameCache.props = to_json(options.mangle.properties.cache);\n }\n }\n if (timings) {\n timings.end = Date.now();\n result.timings = {\n parse: 1e-3 * (timings.rename - timings.parse),\n rename: 1e-3 * (timings.compress - timings.rename),\n compress: 1e-3 * (timings.scope - timings.compress),\n scope: 1e-3 * (timings.mangle - timings.scope),\n mangle: 1e-3 * (timings.properties - timings.mangle),\n properties: 1e-3 * (timings.output - timings.properties),\n output: 1e-3 * (timings.end - timings.output),\n total: 1e-3 * (timings.end - timings.start)\n };\n }\n if (warnings.length) {\n result.warnings = warnings;\n }\n return result;\n } catch (ex) {\n return { error: ex };\n } finally {\n AST_Node.warn_function = warn_function;\n }\n}\n","exports[\"Dictionary\"] = Dictionary;\nexports[\"minify\"] = minify;\nexports[\"parse\"] = parse;\nexports[\"push_uniq\"] = push_uniq;\nexports[\"OutputStream\"] = OutputStream;\nexports[\"TreeTransformer\"] = TreeTransformer;\nexports[\"TreeWalker\"] = TreeWalker;\nexports[\"string_template\"] = string_template;\nexports[\"Compressor\"] = Compressor;\nexports[\"defaults\"] = defaults;\nexports[\"base54\"] = base54;\nexports[\"mangle_properties\"] = mangle_properties;\nexports[\"reserve_quoted_keys\"] = reserve_quoted_keys;\nexports[\"to_ascii\"] = to_ascii;\n","/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n \n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n// a small wrapper around fitzgen's source-map library\nfunction SourceMap(options) {\n options = defaults(options, {\n file : null,\n root : null,\n orig : null,\n\n orig_line_diff : 0,\n dest_line_diff : 0,\n });\n var generator = new MOZ_SourceMap.SourceMapGenerator({\n file : options.file,\n sourceRoot : options.root\n });\n var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);\n\n if (orig_map && Array.isArray(options.orig.sources)) {\n orig_map._sources.toArray().forEach(function(source) {\n var sourceContent = orig_map.sourceContentFor(source, true);\n if (sourceContent) {\n generator.setSourceContent(source, sourceContent);\n }\n });\n }\n\n function add(source, gen_line, gen_col, orig_line, orig_col, name) {\n if (orig_map) {\n var info = orig_map.originalPositionFor({\n line: orig_line,\n column: orig_col\n });\n if (info.source === null) {\n return;\n }\n source = info.source;\n orig_line = info.line;\n orig_col = info.column;\n name = info.name || name;\n }\n generator.addMapping({\n generated : { line: gen_line + options.dest_line_diff, column: gen_col },\n original : { line: orig_line + options.orig_line_diff, column: orig_col },\n source : source,\n name : name\n });\n }\n return {\n add : add,\n get : function() { return generator; },\n toString : function() { return JSON.stringify(generator.toJSON()); }\n };\n}\n",null]} \ No newline at end of file diff --git a/tools/node_modules/terser/package.json b/tools/node_modules/terser/package.json index 6a7540e3f648..8988ecdd8d49 100644 --- a/tools/node_modules/terser/package.json +++ b/tools/node_modules/terser/package.json @@ -117,7 +117,6 @@ "license": "BSD-2-Clause", "main": "terser.js", - "how-to": "cat lib/utils.js lib/ast.js lib/parse.js lib/scope.js lib/output.js lib/mozilla-ast.js > terser.js", "zmain": "dist/bundle.js", "maintainers": [ diff --git a/tools/node_modules/terser/tools/colorless-console.js b/tools/node_modules/terser/tools/colorless-console.js deleted file mode 100644 index b65bb62756e0..000000000000 --- a/tools/node_modules/terser/tools/colorless-console.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict" - -if (Number((/([0-9]+)\./.exec(process.version) || [])[1]) >= 10) { - var Console = require("console").Console; - global.console = new Console({ - stdout: process.stdout, - stderr: process.stderr, - colorMode: false - }); -} - diff --git a/tools/node_modules/terser/tools/domprops.js b/tools/node_modules/terser/tools/domprops.js deleted file mode 100644 index 3af936a3fff4..000000000000 --- a/tools/node_modules/terser/tools/domprops.js +++ /dev/null @@ -1,5601 +0,0 @@ -var domprops = [ - "$&", - "$'", - "$*", - "$+", - "$1", - "$2", - "$3", - "$4", - "$5", - "$6", - "$7", - "$8", - "$9", - "$_", - "$`", - "$input", - "@@iterator", - "ABORT_ERR", - "ACTIVE", - "ACTIVE_ATTRIBUTES", - "ACTIVE_TEXTURE", - "ACTIVE_UNIFORMS", - "ADDITION", - "ALIASED_LINE_WIDTH_RANGE", - "ALIASED_POINT_SIZE_RANGE", - "ALLOW_KEYBOARD_INPUT", - "ALLPASS", - "ALPHA", - "ALPHA_BITS", - "ALT_MASK", - "ALWAYS", - "ANY_TYPE", - "ANY_UNORDERED_NODE_TYPE", - "ARRAY_BUFFER", - "ARRAY_BUFFER_BINDING", - "ATTACHED_SHADERS", - "ATTRIBUTE_NODE", - "AT_TARGET", - "AddSearchProvider", - "AnalyserNode", - "AnimationEvent", - "AnonXMLHttpRequest", - "ApplicationCache", - "ApplicationCacheErrorEvent", - "Array", - "ArrayBuffer", - "Attr", - "Audio", - "AudioBuffer", - "AudioBufferSourceNode", - "AudioContext", - "AudioDestinationNode", - "AudioListener", - "AudioNode", - "AudioParam", - "AudioProcessingEvent", - "AudioStreamTrack", - "AutocompleteErrorEvent", - "BACK", - "BAD_BOUNDARYPOINTS_ERR", - "BANDPASS", - "BLEND", - "BLEND_COLOR", - "BLEND_DST_ALPHA", - "BLEND_DST_RGB", - "BLEND_EQUATION", - "BLEND_EQUATION_ALPHA", - "BLEND_EQUATION_RGB", - "BLEND_SRC_ALPHA", - "BLEND_SRC_RGB", - "BLUE_BITS", - "BLUR", - "BOOL", - "BOOLEAN_TYPE", - "BOOL_VEC2", - "BOOL_VEC3", - "BOOL_VEC4", - "BOTH", - "BROWSER_DEFAULT_WEBGL", - "BUBBLING_PHASE", - "BUFFER_SIZE", - "BUFFER_USAGE", - "BYTE", - "BYTES_PER_ELEMENT", - "BarProp", - "BaseHref", - "BatteryManager", - "BeforeLoadEvent", - "BeforeUnloadEvent", - "BiquadFilterNode", - "Blob", - "BlobEvent", - "Boolean", - "CAPTURING_PHASE", - "CCW", - "CDATASection", - "CDATA_SECTION_NODE", - "CHANGE", - "CHARSET_RULE", - "CHECKING", - "CLAMP_TO_EDGE", - "CLICK", - "CLOSED", - "CLOSING", - "COLOR_ATTACHMENT0", - "COLOR_BUFFER_BIT", - "COLOR_CLEAR_VALUE", - "COLOR_WRITEMASK", - "COMMENT_NODE", - "COMPILE_STATUS", - "COMPRESSED_RGBA_S3TC_DXT1_EXT", - "COMPRESSED_RGBA_S3TC_DXT3_EXT", - "COMPRESSED_RGBA_S3TC_DXT5_EXT", - "COMPRESSED_RGB_S3TC_DXT1_EXT", - "COMPRESSED_TEXTURE_FORMATS", - "CONNECTING", - "CONSTANT_ALPHA", - "CONSTANT_COLOR", - "CONSTRAINT_ERR", - "CONTEXT_LOST_WEBGL", - "CONTROL_MASK", - "COUNTER_STYLE_RULE", - "CSS", - "CSS2Properties", - "CSSCharsetRule", - "CSSConditionRule", - "CSSCounterStyleRule", - "CSSFontFaceRule", - "CSSFontFeatureValuesRule", - "CSSGroupingRule", - "CSSImportRule", - "CSSKeyframeRule", - "CSSKeyframesRule", - "CSSMediaRule", - "CSSMozDocumentRule", - "CSSNameSpaceRule", - "CSSPageRule", - "CSSPrimitiveValue", - "CSSRule", - "CSSRuleList", - "CSSStyleDeclaration", - "CSSStyleRule", - "CSSStyleSheet", - "CSSSupportsRule", - "CSSUnknownRule", - "CSSValue", - "CSSValueList", - "CSSVariablesDeclaration", - "CSSVariablesRule", - "CSSViewportRule", - "CSS_ATTR", - "CSS_CM", - "CSS_COUNTER", - "CSS_CUSTOM", - "CSS_DEG", - "CSS_DIMENSION", - "CSS_EMS", - "CSS_EXS", - "CSS_FILTER_BLUR", - "CSS_FILTER_BRIGHTNESS", - "CSS_FILTER_CONTRAST", - "CSS_FILTER_CUSTOM", - "CSS_FILTER_DROP_SHADOW", - "CSS_FILTER_GRAYSCALE", - "CSS_FILTER_HUE_ROTATE", - "CSS_FILTER_INVERT", - "CSS_FILTER_OPACITY", - "CSS_FILTER_REFERENCE", - "CSS_FILTER_SATURATE", - "CSS_FILTER_SEPIA", - "CSS_GRAD", - "CSS_HZ", - "CSS_IDENT", - "CSS_IN", - "CSS_INHERIT", - "CSS_KHZ", - "CSS_MATRIX", - "CSS_MATRIX3D", - "CSS_MM", - "CSS_MS", - "CSS_NUMBER", - "CSS_PC", - "CSS_PERCENTAGE", - "CSS_PERSPECTIVE", - "CSS_PRIMITIVE_VALUE", - "CSS_PT", - "CSS_PX", - "CSS_RAD", - "CSS_RECT", - "CSS_RGBCOLOR", - "CSS_ROTATE", - "CSS_ROTATE3D", - "CSS_ROTATEX", - "CSS_ROTATEY", - "CSS_ROTATEZ", - "CSS_S", - "CSS_SCALE", - "CSS_SCALE3D", - "CSS_SCALEX", - "CSS_SCALEY", - "CSS_SCALEZ", - "CSS_SKEW", - "CSS_SKEWX", - "CSS_SKEWY", - "CSS_STRING", - "CSS_TRANSLATE", - "CSS_TRANSLATE3D", - "CSS_TRANSLATEX", - "CSS_TRANSLATEY", - "CSS_TRANSLATEZ", - "CSS_UNKNOWN", - "CSS_URI", - "CSS_VALUE_LIST", - "CSS_VH", - "CSS_VMAX", - "CSS_VMIN", - "CSS_VW", - "CULL_FACE", - "CULL_FACE_MODE", - "CURRENT_PROGRAM", - "CURRENT_VERTEX_ATTRIB", - "CUSTOM", - "CW", - "CanvasGradient", - "CanvasPattern", - "CanvasRenderingContext2D", - "CaretPosition", - "ChannelMergerNode", - "ChannelSplitterNode", - "CharacterData", - "ClientRect", - "ClientRectList", - "Clipboard", - "ClipboardEvent", - "CloseEvent", - "Collator", - "CommandEvent", - "Comment", - "CompositionEvent", - "Console", - "Controllers", - "ConvolverNode", - "Counter", - "Crypto", - "CryptoKey", - "CustomEvent", - "DATABASE_ERR", - "DATA_CLONE_ERR", - "DATA_ERR", - "DBLCLICK", - "DECR", - "DECR_WRAP", - "DELETE_STATUS", - "DEPTH_ATTACHMENT", - "DEPTH_BITS", - "DEPTH_BUFFER_BIT", - "DEPTH_CLEAR_VALUE", - "DEPTH_COMPONENT", - "DEPTH_COMPONENT16", - "DEPTH_FUNC", - "DEPTH_RANGE", - "DEPTH_STENCIL", - "DEPTH_STENCIL_ATTACHMENT", - "DEPTH_TEST", - "DEPTH_WRITEMASK", - "DIRECTION_DOWN", - "DIRECTION_LEFT", - "DIRECTION_RIGHT", - "DIRECTION_UP", - "DISABLED", - "DISPATCH_REQUEST_ERR", - "DITHER", - "DOCUMENT_FRAGMENT_NODE", - "DOCUMENT_NODE", - "DOCUMENT_POSITION_CONTAINED_BY", - "DOCUMENT_POSITION_CONTAINS", - "DOCUMENT_POSITION_DISCONNECTED", - "DOCUMENT_POSITION_FOLLOWING", - "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", - "DOCUMENT_POSITION_PRECEDING", - "DOCUMENT_TYPE_NODE", - "DOMCursor", - "DOMError", - "DOMException", - "DOMImplementation", - "DOMImplementationLS", - "DOMMatrix", - "DOMMatrixReadOnly", - "DOMParser", - "DOMPoint", - "DOMPointReadOnly", - "DOMQuad", - "DOMRect", - "DOMRectList", - "DOMRectReadOnly", - "DOMRequest", - "DOMSTRING_SIZE_ERR", - "DOMSettableTokenList", - "DOMStringList", - "DOMStringMap", - "DOMTokenList", - "DOMTransactionEvent", - "DOM_DELTA_LINE", - "DOM_DELTA_PAGE", - "DOM_DELTA_PIXEL", - "DOM_INPUT_METHOD_DROP", - "DOM_INPUT_METHOD_HANDWRITING", - "DOM_INPUT_METHOD_IME", - "DOM_INPUT_METHOD_KEYBOARD", - "DOM_INPUT_METHOD_MULTIMODAL", - "DOM_INPUT_METHOD_OPTION", - "DOM_INPUT_METHOD_PASTE", - "DOM_INPUT_METHOD_SCRIPT", - "DOM_INPUT_METHOD_UNKNOWN", - "DOM_INPUT_METHOD_VOICE", - "DOM_KEY_LOCATION_JOYSTICK", - "DOM_KEY_LOCATION_LEFT", - "DOM_KEY_LOCATION_MOBILE", - "DOM_KEY_LOCATION_NUMPAD", - "DOM_KEY_LOCATION_RIGHT", - "DOM_KEY_LOCATION_STANDARD", - "DOM_VK_0", - "DOM_VK_1", - "DOM_VK_2", - "DOM_VK_3", - "DOM_VK_4", - "DOM_VK_5", - "DOM_VK_6", - "DOM_VK_7", - "DOM_VK_8", - "DOM_VK_9", - "DOM_VK_A", - "DOM_VK_ACCEPT", - "DOM_VK_ADD", - "DOM_VK_ALT", - "DOM_VK_ALTGR", - "DOM_VK_AMPERSAND", - "DOM_VK_ASTERISK", - "DOM_VK_AT", - "DOM_VK_ATTN", - "DOM_VK_B", - "DOM_VK_BACKSPACE", - "DOM_VK_BACK_QUOTE", - "DOM_VK_BACK_SLASH", - "DOM_VK_BACK_SPACE", - "DOM_VK_C", - "DOM_VK_CANCEL", - "DOM_VK_CAPS_LOCK", - "DOM_VK_CIRCUMFLEX", - "DOM_VK_CLEAR", - "DOM_VK_CLOSE_BRACKET", - "DOM_VK_CLOSE_CURLY_BRACKET", - "DOM_VK_CLOSE_PAREN", - "DOM_VK_COLON", - "DOM_VK_COMMA", - "DOM_VK_CONTEXT_MENU", - "DOM_VK_CONTROL", - "DOM_VK_CONVERT", - "DOM_VK_CRSEL", - "DOM_VK_CTRL", - "DOM_VK_D", - "DOM_VK_DECIMAL", - "DOM_VK_DELETE", - "DOM_VK_DIVIDE", - "DOM_VK_DOLLAR", - "DOM_VK_DOUBLE_QUOTE", - "DOM_VK_DOWN", - "DOM_VK_E", - "DOM_VK_EISU", - "DOM_VK_END", - "DOM_VK_ENTER", - "DOM_VK_EQUALS", - "DOM_VK_EREOF", - "DOM_VK_ESCAPE", - "DOM_VK_EXCLAMATION", - "DOM_VK_EXECUTE", - "DOM_VK_EXSEL", - "DOM_VK_F", - "DOM_VK_F1", - "DOM_VK_F10", - "DOM_VK_F11", - "DOM_VK_F12", - "DOM_VK_F13", - "DOM_VK_F14", - "DOM_VK_F15", - "DOM_VK_F16", - "DOM_VK_F17", - "DOM_VK_F18", - "DOM_VK_F19", - "DOM_VK_F2", - "DOM_VK_F20", - "DOM_VK_F21", - "DOM_VK_F22", - "DOM_VK_F23", - "DOM_VK_F24", - "DOM_VK_F25", - "DOM_VK_F26", - "DOM_VK_F27", - "DOM_VK_F28", - "DOM_VK_F29", - "DOM_VK_F3", - "DOM_VK_F30", - "DOM_VK_F31", - "DOM_VK_F32", - "DOM_VK_F33", - "DOM_VK_F34", - "DOM_VK_F35", - "DOM_VK_F36", - "DOM_VK_F4", - "DOM_VK_F5", - "DOM_VK_F6", - "DOM_VK_F7", - "DOM_VK_F8", - "DOM_VK_F9", - "DOM_VK_FINAL", - "DOM_VK_FRONT", - "DOM_VK_G", - "DOM_VK_GREATER_THAN", - "DOM_VK_H", - "DOM_VK_HANGUL", - "DOM_VK_HANJA", - "DOM_VK_HASH", - "DOM_VK_HELP", - "DOM_VK_HK_TOGGLE", - "DOM_VK_HOME", - "DOM_VK_HYPHEN_MINUS", - "DOM_VK_I", - "DOM_VK_INSERT", - "DOM_VK_J", - "DOM_VK_JUNJA", - "DOM_VK_K", - "DOM_VK_KANA", - "DOM_VK_KANJI", - "DOM_VK_L", - "DOM_VK_LEFT", - "DOM_VK_LEFT_TAB", - "DOM_VK_LESS_THAN", - "DOM_VK_M", - "DOM_VK_META", - "DOM_VK_MODECHANGE", - "DOM_VK_MULTIPLY", - "DOM_VK_N", - "DOM_VK_NONCONVERT", - "DOM_VK_NUMPAD0", - "DOM_VK_NUMPAD1", - "DOM_VK_NUMPAD2", - "DOM_VK_NUMPAD3", - "DOM_VK_NUMPAD4", - "DOM_VK_NUMPAD5", - "DOM_VK_NUMPAD6", - "DOM_VK_NUMPAD7", - "DOM_VK_NUMPAD8", - "DOM_VK_NUMPAD9", - "DOM_VK_NUM_LOCK", - "DOM_VK_O", - "DOM_VK_OEM_1", - "DOM_VK_OEM_102", - "DOM_VK_OEM_2", - "DOM_VK_OEM_3", - "DOM_VK_OEM_4", - "DOM_VK_OEM_5", - "DOM_VK_OEM_6", - "DOM_VK_OEM_7", - "DOM_VK_OEM_8", - "DOM_VK_OEM_COMMA", - "DOM_VK_OEM_MINUS", - "DOM_VK_OEM_PERIOD", - "DOM_VK_OEM_PLUS", - "DOM_VK_OPEN_BRACKET", - "DOM_VK_OPEN_CURLY_BRACKET", - "DOM_VK_OPEN_PAREN", - "DOM_VK_P", - "DOM_VK_PA1", - "DOM_VK_PAGEDOWN", - "DOM_VK_PAGEUP", - "DOM_VK_PAGE_DOWN", - "DOM_VK_PAGE_UP", - "DOM_VK_PAUSE", - "DOM_VK_PERCENT", - "DOM_VK_PERIOD", - "DOM_VK_PIPE", - "DOM_VK_PLAY", - "DOM_VK_PLUS", - "DOM_VK_PRINT", - "DOM_VK_PRINTSCREEN", - "DOM_VK_PROCESSKEY", - "DOM_VK_PROPERITES", - "DOM_VK_Q", - "DOM_VK_QUESTION_MARK", - "DOM_VK_QUOTE", - "DOM_VK_R", - "DOM_VK_REDO", - "DOM_VK_RETURN", - "DOM_VK_RIGHT", - "DOM_VK_S", - "DOM_VK_SCROLL_LOCK", - "DOM_VK_SELECT", - "DOM_VK_SEMICOLON", - "DOM_VK_SEPARATOR", - "DOM_VK_SHIFT", - "DOM_VK_SLASH", - "DOM_VK_SLEEP", - "DOM_VK_SPACE", - "DOM_VK_SUBTRACT", - "DOM_VK_T", - "DOM_VK_TAB", - "DOM_VK_TILDE", - "DOM_VK_U", - "DOM_VK_UNDERSCORE", - "DOM_VK_UNDO", - "DOM_VK_UNICODE", - "DOM_VK_UP", - "DOM_VK_V", - "DOM_VK_VOLUME_DOWN", - "DOM_VK_VOLUME_MUTE", - "DOM_VK_VOLUME_UP", - "DOM_VK_W", - "DOM_VK_WIN", - "DOM_VK_WINDOW", - "DOM_VK_WIN_ICO_00", - "DOM_VK_WIN_ICO_CLEAR", - "DOM_VK_WIN_ICO_HELP", - "DOM_VK_WIN_OEM_ATTN", - "DOM_VK_WIN_OEM_AUTO", - "DOM_VK_WIN_OEM_BACKTAB", - "DOM_VK_WIN_OEM_CLEAR", - "DOM_VK_WIN_OEM_COPY", - "DOM_VK_WIN_OEM_CUSEL", - "DOM_VK_WIN_OEM_ENLW", - "DOM_VK_WIN_OEM_FINISH", - "DOM_VK_WIN_OEM_FJ_JISHO", - "DOM_VK_WIN_OEM_FJ_LOYA", - "DOM_VK_WIN_OEM_FJ_MASSHOU", - "DOM_VK_WIN_OEM_FJ_ROYA", - "DOM_VK_WIN_OEM_FJ_TOUROKU", - "DOM_VK_WIN_OEM_JUMP", - "DOM_VK_WIN_OEM_PA1", - "DOM_VK_WIN_OEM_PA2", - "DOM_VK_WIN_OEM_PA3", - "DOM_VK_WIN_OEM_RESET", - "DOM_VK_WIN_OEM_WSCTRL", - "DOM_VK_X", - "DOM_VK_XF86XK_ADD_FAVORITE", - "DOM_VK_XF86XK_APPLICATION_LEFT", - "DOM_VK_XF86XK_APPLICATION_RIGHT", - "DOM_VK_XF86XK_AUDIO_CYCLE_TRACK", - "DOM_VK_XF86XK_AUDIO_FORWARD", - "DOM_VK_XF86XK_AUDIO_LOWER_VOLUME", - "DOM_VK_XF86XK_AUDIO_MEDIA", - "DOM_VK_XF86XK_AUDIO_MUTE", - "DOM_VK_XF86XK_AUDIO_NEXT", - "DOM_VK_XF86XK_AUDIO_PAUSE", - "DOM_VK_XF86XK_AUDIO_PLAY", - "DOM_VK_XF86XK_AUDIO_PREV", - "DOM_VK_XF86XK_AUDIO_RAISE_VOLUME", - "DOM_VK_XF86XK_AUDIO_RANDOM_PLAY", - "DOM_VK_XF86XK_AUDIO_RECORD", - "DOM_VK_XF86XK_AUDIO_REPEAT", - "DOM_VK_XF86XK_AUDIO_REWIND", - "DOM_VK_XF86XK_AUDIO_STOP", - "DOM_VK_XF86XK_AWAY", - "DOM_VK_XF86XK_BACK", - "DOM_VK_XF86XK_BACK_FORWARD", - "DOM_VK_XF86XK_BATTERY", - "DOM_VK_XF86XK_BLUE", - "DOM_VK_XF86XK_BLUETOOTH", - "DOM_VK_XF86XK_BOOK", - "DOM_VK_XF86XK_BRIGHTNESS_ADJUST", - "DOM_VK_XF86XK_CALCULATOR", - "DOM_VK_XF86XK_CALENDAR", - "DOM_VK_XF86XK_CD", - "DOM_VK_XF86XK_CLOSE", - "DOM_VK_XF86XK_COMMUNITY", - "DOM_VK_XF86XK_CONTRAST_ADJUST", - "DOM_VK_XF86XK_COPY", - "DOM_VK_XF86XK_CUT", - "DOM_VK_XF86XK_CYCLE_ANGLE", - "DOM_VK_XF86XK_DISPLAY", - "DOM_VK_XF86XK_DOCUMENTS", - "DOM_VK_XF86XK_DOS", - "DOM_VK_XF86XK_EJECT", - "DOM_VK_XF86XK_EXCEL", - "DOM_VK_XF86XK_EXPLORER", - "DOM_VK_XF86XK_FAVORITES", - "DOM_VK_XF86XK_FINANCE", - "DOM_VK_XF86XK_FORWARD", - "DOM_VK_XF86XK_FRAME_BACK", - "DOM_VK_XF86XK_FRAME_FORWARD", - "DOM_VK_XF86XK_GAME", - "DOM_VK_XF86XK_GO", - "DOM_VK_XF86XK_GREEN", - "DOM_VK_XF86XK_HIBERNATE", - "DOM_VK_XF86XK_HISTORY", - "DOM_VK_XF86XK_HOME_PAGE", - "DOM_VK_XF86XK_HOT_LINKS", - "DOM_VK_XF86XK_I_TOUCH", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_UP", - "DOM_VK_XF86XK_KBD_LIGHT_ON_OFF", - "DOM_VK_XF86XK_LAUNCH0", - "DOM_VK_XF86XK_LAUNCH1", - "DOM_VK_XF86XK_LAUNCH2", - "DOM_VK_XF86XK_LAUNCH3", - "DOM_VK_XF86XK_LAUNCH4", - "DOM_VK_XF86XK_LAUNCH5", - "DOM_VK_XF86XK_LAUNCH6", - "DOM_VK_XF86XK_LAUNCH7", - "DOM_VK_XF86XK_LAUNCH8", - "DOM_VK_XF86XK_LAUNCH9", - "DOM_VK_XF86XK_LAUNCH_A", - "DOM_VK_XF86XK_LAUNCH_B", - "DOM_VK_XF86XK_LAUNCH_C", - "DOM_VK_XF86XK_LAUNCH_D", - "DOM_VK_XF86XK_LAUNCH_E", - "DOM_VK_XF86XK_LAUNCH_F", - "DOM_VK_XF86XK_LIGHT_BULB", - "DOM_VK_XF86XK_LOG_OFF", - "DOM_VK_XF86XK_MAIL", - "DOM_VK_XF86XK_MAIL_FORWARD", - "DOM_VK_XF86XK_MARKET", - "DOM_VK_XF86XK_MEETING", - "DOM_VK_XF86XK_MEMO", - "DOM_VK_XF86XK_MENU_KB", - "DOM_VK_XF86XK_MENU_PB", - "DOM_VK_XF86XK_MESSENGER", - "DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_MON_BRIGHTNESS_UP", - "DOM_VK_XF86XK_MUSIC", - "DOM_VK_XF86XK_MY_COMPUTER", - "DOM_VK_XF86XK_MY_SITES", - "DOM_VK_XF86XK_NEW", - "DOM_VK_XF86XK_NEWS", - "DOM_VK_XF86XK_OFFICE_HOME", - "DOM_VK_XF86XK_OPEN", - "DOM_VK_XF86XK_OPEN_URL", - "DOM_VK_XF86XK_OPTION", - "DOM_VK_XF86XK_PASTE", - "DOM_VK_XF86XK_PHONE", - "DOM_VK_XF86XK_PICTURES", - "DOM_VK_XF86XK_POWER_DOWN", - "DOM_VK_XF86XK_POWER_OFF", - "DOM_VK_XF86XK_RED", - "DOM_VK_XF86XK_REFRESH", - "DOM_VK_XF86XK_RELOAD", - "DOM_VK_XF86XK_REPLY", - "DOM_VK_XF86XK_ROCKER_DOWN", - "DOM_VK_XF86XK_ROCKER_ENTER", - "DOM_VK_XF86XK_ROCKER_UP", - "DOM_VK_XF86XK_ROTATE_WINDOWS", - "DOM_VK_XF86XK_ROTATION_KB", - "DOM_VK_XF86XK_ROTATION_PB", - "DOM_VK_XF86XK_SAVE", - "DOM_VK_XF86XK_SCREEN_SAVER", - "DOM_VK_XF86XK_SCROLL_CLICK", - "DOM_VK_XF86XK_SCROLL_DOWN", - "DOM_VK_XF86XK_SCROLL_UP", - "DOM_VK_XF86XK_SEARCH", - "DOM_VK_XF86XK_SEND", - "DOM_VK_XF86XK_SHOP", - "DOM_VK_XF86XK_SPELL", - "DOM_VK_XF86XK_SPLIT_SCREEN", - "DOM_VK_XF86XK_STANDBY", - "DOM_VK_XF86XK_START", - "DOM_VK_XF86XK_STOP", - "DOM_VK_XF86XK_SUBTITLE", - "DOM_VK_XF86XK_SUPPORT", - "DOM_VK_XF86XK_SUSPEND", - "DOM_VK_XF86XK_TASK_PANE", - "DOM_VK_XF86XK_TERMINAL", - "DOM_VK_XF86XK_TIME", - "DOM_VK_XF86XK_TOOLS", - "DOM_VK_XF86XK_TOP_MENU", - "DOM_VK_XF86XK_TO_DO_LIST", - "DOM_VK_XF86XK_TRAVEL", - "DOM_VK_XF86XK_USER1KB", - "DOM_VK_XF86XK_USER2KB", - "DOM_VK_XF86XK_USER_PB", - "DOM_VK_XF86XK_UWB", - "DOM_VK_XF86XK_VENDOR_HOME", - "DOM_VK_XF86XK_VIDEO", - "DOM_VK_XF86XK_VIEW", - "DOM_VK_XF86XK_WAKE_UP", - "DOM_VK_XF86XK_WEB_CAM", - "DOM_VK_XF86XK_WHEEL_BUTTON", - "DOM_VK_XF86XK_WLAN", - "DOM_VK_XF86XK_WORD", - "DOM_VK_XF86XK_WWW", - "DOM_VK_XF86XK_XFER", - "DOM_VK_XF86XK_YELLOW", - "DOM_VK_XF86XK_ZOOM_IN", - "DOM_VK_XF86XK_ZOOM_OUT", - "DOM_VK_Y", - "DOM_VK_Z", - "DOM_VK_ZOOM", - "DONE", - "DONT_CARE", - "DOWNLOADING", - "DRAGDROP", - "DST_ALPHA", - "DST_COLOR", - "DYNAMIC_DRAW", - "DataChannel", - "DataTransfer", - "DataTransferItem", - "DataTransferItemList", - "DataView", - "Date", - "DateTimeFormat", - "DelayNode", - "DesktopNotification", - "DesktopNotificationCenter", - "DeviceLightEvent", - "DeviceMotionEvent", - "DeviceOrientationEvent", - "DeviceProximityEvent", - "DeviceStorage", - "DeviceStorageChangeEvent", - "Document", - "DocumentFragment", - "DocumentType", - "DragEvent", - "DynamicsCompressorNode", - "E", - "ELEMENT_ARRAY_BUFFER", - "ELEMENT_ARRAY_BUFFER_BINDING", - "ELEMENT_NODE", - "EMPTY", - "ENCODING_ERR", - "ENDED", - "END_TO_END", - "END_TO_START", - "ENTITY_NODE", - "ENTITY_REFERENCE_NODE", - "EPSILON", - "EQUAL", - "EQUALPOWER", - "ERROR", - "EXPONENTIAL_DISTANCE", - "Element", - "ElementQuery", - "Entity", - "EntityReference", - "Error", - "ErrorEvent", - "EvalError", - "Event", - "EventException", - "EventSource", - "EventTarget", - "External", - "FASTEST", - "FIDOSDK", - "FILTER_ACCEPT", - "FILTER_INTERRUPT", - "FILTER_REJECT", - "FILTER_SKIP", - "FINISHED_STATE", - "FIRST_ORDERED_NODE_TYPE", - "FLOAT", - "FLOAT_MAT2", - "FLOAT_MAT3", - "FLOAT_MAT4", - "FLOAT_VEC2", - "FLOAT_VEC3", - "FLOAT_VEC4", - "FOCUS", - "FONT_FACE_RULE", - "FONT_FEATURE_VALUES_RULE", - "FRAGMENT_SHADER", - "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", - "FRAMEBUFFER", - "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", - "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", - "FRAMEBUFFER_BINDING", - "FRAMEBUFFER_COMPLETE", - "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", - "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", - "FRAMEBUFFER_UNSUPPORTED", - "FRONT", - "FRONT_AND_BACK", - "FRONT_FACE", - "FUNC_ADD", - "FUNC_REVERSE_SUBTRACT", - "FUNC_SUBTRACT", - "Feed", - "FeedEntry", - "File", - "FileError", - "FileList", - "FileReader", - "FindInPage", - "Float32Array", - "Float64Array", - "FocusEvent", - "FontFace", - "FormData", - "Function", - "GENERATE_MIPMAP_HINT", - "GEQUAL", - "GREATER", - "GREEN_BITS", - "GainNode", - "Gamepad", - "GamepadButton", - "GamepadEvent", - "GestureEvent", - "HAVE_CURRENT_DATA", - "HAVE_ENOUGH_DATA", - "HAVE_FUTURE_DATA", - "HAVE_METADATA", - "HAVE_NOTHING", - "HEADERS_RECEIVED", - "HIDDEN", - "HIERARCHY_REQUEST_ERR", - "HIGHPASS", - "HIGHSHELF", - "HIGH_FLOAT", - "HIGH_INT", - "HORIZONTAL", - "HORIZONTAL_AXIS", - "HRTF", - "HTMLAllCollection", - "HTMLAnchorElement", - "HTMLAppletElement", - "HTMLAreaElement", - "HTMLAudioElement", - "HTMLBRElement", - "HTMLBaseElement", - "HTMLBaseFontElement", - "HTMLBlockquoteElement", - "HTMLBodyElement", - "HTMLButtonElement", - "HTMLCanvasElement", - "HTMLCollection", - "HTMLCommandElement", - "HTMLContentElement", - "HTMLDListElement", - "HTMLDataElement", - "HTMLDataListElement", - "HTMLDetailsElement", - "HTMLDialogElement", - "HTMLDirectoryElement", - "HTMLDivElement", - "HTMLDocument", - "HTMLElement", - "HTMLEmbedElement", - "HTMLFieldSetElement", - "HTMLFontElement", - "HTMLFormControlsCollection", - "HTMLFormElement", - "HTMLFrameElement", - "HTMLFrameSetElement", - "HTMLHRElement", - "HTMLHeadElement", - "HTMLHeadingElement", - "HTMLHtmlElement", - "HTMLIFrameElement", - "HTMLImageElement", - "HTMLInputElement", - "HTMLIsIndexElement", - "HTMLKeygenElement", - "HTMLLIElement", - "HTMLLabelElement", - "HTMLLegendElement", - "HTMLLinkElement", - "HTMLMapElement", - "HTMLMarqueeElement", - "HTMLMediaElement", - "HTMLMenuElement", - "HTMLMenuItemElement", - "HTMLMetaElement", - "HTMLMeterElement", - "HTMLModElement", - "HTMLOListElement", - "HTMLObjectElement", - "HTMLOptGroupElement", - "HTMLOptionElement", - "HTMLOptionsCollection", - "HTMLOutputElement", - "HTMLParagraphElement", - "HTMLParamElement", - "HTMLPictureElement", - "HTMLPreElement", - "HTMLProgressElement", - "HTMLPropertiesCollection", - "HTMLQuoteElement", - "HTMLScriptElement", - "HTMLSelectElement", - "HTMLShadowElement", - "HTMLSourceElement", - "HTMLSpanElement", - "HTMLStyleElement", - "HTMLTableCaptionElement", - "HTMLTableCellElement", - "HTMLTableColElement", - "HTMLTableElement", - "HTMLTableRowElement", - "HTMLTableSectionElement", - "HTMLTemplateElement", - "HTMLTextAreaElement", - "HTMLTimeElement", - "HTMLTitleElement", - "HTMLTrackElement", - "HTMLUListElement", - "HTMLUnknownElement", - "HTMLVideoElement", - "HashChangeEvent", - "Headers", - "History", - "ICE_CHECKING", - "ICE_CLOSED", - "ICE_COMPLETED", - "ICE_CONNECTED", - "ICE_FAILED", - "ICE_GATHERING", - "ICE_WAITING", - "IDBCursor", - "IDBCursorWithValue", - "IDBDatabase", - "IDBDatabaseException", - "IDBFactory", - "IDBFileHandle", - "IDBFileRequest", - "IDBIndex", - "IDBKeyRange", - "IDBMutableFile", - "IDBObjectStore", - "IDBOpenDBRequest", - "IDBRequest", - "IDBTransaction", - "IDBVersionChangeEvent", - "IDLE", - "IMPLEMENTATION_COLOR_READ_FORMAT", - "IMPLEMENTATION_COLOR_READ_TYPE", - "IMPORT_RULE", - "INCR", - "INCR_WRAP", - "INDEX_SIZE_ERR", - "INT", - "INT_VEC2", - "INT_VEC3", - "INT_VEC4", - "INUSE_ATTRIBUTE_ERR", - "INVALID_ACCESS_ERR", - "INVALID_CHARACTER_ERR", - "INVALID_ENUM", - "INVALID_EXPRESSION_ERR", - "INVALID_FRAMEBUFFER_OPERATION", - "INVALID_MODIFICATION_ERR", - "INVALID_NODE_TYPE_ERR", - "INVALID_OPERATION", - "INVALID_STATE_ERR", - "INVALID_VALUE", - "INVERSE_DISTANCE", - "INVERT", - "IceCandidate", - "Image", - "ImageBitmap", - "ImageData", - "Infinity", - "InputEvent", - "InputMethodContext", - "InstallTrigger", - "Int16Array", - "Int32Array", - "Int8Array", - "Intent", - "InternalError", - "Intl", - "IsSearchProviderInstalled", - "Iterator", - "JSON", - "KEEP", - "KEYDOWN", - "KEYFRAMES_RULE", - "KEYFRAME_RULE", - "KEYPRESS", - "KEYUP", - "KeyEvent", - "KeyboardEvent", - "LENGTHADJUST_SPACING", - "LENGTHADJUST_SPACINGANDGLYPHS", - "LENGTHADJUST_UNKNOWN", - "LEQUAL", - "LESS", - "LINEAR", - "LINEAR_DISTANCE", - "LINEAR_MIPMAP_LINEAR", - "LINEAR_MIPMAP_NEAREST", - "LINES", - "LINE_LOOP", - "LINE_STRIP", - "LINE_WIDTH", - "LINK_STATUS", - "LIVE", - "LN10", - "LN2", - "LOADED", - "LOADING", - "LOG10E", - "LOG2E", - "LOWPASS", - "LOWSHELF", - "LOW_FLOAT", - "LOW_INT", - "LSException", - "LSParserFilter", - "LUMINANCE", - "LUMINANCE_ALPHA", - "LocalMediaStream", - "Location", - "MAX_COMBINED_TEXTURE_IMAGE_UNITS", - "MAX_CUBE_MAP_TEXTURE_SIZE", - "MAX_FRAGMENT_UNIFORM_VECTORS", - "MAX_RENDERBUFFER_SIZE", - "MAX_SAFE_INTEGER", - "MAX_TEXTURE_IMAGE_UNITS", - "MAX_TEXTURE_MAX_ANISOTROPY_EXT", - "MAX_TEXTURE_SIZE", - "MAX_VALUE", - "MAX_VARYING_VECTORS", - "MAX_VERTEX_ATTRIBS", - "MAX_VERTEX_TEXTURE_IMAGE_UNITS", - "MAX_VERTEX_UNIFORM_VECTORS", - "MAX_VIEWPORT_DIMS", - "MEDIA_ERR_ABORTED", - "MEDIA_ERR_DECODE", - "MEDIA_ERR_ENCRYPTED", - "MEDIA_ERR_NETWORK", - "MEDIA_ERR_SRC_NOT_SUPPORTED", - "MEDIA_KEYERR_CLIENT", - "MEDIA_KEYERR_DOMAIN", - "MEDIA_KEYERR_HARDWARECHANGE", - "MEDIA_KEYERR_OUTPUT", - "MEDIA_KEYERR_SERVICE", - "MEDIA_KEYERR_UNKNOWN", - "MEDIA_RULE", - "MEDIUM_FLOAT", - "MEDIUM_INT", - "META_MASK", - "MIN_SAFE_INTEGER", - "MIN_VALUE", - "MIRRORED_REPEAT", - "MODE_ASYNCHRONOUS", - "MODE_SYNCHRONOUS", - "MODIFICATION", - "MOUSEDOWN", - "MOUSEDRAG", - "MOUSEMOVE", - "MOUSEOUT", - "MOUSEOVER", - "MOUSEUP", - "MOZ_KEYFRAMES_RULE", - "MOZ_KEYFRAME_RULE", - "MOZ_SOURCE_CURSOR", - "MOZ_SOURCE_ERASER", - "MOZ_SOURCE_KEYBOARD", - "MOZ_SOURCE_MOUSE", - "MOZ_SOURCE_PEN", - "MOZ_SOURCE_TOUCH", - "MOZ_SOURCE_UNKNOWN", - "MSGESTURE_FLAG_BEGIN", - "MSGESTURE_FLAG_CANCEL", - "MSGESTURE_FLAG_END", - "MSGESTURE_FLAG_INERTIA", - "MSGESTURE_FLAG_NONE", - "MSPOINTER_TYPE_MOUSE", - "MSPOINTER_TYPE_PEN", - "MSPOINTER_TYPE_TOUCH", - "MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE", - "MS_ASYNC_CALLBACK_STATUS_CANCEL", - "MS_ASYNC_CALLBACK_STATUS_CHOOSEANY", - "MS_ASYNC_CALLBACK_STATUS_ERROR", - "MS_ASYNC_CALLBACK_STATUS_JOIN", - "MS_ASYNC_OP_STATUS_CANCELED", - "MS_ASYNC_OP_STATUS_ERROR", - "MS_ASYNC_OP_STATUS_SUCCESS", - "MS_MANIPULATION_STATE_ACTIVE", - "MS_MANIPULATION_STATE_CANCELLED", - "MS_MANIPULATION_STATE_COMMITTED", - "MS_MANIPULATION_STATE_DRAGGING", - "MS_MANIPULATION_STATE_INERTIA", - "MS_MANIPULATION_STATE_PRESELECT", - "MS_MANIPULATION_STATE_SELECTING", - "MS_MANIPULATION_STATE_STOPPED", - "MS_MEDIA_ERR_ENCRYPTED", - "MS_MEDIA_KEYERR_CLIENT", - "MS_MEDIA_KEYERR_DOMAIN", - "MS_MEDIA_KEYERR_HARDWARECHANGE", - "MS_MEDIA_KEYERR_OUTPUT", - "MS_MEDIA_KEYERR_SERVICE", - "MS_MEDIA_KEYERR_UNKNOWN", - "Map", - "Math", - "MediaController", - "MediaDevices", - "MediaElementAudioSourceNode", - "MediaEncryptedEvent", - "MediaError", - "MediaKeyError", - "MediaKeyEvent", - "MediaKeyMessageEvent", - "MediaKeyNeededEvent", - "MediaKeySession", - "MediaKeyStatusMap", - "MediaKeySystemAccess", - "MediaKeys", - "MediaList", - "MediaQueryList", - "MediaQueryListEvent", - "MediaRecorder", - "MediaSource", - "MediaStream", - "MediaStreamAudioDestinationNode", - "MediaStreamAudioSourceNode", - "MediaStreamEvent", - "MediaStreamTrack", - "MediaStreamTrackEvent", - "MessageChannel", - "MessageEvent", - "MessagePort", - "Methods", - "MimeType", - "MimeTypeArray", - "MouseEvent", - "MouseScrollEvent", - "MozAnimation", - "MozAnimationDelay", - "MozAnimationDirection", - "MozAnimationDuration", - "MozAnimationFillMode", - "MozAnimationIterationCount", - "MozAnimationName", - "MozAnimationPlayState", - "MozAnimationTimingFunction", - "MozAppearance", - "MozBackfaceVisibility", - "MozBinding", - "MozBorderBottomColors", - "MozBorderEnd", - "MozBorderEndColor", - "MozBorderEndStyle", - "MozBorderEndWidth", - "MozBorderImage", - "MozBorderLeftColors", - "MozBorderRightColors", - "MozBorderStart", - "MozBorderStartColor", - "MozBorderStartStyle", - "MozBorderStartWidth", - "MozBorderTopColors", - "MozBoxAlign", - "MozBoxDirection", - "MozBoxFlex", - "MozBoxOrdinalGroup", - "MozBoxOrient", - "MozBoxPack", - "MozBoxSizing", - "MozCSSKeyframeRule", - "MozCSSKeyframesRule", - "MozColumnCount", - "MozColumnFill", - "MozColumnGap", - "MozColumnRule", - "MozColumnRuleColor", - "MozColumnRuleStyle", - "MozColumnRuleWidth", - "MozColumnWidth", - "MozColumns", - "MozContactChangeEvent", - "MozFloatEdge", - "MozFontFeatureSettings", - "MozFontLanguageOverride", - "MozForceBrokenImageIcon", - "MozHyphens", - "MozImageRegion", - "MozMarginEnd", - "MozMarginStart", - "MozMmsEvent", - "MozMmsMessage", - "MozMobileMessageThread", - "MozOSXFontSmoothing", - "MozOrient", - "MozOutlineRadius", - "MozOutlineRadiusBottomleft", - "MozOutlineRadiusBottomright", - "MozOutlineRadiusTopleft", - "MozOutlineRadiusTopright", - "MozPaddingEnd", - "MozPaddingStart", - "MozPerspective", - "MozPerspectiveOrigin", - "MozPowerManager", - "MozSettingsEvent", - "MozSmsEvent", - "MozSmsMessage", - "MozStackSizing", - "MozTabSize", - "MozTextAlignLast", - "MozTextDecorationColor", - "MozTextDecorationLine", - "MozTextDecorationStyle", - "MozTextSizeAdjust", - "MozTransform", - "MozTransformOrigin", - "MozTransformStyle", - "MozTransition", - "MozTransitionDelay", - "MozTransitionDuration", - "MozTransitionProperty", - "MozTransitionTimingFunction", - "MozUserFocus", - "MozUserInput", - "MozUserModify", - "MozUserSelect", - "MozWindowDragging", - "MozWindowShadow", - "MutationEvent", - "MutationObserver", - "MutationRecord", - "NAMESPACE_ERR", - "NAMESPACE_RULE", - "NEAREST", - "NEAREST_MIPMAP_LINEAR", - "NEAREST_MIPMAP_NEAREST", - "NEGATIVE_INFINITY", - "NETWORK_EMPTY", - "NETWORK_ERR", - "NETWORK_IDLE", - "NETWORK_LOADED", - "NETWORK_LOADING", - "NETWORK_NO_SOURCE", - "NEVER", - "NEW", - "NEXT", - "NEXT_NO_DUPLICATE", - "NICEST", - "NODE_AFTER", - "NODE_BEFORE", - "NODE_BEFORE_AND_AFTER", - "NODE_INSIDE", - "NONE", - "NON_TRANSIENT_ERR", - "NOTATION_NODE", - "NOTCH", - "NOTEQUAL", - "NOT_ALLOWED_ERR", - "NOT_FOUND_ERR", - "NOT_READABLE_ERR", - "NOT_SUPPORTED_ERR", - "NO_DATA_ALLOWED_ERR", - "NO_ERR", - "NO_ERROR", - "NO_MODIFICATION_ALLOWED_ERR", - "NUMBER_TYPE", - "NUM_COMPRESSED_TEXTURE_FORMATS", - "NaN", - "NamedNodeMap", - "Navigator", - "NearbyLinks", - "NetworkInformation", - "Node", - "NodeFilter", - "NodeIterator", - "NodeList", - "Notation", - "Notification", - "NotifyPaintEvent", - "Number", - "NumberFormat", - "OBSOLETE", - "ONE", - "ONE_MINUS_CONSTANT_ALPHA", - "ONE_MINUS_CONSTANT_COLOR", - "ONE_MINUS_DST_ALPHA", - "ONE_MINUS_DST_COLOR", - "ONE_MINUS_SRC_ALPHA", - "ONE_MINUS_SRC_COLOR", - "OPEN", - "OPENED", - "OPENING", - "ORDERED_NODE_ITERATOR_TYPE", - "ORDERED_NODE_SNAPSHOT_TYPE", - "OUT_OF_MEMORY", - "Object", - "OfflineAudioCompletionEvent", - "OfflineAudioContext", - "OfflineResourceList", - "Option", - "OscillatorNode", - "OverflowEvent", - "PACK_ALIGNMENT", - "PAGE_RULE", - "PARSE_ERR", - "PATHSEG_ARC_ABS", - "PATHSEG_ARC_REL", - "PATHSEG_CLOSEPATH", - "PATHSEG_CURVETO_CUBIC_ABS", - "PATHSEG_CURVETO_CUBIC_REL", - "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", - "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", - "PATHSEG_CURVETO_QUADRATIC_ABS", - "PATHSEG_CURVETO_QUADRATIC_REL", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", - "PATHSEG_LINETO_ABS", - "PATHSEG_LINETO_HORIZONTAL_ABS", - "PATHSEG_LINETO_HORIZONTAL_REL", - "PATHSEG_LINETO_REL", - "PATHSEG_LINETO_VERTICAL_ABS", - "PATHSEG_LINETO_VERTICAL_REL", - "PATHSEG_MOVETO_ABS", - "PATHSEG_MOVETO_REL", - "PATHSEG_UNKNOWN", - "PATH_EXISTS_ERR", - "PEAKING", - "PERMISSION_DENIED", - "PERSISTENT", - "PI", - "PLAYING_STATE", - "POINTS", - "POLYGON_OFFSET_FACTOR", - "POLYGON_OFFSET_FILL", - "POLYGON_OFFSET_UNITS", - "POSITION_UNAVAILABLE", - "POSITIVE_INFINITY", - "PREV", - "PREV_NO_DUPLICATE", - "PROCESSING_INSTRUCTION_NODE", - "PageChangeEvent", - "PageTransitionEvent", - "PaintRequest", - "PaintRequestList", - "PannerNode", - "Path2D", - "Performance", - "PerformanceEntry", - "PerformanceMark", - "PerformanceMeasure", - "PerformanceNavigation", - "PerformanceResourceTiming", - "PerformanceTiming", - "PeriodicWave", - "Plugin", - "PluginArray", - "PopStateEvent", - "PopupBlockedEvent", - "ProcessingInstruction", - "ProgressEvent", - "Promise", - "PropertyNodeList", - "Proxy", - "PushManager", - "PushSubscription", - "Q", - "QUOTA_ERR", - "QUOTA_EXCEEDED_ERR", - "QueryInterface", - "READ_ONLY", - "READ_ONLY_ERR", - "READ_WRITE", - "RED_BITS", - "REMOVAL", - "RENDERBUFFER", - "RENDERBUFFER_ALPHA_SIZE", - "RENDERBUFFER_BINDING", - "RENDERBUFFER_BLUE_SIZE", - "RENDERBUFFER_DEPTH_SIZE", - "RENDERBUFFER_GREEN_SIZE", - "RENDERBUFFER_HEIGHT", - "RENDERBUFFER_INTERNAL_FORMAT", - "RENDERBUFFER_RED_SIZE", - "RENDERBUFFER_STENCIL_SIZE", - "RENDERBUFFER_WIDTH", - "RENDERER", - "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", - "RENDERING_INTENT_AUTO", - "RENDERING_INTENT_PERCEPTUAL", - "RENDERING_INTENT_RELATIVE_COLORIMETRIC", - "RENDERING_INTENT_SATURATION", - "RENDERING_INTENT_UNKNOWN", - "REPEAT", - "REPLACE", - "RGB", - "RGB565", - "RGB5_A1", - "RGBA", - "RGBA4", - "RGBColor", - "ROTATION_CLOCKWISE", - "ROTATION_COUNTERCLOCKWISE", - "RTCDataChannelEvent", - "RTCIceCandidate", - "RTCPeerConnectionIceEvent", - "RTCRtpReceiver", - "RTCRtpSender", - "RTCSessionDescription", - "RTCStatsReport", - "RadioNodeList", - "Range", - "RangeError", - "RangeException", - "RecordErrorEvent", - "Rect", - "ReferenceError", - "RegExp", - "Request", - "Response", - "SAMPLER_2D", - "SAMPLER_CUBE", - "SAMPLES", - "SAMPLE_ALPHA_TO_COVERAGE", - "SAMPLE_BUFFERS", - "SAMPLE_COVERAGE", - "SAMPLE_COVERAGE_INVERT", - "SAMPLE_COVERAGE_VALUE", - "SAWTOOTH", - "SCHEDULED_STATE", - "SCISSOR_BOX", - "SCISSOR_TEST", - "SCROLL_PAGE_DOWN", - "SCROLL_PAGE_UP", - "SDP_ANSWER", - "SDP_OFFER", - "SDP_PRANSWER", - "SECURITY_ERR", - "SELECT", - "SERIALIZE_ERR", - "SEVERITY_ERROR", - "SEVERITY_FATAL_ERROR", - "SEVERITY_WARNING", - "SHADER_COMPILER", - "SHADER_TYPE", - "SHADING_LANGUAGE_VERSION", - "SHIFT_MASK", - "SHORT", - "SHOWING", - "SHOW_ALL", - "SHOW_ATTRIBUTE", - "SHOW_CDATA_SECTION", - "SHOW_COMMENT", - "SHOW_DOCUMENT", - "SHOW_DOCUMENT_FRAGMENT", - "SHOW_DOCUMENT_TYPE", - "SHOW_ELEMENT", - "SHOW_ENTITY", - "SHOW_ENTITY_REFERENCE", - "SHOW_NOTATION", - "SHOW_PROCESSING_INSTRUCTION", - "SHOW_TEXT", - "SINE", - "SOUNDFIELD", - "SQLException", - "SQRT1_2", - "SQRT2", - "SQUARE", - "SRC_ALPHA", - "SRC_ALPHA_SATURATE", - "SRC_COLOR", - "START_TO_END", - "START_TO_START", - "STATIC_DRAW", - "STENCIL_ATTACHMENT", - "STENCIL_BACK_FAIL", - "STENCIL_BACK_FUNC", - "STENCIL_BACK_PASS_DEPTH_FAIL", - "STENCIL_BACK_PASS_DEPTH_PASS", - "STENCIL_BACK_REF", - "STENCIL_BACK_VALUE_MASK", - "STENCIL_BACK_WRITEMASK", - "STENCIL_BITS", - "STENCIL_BUFFER_BIT", - "STENCIL_CLEAR_VALUE", - "STENCIL_FAIL", - "STENCIL_FUNC", - "STENCIL_INDEX", - "STENCIL_INDEX8", - "STENCIL_PASS_DEPTH_FAIL", - "STENCIL_PASS_DEPTH_PASS", - "STENCIL_REF", - "STENCIL_TEST", - "STENCIL_VALUE_MASK", - "STENCIL_WRITEMASK", - "STREAM_DRAW", - "STRING_TYPE", - "STYLE_RULE", - "SUBPIXEL_BITS", - "SUPPORTS_RULE", - "SVGAElement", - "SVGAltGlyphDefElement", - "SVGAltGlyphElement", - "SVGAltGlyphItemElement", - "SVGAngle", - "SVGAnimateColorElement", - "SVGAnimateElement", - "SVGAnimateMotionElement", - "SVGAnimateTransformElement", - "SVGAnimatedAngle", - "SVGAnimatedBoolean", - "SVGAnimatedEnumeration", - "SVGAnimatedInteger", - "SVGAnimatedLength", - "SVGAnimatedLengthList", - "SVGAnimatedNumber", - "SVGAnimatedNumberList", - "SVGAnimatedPreserveAspectRatio", - "SVGAnimatedRect", - "SVGAnimatedString", - "SVGAnimatedTransformList", - "SVGAnimationElement", - "SVGCircleElement", - "SVGClipPathElement", - "SVGColor", - "SVGComponentTransferFunctionElement", - "SVGCursorElement", - "SVGDefsElement", - "SVGDescElement", - "SVGDiscardElement", - "SVGDocument", - "SVGElement", - "SVGElementInstance", - "SVGElementInstanceList", - "SVGEllipseElement", - "SVGException", - "SVGFEBlendElement", - "SVGFEColorMatrixElement", - "SVGFEComponentTransferElement", - "SVGFECompositeElement", - "SVGFEConvolveMatrixElement", - "SVGFEDiffuseLightingElement", - "SVGFEDisplacementMapElement", - "SVGFEDistantLightElement", - "SVGFEDropShadowElement", - "SVGFEFloodElement", - "SVGFEFuncAElement", - "SVGFEFuncBElement", - "SVGFEFuncGElement", - "SVGFEFuncRElement", - "SVGFEGaussianBlurElement", - "SVGFEImageElement", - "SVGFEMergeElement", - "SVGFEMergeNodeElement", - "SVGFEMorphologyElement", - "SVGFEOffsetElement", - "SVGFEPointLightElement", - "SVGFESpecularLightingElement", - "SVGFESpotLightElement", - "SVGFETileElement", - "SVGFETurbulenceElement", - "SVGFilterElement", - "SVGFontElement", - "SVGFontFaceElement", - "SVGFontFaceFormatElement", - "SVGFontFaceNameElement", - "SVGFontFaceSrcElement", - "SVGFontFaceUriElement", - "SVGForeignObjectElement", - "SVGGElement", - "SVGGeometryElement", - "SVGGlyphElement", - "SVGGlyphRefElement", - "SVGGradientElement", - "SVGGraphicsElement", - "SVGHKernElement", - "SVGImageElement", - "SVGLength", - "SVGLengthList", - "SVGLineElement", - "SVGLinearGradientElement", - "SVGMPathElement", - "SVGMarkerElement", - "SVGMaskElement", - "SVGMatrix", - "SVGMetadataElement", - "SVGMissingGlyphElement", - "SVGNumber", - "SVGNumberList", - "SVGPaint", - "SVGPathElement", - "SVGPathSeg", - "SVGPathSegArcAbs", - "SVGPathSegArcRel", - "SVGPathSegClosePath", - "SVGPathSegCurvetoCubicAbs", - "SVGPathSegCurvetoCubicRel", - "SVGPathSegCurvetoCubicSmoothAbs", - "SVGPathSegCurvetoCubicSmoothRel", - "SVGPathSegCurvetoQuadraticAbs", - "SVGPathSegCurvetoQuadraticRel", - "SVGPathSegCurvetoQuadraticSmoothAbs", - "SVGPathSegCurvetoQuadraticSmoothRel", - "SVGPathSegLinetoAbs", - "SVGPathSegLinetoHorizontalAbs", - "SVGPathSegLinetoHorizontalRel", - "SVGPathSegLinetoRel", - "SVGPathSegLinetoVerticalAbs", - "SVGPathSegLinetoVerticalRel", - "SVGPathSegList", - "SVGPathSegMovetoAbs", - "SVGPathSegMovetoRel", - "SVGPatternElement", - "SVGPoint", - "SVGPointList", - "SVGPolygonElement", - "SVGPolylineElement", - "SVGPreserveAspectRatio", - "SVGRadialGradientElement", - "SVGRect", - "SVGRectElement", - "SVGRenderingIntent", - "SVGSVGElement", - "SVGScriptElement", - "SVGSetElement", - "SVGStopElement", - "SVGStringList", - "SVGStyleElement", - "SVGSwitchElement", - "SVGSymbolElement", - "SVGTRefElement", - "SVGTSpanElement", - "SVGTextContentElement", - "SVGTextElement", - "SVGTextPathElement", - "SVGTextPositioningElement", - "SVGTitleElement", - "SVGTransform", - "SVGTransformList", - "SVGUnitTypes", - "SVGUseElement", - "SVGVKernElement", - "SVGViewElement", - "SVGViewSpec", - "SVGZoomAndPan", - "SVGZoomEvent", - "SVG_ANGLETYPE_DEG", - "SVG_ANGLETYPE_GRAD", - "SVG_ANGLETYPE_RAD", - "SVG_ANGLETYPE_UNKNOWN", - "SVG_ANGLETYPE_UNSPECIFIED", - "SVG_CHANNEL_A", - "SVG_CHANNEL_B", - "SVG_CHANNEL_G", - "SVG_CHANNEL_R", - "SVG_CHANNEL_UNKNOWN", - "SVG_COLORTYPE_CURRENTCOLOR", - "SVG_COLORTYPE_RGBCOLOR", - "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", - "SVG_COLORTYPE_UNKNOWN", - "SVG_EDGEMODE_DUPLICATE", - "SVG_EDGEMODE_NONE", - "SVG_EDGEMODE_UNKNOWN", - "SVG_EDGEMODE_WRAP", - "SVG_FEBLEND_MODE_COLOR", - "SVG_FEBLEND_MODE_COLOR_BURN", - "SVG_FEBLEND_MODE_COLOR_DODGE", - "SVG_FEBLEND_MODE_DARKEN", - "SVG_FEBLEND_MODE_DIFFERENCE", - "SVG_FEBLEND_MODE_EXCLUSION", - "SVG_FEBLEND_MODE_HARD_LIGHT", - "SVG_FEBLEND_MODE_HUE", - "SVG_FEBLEND_MODE_LIGHTEN", - "SVG_FEBLEND_MODE_LUMINOSITY", - "SVG_FEBLEND_MODE_MULTIPLY", - "SVG_FEBLEND_MODE_NORMAL", - "SVG_FEBLEND_MODE_OVERLAY", - "SVG_FEBLEND_MODE_SATURATION", - "SVG_FEBLEND_MODE_SCREEN", - "SVG_FEBLEND_MODE_SOFT_LIGHT", - "SVG_FEBLEND_MODE_UNKNOWN", - "SVG_FECOLORMATRIX_TYPE_HUEROTATE", - "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", - "SVG_FECOLORMATRIX_TYPE_MATRIX", - "SVG_FECOLORMATRIX_TYPE_SATURATE", - "SVG_FECOLORMATRIX_TYPE_UNKNOWN", - "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", - "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", - "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", - "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", - "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", - "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", - "SVG_FECOMPOSITE_OPERATOR_ATOP", - "SVG_FECOMPOSITE_OPERATOR_IN", - "SVG_FECOMPOSITE_OPERATOR_OUT", - "SVG_FECOMPOSITE_OPERATOR_OVER", - "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_XOR", - "SVG_INVALID_VALUE_ERR", - "SVG_LENGTHTYPE_CM", - "SVG_LENGTHTYPE_EMS", - "SVG_LENGTHTYPE_EXS", - "SVG_LENGTHTYPE_IN", - "SVG_LENGTHTYPE_MM", - "SVG_LENGTHTYPE_NUMBER", - "SVG_LENGTHTYPE_PC", - "SVG_LENGTHTYPE_PERCENTAGE", - "SVG_LENGTHTYPE_PT", - "SVG_LENGTHTYPE_PX", - "SVG_LENGTHTYPE_UNKNOWN", - "SVG_MARKERUNITS_STROKEWIDTH", - "SVG_MARKERUNITS_UNKNOWN", - "SVG_MARKERUNITS_USERSPACEONUSE", - "SVG_MARKER_ORIENT_ANGLE", - "SVG_MARKER_ORIENT_AUTO", - "SVG_MARKER_ORIENT_UNKNOWN", - "SVG_MASKTYPE_ALPHA", - "SVG_MASKTYPE_LUMINANCE", - "SVG_MATRIX_NOT_INVERTABLE", - "SVG_MEETORSLICE_MEET", - "SVG_MEETORSLICE_SLICE", - "SVG_MEETORSLICE_UNKNOWN", - "SVG_MORPHOLOGY_OPERATOR_DILATE", - "SVG_MORPHOLOGY_OPERATOR_ERODE", - "SVG_MORPHOLOGY_OPERATOR_UNKNOWN", - "SVG_PAINTTYPE_CURRENTCOLOR", - "SVG_PAINTTYPE_NONE", - "SVG_PAINTTYPE_RGBCOLOR", - "SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", - "SVG_PAINTTYPE_UNKNOWN", - "SVG_PAINTTYPE_URI", - "SVG_PAINTTYPE_URI_CURRENTCOLOR", - "SVG_PAINTTYPE_URI_NONE", - "SVG_PAINTTYPE_URI_RGBCOLOR", - "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", - "SVG_PRESERVEASPECTRATIO_NONE", - "SVG_PRESERVEASPECTRATIO_UNKNOWN", - "SVG_PRESERVEASPECTRATIO_XMAXYMAX", - "SVG_PRESERVEASPECTRATIO_XMAXYMID", - "SVG_PRESERVEASPECTRATIO_XMAXYMIN", - "SVG_PRESERVEASPECTRATIO_XMIDYMAX", - "SVG_PRESERVEASPECTRATIO_XMIDYMID", - "SVG_PRESERVEASPECTRATIO_XMIDYMIN", - "SVG_PRESERVEASPECTRATIO_XMINYMAX", - "SVG_PRESERVEASPECTRATIO_XMINYMID", - "SVG_PRESERVEASPECTRATIO_XMINYMIN", - "SVG_SPREADMETHOD_PAD", - "SVG_SPREADMETHOD_REFLECT", - "SVG_SPREADMETHOD_REPEAT", - "SVG_SPREADMETHOD_UNKNOWN", - "SVG_STITCHTYPE_NOSTITCH", - "SVG_STITCHTYPE_STITCH", - "SVG_STITCHTYPE_UNKNOWN", - "SVG_TRANSFORM_MATRIX", - "SVG_TRANSFORM_ROTATE", - "SVG_TRANSFORM_SCALE", - "SVG_TRANSFORM_SKEWX", - "SVG_TRANSFORM_SKEWY", - "SVG_TRANSFORM_TRANSLATE", - "SVG_TRANSFORM_UNKNOWN", - "SVG_TURBULENCE_TYPE_FRACTALNOISE", - "SVG_TURBULENCE_TYPE_TURBULENCE", - "SVG_TURBULENCE_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", - "SVG_UNIT_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_USERSPACEONUSE", - "SVG_WRONG_TYPE_ERR", - "SVG_ZOOMANDPAN_DISABLE", - "SVG_ZOOMANDPAN_MAGNIFY", - "SVG_ZOOMANDPAN_UNKNOWN", - "SYNTAX_ERR", - "SavedPages", - "Screen", - "ScreenOrientation", - "Script", - "ScriptProcessorNode", - "ScrollAreaEvent", - "SecurityPolicyViolationEvent", - "Selection", - "ServiceWorker", - "ServiceWorkerContainer", - "ServiceWorkerRegistration", - "SessionDescription", - "Set", - "ShadowRoot", - "SharedWorker", - "SimpleGestureEvent", - "SpeechSynthesisEvent", - "SpeechSynthesisUtterance", - "StopIteration", - "Storage", - "StorageEvent", - "String", - "StyleSheet", - "StyleSheetList", - "SubtleCrypto", - "Symbol", - "SyntaxError", - "TEMPORARY", - "TEXTPATH_METHODTYPE_ALIGN", - "TEXTPATH_METHODTYPE_STRETCH", - "TEXTPATH_METHODTYPE_UNKNOWN", - "TEXTPATH_SPACINGTYPE_AUTO", - "TEXTPATH_SPACINGTYPE_EXACT", - "TEXTPATH_SPACINGTYPE_UNKNOWN", - "TEXTURE", - "TEXTURE0", - "TEXTURE1", - "TEXTURE10", - "TEXTURE11", - "TEXTURE12", - "TEXTURE13", - "TEXTURE14", - "TEXTURE15", - "TEXTURE16", - "TEXTURE17", - "TEXTURE18", - "TEXTURE19", - "TEXTURE2", - "TEXTURE20", - "TEXTURE21", - "TEXTURE22", - "TEXTURE23", - "TEXTURE24", - "TEXTURE25", - "TEXTURE26", - "TEXTURE27", - "TEXTURE28", - "TEXTURE29", - "TEXTURE3", - "TEXTURE30", - "TEXTURE31", - "TEXTURE4", - "TEXTURE5", - "TEXTURE6", - "TEXTURE7", - "TEXTURE8", - "TEXTURE9", - "TEXTURE_2D", - "TEXTURE_BINDING_2D", - "TEXTURE_BINDING_CUBE_MAP", - "TEXTURE_CUBE_MAP", - "TEXTURE_CUBE_MAP_NEGATIVE_X", - "TEXTURE_CUBE_MAP_NEGATIVE_Y", - "TEXTURE_CUBE_MAP_NEGATIVE_Z", - "TEXTURE_CUBE_MAP_POSITIVE_X", - "TEXTURE_CUBE_MAP_POSITIVE_Y", - "TEXTURE_CUBE_MAP_POSITIVE_Z", - "TEXTURE_MAG_FILTER", - "TEXTURE_MAX_ANISOTROPY_EXT", - "TEXTURE_MIN_FILTER", - "TEXTURE_WRAP_S", - "TEXTURE_WRAP_T", - "TEXT_NODE", - "TIMEOUT", - "TIMEOUT_ERR", - "TOO_LARGE_ERR", - "TRANSACTION_INACTIVE_ERR", - "TRIANGLE", - "TRIANGLES", - "TRIANGLE_FAN", - "TRIANGLE_STRIP", - "TYPE_BACK_FORWARD", - "TYPE_ERR", - "TYPE_MISMATCH_ERR", - "TYPE_NAVIGATE", - "TYPE_RELOAD", - "TYPE_RESERVED", - "Text", - "TextDecoder", - "TextEncoder", - "TextEvent", - "TextMetrics", - "TextTrack", - "TextTrackCue", - "TextTrackCueList", - "TextTrackList", - "TimeEvent", - "TimeRanges", - "Touch", - "TouchEvent", - "TouchList", - "TrackEvent", - "TransitionEvent", - "TreeWalker", - "TypeError", - "UIEvent", - "UNCACHED", - "UNKNOWN_ERR", - "UNKNOWN_RULE", - "UNMASKED_RENDERER_WEBGL", - "UNMASKED_VENDOR_WEBGL", - "UNORDERED_NODE_ITERATOR_TYPE", - "UNORDERED_NODE_SNAPSHOT_TYPE", - "UNPACK_ALIGNMENT", - "UNPACK_COLORSPACE_CONVERSION_WEBGL", - "UNPACK_FLIP_Y_WEBGL", - "UNPACK_PREMULTIPLY_ALPHA_WEBGL", - "UNSCHEDULED_STATE", - "UNSENT", - "UNSIGNED_BYTE", - "UNSIGNED_INT", - "UNSIGNED_SHORT", - "UNSIGNED_SHORT_4_4_4_4", - "UNSIGNED_SHORT_5_5_5_1", - "UNSIGNED_SHORT_5_6_5", - "UNSPECIFIED_EVENT_TYPE_ERR", - "UPDATEREADY", - "URIError", - "URL", - "URLSearchParams", - "URLUnencoded", - "URL_MISMATCH_ERR", - "UTC", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - "UserMessageHandler", - "UserMessageHandlersNamespace", - "UserProximityEvent", - "VALIDATE_STATUS", - "VALIDATION_ERR", - "VARIABLES_RULE", - "VENDOR", - "VERSION", - "VERSION_CHANGE", - "VERSION_ERR", - "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", - "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", - "VERTEX_ATTRIB_ARRAY_ENABLED", - "VERTEX_ATTRIB_ARRAY_NORMALIZED", - "VERTEX_ATTRIB_ARRAY_POINTER", - "VERTEX_ATTRIB_ARRAY_SIZE", - "VERTEX_ATTRIB_ARRAY_STRIDE", - "VERTEX_ATTRIB_ARRAY_TYPE", - "VERTEX_SHADER", - "VERTICAL", - "VERTICAL_AXIS", - "VER_ERR", - "VIEWPORT", - "VIEWPORT_RULE", - "VTTCue", - "VTTRegion", - "ValidityState", - "VideoStreamTrack", - "WEBKIT_FILTER_RULE", - "WEBKIT_KEYFRAMES_RULE", - "WEBKIT_KEYFRAME_RULE", - "WEBKIT_REGION_RULE", - "WRONG_DOCUMENT_ERR", - "WaveShaperNode", - "WeakMap", - "WeakSet", - "WebGLActiveInfo", - "WebGLBuffer", - "WebGLContextEvent", - "WebGLFramebuffer", - "WebGLProgram", - "WebGLRenderbuffer", - "WebGLRenderingContext", - "WebGLShader", - "WebGLShaderPrecisionFormat", - "WebGLTexture", - "WebGLUniformLocation", - "WebGLVertexArray", - "WebKitAnimationEvent", - "WebKitBlobBuilder", - "WebKitCSSFilterRule", - "WebKitCSSFilterValue", - "WebKitCSSKeyframeRule", - "WebKitCSSKeyframesRule", - "WebKitCSSMatrix", - "WebKitCSSRegionRule", - "WebKitCSSTransformValue", - "WebKitDataCue", - "WebKitGamepad", - "WebKitMediaKeyError", - "WebKitMediaKeyMessageEvent", - "WebKitMediaKeySession", - "WebKitMediaKeys", - "WebKitMediaSource", - "WebKitMutationObserver", - "WebKitNamespace", - "WebKitPlaybackTargetAvailabilityEvent", - "WebKitPoint", - "WebKitShadowRoot", - "WebKitSourceBuffer", - "WebKitSourceBufferList", - "WebKitTransitionEvent", - "WebSocket", - "WheelEvent", - "Window", - "Worker", - "XMLDocument", - "XMLHttpRequest", - "XMLHttpRequestEventTarget", - "XMLHttpRequestException", - "XMLHttpRequestProgressEvent", - "XMLHttpRequestUpload", - "XMLSerializer", - "XMLStylesheetProcessingInstruction", - "XPathEvaluator", - "XPathException", - "XPathExpression", - "XPathNSResolver", - "XPathResult", - "XSLTProcessor", - "ZERO", - "_XD0M_", - "_YD0M_", - "__defineGetter__", - "__defineSetter__", - "__lookupGetter__", - "__lookupSetter__", - "__opera", - "__proto__", - "_browserjsran", - "a", - "aLink", - "abbr", - "abort", - "abs", - "absolute", - "acceleration", - "accelerationIncludingGravity", - "accelerator", - "accept", - "acceptCharset", - "acceptNode", - "accessKey", - "accessKeyLabel", - "accuracy", - "acos", - "acosh", - "action", - "actionURL", - "active", - "activeCues", - "activeElement", - "activeSourceBuffers", - "activeSourceCount", - "activeTexture", - "add", - "addBehavior", - "addCandidate", - "addColorStop", - "addCue", - "addElement", - "addEventListener", - "addFilter", - "addFromString", - "addFromUri", - "addIceCandidate", - "addImport", - "addListener", - "addNamed", - "addPageRule", - "addPath", - "addPointer", - "addRange", - "addRegion", - "addRule", - "addSearchEngine", - "addSourceBuffer", - "addStream", - "addTextTrack", - "addTrack", - "addWakeLockListener", - "addedNodes", - "additionalName", - "additiveSymbols", - "addons", - "adoptNode", - "adr", - "advance", - "alert", - "algorithm", - "align", - "align-content", - "align-items", - "align-self", - "alignContent", - "alignItems", - "alignSelf", - "alignmentBaseline", - "alinkColor", - "all", - "allowFullscreen", - "allowedDirections", - "alpha", - "alt", - "altGraphKey", - "altHtml", - "altKey", - "altLeft", - "altitude", - "altitudeAccuracy", - "amplitude", - "ancestorOrigins", - "anchor", - "anchorNode", - "anchorOffset", - "anchors", - "angle", - "animVal", - "animate", - "animatedInstanceRoot", - "animatedNormalizedPathSegList", - "animatedPathSegList", - "animatedPoints", - "animation", - "animation-delay", - "animation-direction", - "animation-duration", - "animation-fill-mode", - "animation-iteration-count", - "animation-name", - "animation-play-state", - "animation-timing-function", - "animationDelay", - "animationDirection", - "animationDuration", - "animationFillMode", - "animationIterationCount", - "animationName", - "animationPlayState", - "animationStartTime", - "animationTimingFunction", - "animationsPaused", - "anniversary", - "app", - "appCodeName", - "appMinorVersion", - "appName", - "appNotifications", - "appVersion", - "append", - "appendBuffer", - "appendChild", - "appendData", - "appendItem", - "appendMedium", - "appendNamed", - "appendRule", - "appendStream", - "appendWindowEnd", - "appendWindowStart", - "applets", - "applicationCache", - "apply", - "applyElement", - "arc", - "arcTo", - "archive", - "areas", - "arguments", - "arrayBuffer", - "asin", - "asinh", - "assert", - "assign", - "async", - "atEnd", - "atan", - "atan2", - "atanh", - "atob", - "attachEvent", - "attachShader", - "attachments", - "attack", - "attrChange", - "attrName", - "attributeName", - "attributeNamespace", - "attributes", - "audioTracks", - "autoIncrement", - "autobuffer", - "autocapitalize", - "autocomplete", - "autocorrect", - "autofocus", - "autoplay", - "availHeight", - "availLeft", - "availTop", - "availWidth", - "availability", - "available", - "aversion", - "axes", - "axis", - "azimuth", - "b", - "back", - "backface-visibility", - "backfaceVisibility", - "background", - "background-attachment", - "background-blend-mode", - "background-clip", - "background-color", - "background-image", - "background-origin", - "background-position", - "background-repeat", - "background-size", - "backgroundAttachment", - "backgroundBlendMode", - "backgroundClip", - "backgroundColor", - "backgroundImage", - "backgroundOrigin", - "backgroundPosition", - "backgroundPositionX", - "backgroundPositionY", - "backgroundRepeat", - "backgroundSize", - "badInput", - "balance", - "baseFrequencyX", - "baseFrequencyY", - "baseNode", - "baseOffset", - "baseURI", - "baseVal", - "baselineShift", - "battery", - "bday", - "beginElement", - "beginElementAt", - "beginPath", - "behavior", - "behaviorCookie", - "behaviorPart", - "behaviorUrns", - "beta", - "bezierCurveTo", - "bgColor", - "bgProperties", - "bias", - "big", - "binaryType", - "bind", - "bindAttribLocation", - "bindBuffer", - "bindFramebuffer", - "bindRenderbuffer", - "bindTexture", - "blendColor", - "blendEquation", - "blendEquationSeparate", - "blendFunc", - "blendFuncSeparate", - "blink", - "blob", - "blockDirection", - "blue", - "blur", - "body", - "bodyUsed", - "bold", - "bookmarks", - "booleanValue", - "border", - "border-bottom", - "border-bottom-color", - "border-bottom-left-radius", - "border-bottom-right-radius", - "border-bottom-style", - "border-bottom-width", - "border-collapse", - "border-color", - "border-image", - "border-image-outset", - "border-image-repeat", - "border-image-slice", - "border-image-source", - "border-image-width", - "border-left", - "border-left-color", - "border-left-style", - "border-left-width", - "border-radius", - "border-right", - "border-right-color", - "border-right-style", - "border-right-width", - "border-spacing", - "border-style", - "border-top", - "border-top-color", - "border-top-left-radius", - "border-top-right-radius", - "border-top-style", - "border-top-width", - "border-width", - "borderBottom", - "borderBottomColor", - "borderBottomLeftRadius", - "borderBottomRightRadius", - "borderBottomStyle", - "borderBottomWidth", - "borderCollapse", - "borderColor", - "borderColorDark", - "borderColorLight", - "borderImage", - "borderImageOutset", - "borderImageRepeat", - "borderImageSlice", - "borderImageSource", - "borderImageWidth", - "borderLeft", - "borderLeftColor", - "borderLeftStyle", - "borderLeftWidth", - "borderRadius", - "borderRight", - "borderRightColor", - "borderRightStyle", - "borderRightWidth", - "borderSpacing", - "borderStyle", - "borderTop", - "borderTopColor", - "borderTopLeftRadius", - "borderTopRightRadius", - "borderTopStyle", - "borderTopWidth", - "borderWidth", - "bottom", - "bottomMargin", - "bound", - "boundElements", - "boundingClientRect", - "boundingHeight", - "boundingLeft", - "boundingTop", - "boundingWidth", - "bounds", - "box-decoration-break", - "box-shadow", - "box-sizing", - "boxDecorationBreak", - "boxShadow", - "boxSizing", - "breakAfter", - "breakBefore", - "breakInside", - "browserLanguage", - "btoa", - "bubbles", - "buffer", - "bufferData", - "bufferDepth", - "bufferSize", - "bufferSubData", - "buffered", - "bufferedAmount", - "buildID", - "buildNumber", - "button", - "buttonID", - "buttons", - "byteLength", - "byteOffset", - "c", - "call", - "caller", - "canBeFormatted", - "canBeMounted", - "canBeShared", - "canHaveChildren", - "canHaveHTML", - "canPlayType", - "cancel", - "cancelAnimationFrame", - "cancelBubble", - "cancelScheduledValues", - "cancelable", - "candidate", - "canvas", - "caption", - "caption-side", - "captionSide", - "captureEvents", - "captureStackTrace", - "caretPositionFromPoint", - "caretRangeFromPoint", - "cast", - "catch", - "category", - "cbrt", - "cd", - "ceil", - "cellIndex", - "cellPadding", - "cellSpacing", - "cells", - "ch", - "chOff", - "chain", - "challenge", - "changedTouches", - "channel", - "channelCount", - "channelCountMode", - "channelInterpretation", - "char", - "charAt", - "charCode", - "charCodeAt", - "charIndex", - "characterSet", - "charging", - "chargingTime", - "charset", - "checkEnclosure", - "checkFramebufferStatus", - "checkIntersection", - "checkValidity", - "checked", - "childElementCount", - "childNodes", - "children", - "chrome", - "ciphertext", - "cite", - "classList", - "className", - "classid", - "clear", - "clearAttributes", - "clearColor", - "clearData", - "clearDepth", - "clearImmediate", - "clearInterval", - "clearMarks", - "clearMeasures", - "clearParameters", - "clearRect", - "clearResourceTimings", - "clearShadow", - "clearStencil", - "clearTimeout", - "clearWatch", - "click", - "clickCount", - "clientHeight", - "clientInformation", - "clientLeft", - "clientRect", - "clientRects", - "clientTop", - "clientWidth", - "clientX", - "clientY", - "clip", - "clip-path", - "clip-rule", - "clipBottom", - "clipLeft", - "clipPath", - "clipPathUnits", - "clipRight", - "clipRule", - "clipTop", - "clipboardData", - "clone", - "cloneContents", - "cloneNode", - "cloneRange", - "close", - "closePath", - "closed", - "closest", - "clz", - "clz32", - "cmp", - "code", - "codeBase", - "codePointAt", - "codeType", - "colSpan", - "collapse", - "collapseToEnd", - "collapseToStart", - "collapsed", - "collect", - "colno", - "color", - "color-interpolation", - "color-interpolation-filters", - "colorDepth", - "colorInterpolation", - "colorInterpolationFilters", - "colorMask", - "colorType", - "cols", - "columnCount", - "columnFill", - "columnGap", - "columnNumber", - "columnRule", - "columnRuleColor", - "columnRuleStyle", - "columnRuleWidth", - "columnSpan", - "columnWidth", - "columns", - "command", - "commitPreferences", - "commonAncestorContainer", - "compact", - "compareBoundaryPoints", - "compareDocumentPosition", - "compareEndPoints", - "compareNode", - "comparePoint", - "compatMode", - "compatible", - "compile", - "compileShader", - "complete", - "componentFromPoint", - "compositionEndOffset", - "compositionStartOffset", - "compressedTexImage2D", - "compressedTexSubImage2D", - "concat", - "conditionText", - "coneInnerAngle", - "coneOuterAngle", - "coneOuterGain", - "confirm", - "confirmComposition", - "confirmSiteSpecificTrackingException", - "confirmWebWideTrackingException", - "connect", - "connectEnd", - "connectStart", - "connected", - "connection", - "connectionSpeed", - "console", - "consolidate", - "constrictionActive", - "constructor", - "contactID", - "contains", - "containsNode", - "content", - "contentDocument", - "contentEditable", - "contentOverflow", - "contentScriptType", - "contentStyleType", - "contentType", - "contentWindow", - "context", - "contextMenu", - "contextmenu", - "continue", - "continuous", - "control", - "controller", - "controls", - "convertToSpecifiedUnits", - "cookie", - "cookieEnabled", - "coords", - "copyFromChannel", - "copyTexImage2D", - "copyTexSubImage2D", - "copyToChannel", - "copyWithin", - "correspondingElement", - "correspondingUseElement", - "cos", - "cosh", - "count", - "counter-increment", - "counter-reset", - "counterIncrement", - "counterReset", - "cpuClass", - "cpuSleepAllowed", - "create", - "createAnalyser", - "createAnswer", - "createAttribute", - "createAttributeNS", - "createBiquadFilter", - "createBuffer", - "createBufferSource", - "createCDATASection", - "createCSSStyleSheet", - "createCaption", - "createChannelMerger", - "createChannelSplitter", - "createComment", - "createContextualFragment", - "createControlRange", - "createConvolver", - "createDTMFSender", - "createDataChannel", - "createDelay", - "createDelayNode", - "createDocument", - "createDocumentFragment", - "createDocumentType", - "createDynamicsCompressor", - "createElement", - "createElementNS", - "createEntityReference", - "createEvent", - "createEventObject", - "createExpression", - "createFramebuffer", - "createFunction", - "createGain", - "createGainNode", - "createHTMLDocument", - "createImageBitmap", - "createImageData", - "createIndex", - "createJavaScriptNode", - "createLinearGradient", - "createMediaElementSource", - "createMediaKeys", - "createMediaStreamDestination", - "createMediaStreamSource", - "createMutableFile", - "createNSResolver", - "createNodeIterator", - "createNotification", - "createObjectStore", - "createObjectURL", - "createOffer", - "createOscillator", - "createPanner", - "createPattern", - "createPeriodicWave", - "createPopup", - "createProcessingInstruction", - "createProgram", - "createRadialGradient", - "createRange", - "createRangeCollection", - "createRenderbuffer", - "createSVGAngle", - "createSVGLength", - "createSVGMatrix", - "createSVGNumber", - "createSVGPathSegArcAbs", - "createSVGPathSegArcRel", - "createSVGPathSegClosePath", - "createSVGPathSegCurvetoCubicAbs", - "createSVGPathSegCurvetoCubicRel", - "createSVGPathSegCurvetoCubicSmoothAbs", - "createSVGPathSegCurvetoCubicSmoothRel", - "createSVGPathSegCurvetoQuadraticAbs", - "createSVGPathSegCurvetoQuadraticRel", - "createSVGPathSegCurvetoQuadraticSmoothAbs", - "createSVGPathSegCurvetoQuadraticSmoothRel", - "createSVGPathSegLinetoAbs", - "createSVGPathSegLinetoHorizontalAbs", - "createSVGPathSegLinetoHorizontalRel", - "createSVGPathSegLinetoRel", - "createSVGPathSegLinetoVerticalAbs", - "createSVGPathSegLinetoVerticalRel", - "createSVGPathSegMovetoAbs", - "createSVGPathSegMovetoRel", - "createSVGPoint", - "createSVGRect", - "createSVGTransform", - "createSVGTransformFromMatrix", - "createScriptProcessor", - "createSession", - "createShader", - "createShadowRoot", - "createStereoPanner", - "createStyleSheet", - "createTBody", - "createTFoot", - "createTHead", - "createTextNode", - "createTextRange", - "createTexture", - "createTouch", - "createTouchList", - "createTreeWalker", - "createWaveShaper", - "creationTime", - "crossOrigin", - "crypto", - "csi", - "cssFloat", - "cssRules", - "cssText", - "cssValueType", - "ctrlKey", - "ctrlLeft", - "cues", - "cullFace", - "currentNode", - "currentPage", - "currentScale", - "currentScript", - "currentSrc", - "currentState", - "currentStyle", - "currentTarget", - "currentTime", - "currentTranslate", - "currentView", - "cursor", - "curve", - "customError", - "cx", - "cy", - "d", - "data", - "dataFld", - "dataFormatAs", - "dataPageSize", - "dataSrc", - "dataTransfer", - "database", - "dataset", - "dateTime", - "db", - "debug", - "debuggerEnabled", - "declare", - "decode", - "decodeAudioData", - "decodeURI", - "decodeURIComponent", - "decrypt", - "default", - "defaultCharset", - "defaultChecked", - "defaultMuted", - "defaultPlaybackRate", - "defaultPrevented", - "defaultSelected", - "defaultStatus", - "defaultURL", - "defaultValue", - "defaultView", - "defaultstatus", - "defer", - "defineMagicFunction", - "defineMagicVariable", - "defineProperties", - "defineProperty", - "delayTime", - "delete", - "deleteBuffer", - "deleteCaption", - "deleteCell", - "deleteContents", - "deleteData", - "deleteDatabase", - "deleteFramebuffer", - "deleteFromDocument", - "deleteIndex", - "deleteMedium", - "deleteObjectStore", - "deleteProgram", - "deleteRenderbuffer", - "deleteRow", - "deleteRule", - "deleteShader", - "deleteTFoot", - "deleteTHead", - "deleteTexture", - "deliverChangeRecords", - "delivery", - "deliveryInfo", - "deliveryStatus", - "deliveryTimestamp", - "delta", - "deltaMode", - "deltaX", - "deltaY", - "deltaZ", - "depthFunc", - "depthMask", - "depthRange", - "deriveBits", - "deriveKey", - "description", - "deselectAll", - "designMode", - "destination", - "destinationURL", - "detach", - "detachEvent", - "detachShader", - "detail", - "detune", - "devicePixelRatio", - "deviceXDPI", - "deviceYDPI", - "diffuseConstant", - "digest", - "dimensions", - "dir", - "dirName", - "direction", - "dirxml", - "disable", - "disableVertexAttribArray", - "disabled", - "dischargingTime", - "disconnect", - "dispatchEvent", - "display", - "distanceModel", - "divisor", - "djsapi", - "djsproxy", - "doImport", - "doNotTrack", - "doScroll", - "doctype", - "document", - "documentElement", - "documentMode", - "documentURI", - "dolphin", - "dolphinGameCenter", - "dolphininfo", - "dolphinmeta", - "domComplete", - "domContentLoadedEventEnd", - "domContentLoadedEventStart", - "domInteractive", - "domLoading", - "domain", - "domainLookupEnd", - "domainLookupStart", - "dominant-baseline", - "dominantBaseline", - "done", - "dopplerFactor", - "download", - "dragDrop", - "draggable", - "drawArrays", - "drawArraysInstancedANGLE", - "drawCustomFocusRing", - "drawElements", - "drawElementsInstancedANGLE", - "drawFocusIfNeeded", - "drawImage", - "drawImageFromRect", - "drawSystemFocusRing", - "drawingBufferHeight", - "drawingBufferWidth", - "dropEffect", - "droppedVideoFrames", - "dropzone", - "dump", - "duplicate", - "duration", - "dvname", - "dvnum", - "dx", - "dy", - "dynsrc", - "e", - "edgeMode", - "effectAllowed", - "elapsedTime", - "elementFromPoint", - "elements", - "elevation", - "ellipse", - "email", - "embeds", - "empty", - "empty-cells", - "emptyCells", - "enable", - "enableBackground", - "enableStyleSheetsForSet", - "enableVertexAttribArray", - "enabled", - "enabledPlugin", - "encode", - "encodeURI", - "encodeURIComponent", - "encoding", - "encrypt", - "enctype", - "end", - "endContainer", - "endElement", - "endElementAt", - "endOfStream", - "endOffset", - "endTime", - "ended", - "endsWith", - "entities", - "entries", - "entryType", - "enumerate", - "enumerateEditable", - "error", - "errorCode", - "escape", - "eval", - "evaluate", - "event", - "eventPhase", - "every", - "exception", - "exec", - "execCommand", - "execCommandShowHelp", - "execScript", - "exitFullscreen", - "exitPointerLock", - "exp", - "expand", - "expandEntityReferences", - "expando", - "expansion", - "expiryDate", - "explicitOriginalTarget", - "expm1", - "exponent", - "exponentialRampToValueAtTime", - "exportKey", - "extend", - "extensions", - "extentNode", - "extentOffset", - "external", - "externalResourcesRequired", - "extractContents", - "extractable", - "f", - "face", - "factoryReset", - "fallback", - "familyName", - "farthestViewportElement", - "fastSeek", - "fatal", - "fetch", - "fetchStart", - "fftSize", - "fgColor", - "fileCreatedDate", - "fileHandle", - "fileModifiedDate", - "fileName", - "fileSize", - "fileUpdatedDate", - "filename", - "files", - "fill", - "fill-opacity", - "fill-rule", - "fillOpacity", - "fillRect", - "fillRule", - "fillStyle", - "fillText", - "filter", - "filterResX", - "filterResY", - "filterUnits", - "filters", - "find", - "findIndex", - "findRule", - "findText", - "finish", - "fireEvent", - "firstChild", - "firstElementChild", - "firstPage", - "fixed", - "flex", - "flex-basis", - "flex-direction", - "flex-flow", - "flex-grow", - "flex-shrink", - "flex-wrap", - "flexBasis", - "flexDirection", - "flexFlow", - "flexGrow", - "flexShrink", - "flexWrap", - "flipX", - "flipY", - "float", - "flood-color", - "flood-opacity", - "floodColor", - "floodOpacity", - "floor", - "flush", - "focus", - "focusNode", - "focusOffset", - "font", - "font-family", - "font-feature-settings", - "font-kerning", - "font-language-override", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-synthesis", - "font-variant", - "font-variant-alternates", - "font-variant-caps", - "font-variant-east-asian", - "font-variant-ligatures", - "font-variant-numeric", - "font-variant-position", - "font-weight", - "fontFamily", - "fontFeatureSettings", - "fontKerning", - "fontLanguageOverride", - "fontSize", - "fontSizeAdjust", - "fontSmoothingEnabled", - "fontStretch", - "fontStyle", - "fontSynthesis", - "fontVariant", - "fontVariantAlternates", - "fontVariantCaps", - "fontVariantEastAsian", - "fontVariantLigatures", - "fontVariantNumeric", - "fontVariantPosition", - "fontWeight", - "fontcolor", - "fonts", - "fontsize", - "for", - "forEach", - "forceRedraw", - "form", - "formAction", - "formEnctype", - "formMethod", - "formNoValidate", - "formTarget", - "format", - "forms", - "forward", - "fr", - "frame", - "frameBorder", - "frameElement", - "frameSpacing", - "framebufferRenderbuffer", - "framebufferTexture2D", - "frames", - "freeSpace", - "freeze", - "frequency", - "frequencyBinCount", - "from", - "fromCharCode", - "fromCodePoint", - "fromElement", - "frontFace", - "fround", - "fullScreen", - "fullscreenElement", - "fullscreenEnabled", - "fx", - "fy", - "gain", - "gamepad", - "gamma", - "genderIdentity", - "generateKey", - "generateMipmap", - "generateRequest", - "geolocation", - "gestureObject", - "get", - "getActiveAttrib", - "getActiveUniform", - "getAdjacentText", - "getAll", - "getAllResponseHeaders", - "getAsFile", - "getAsString", - "getAttachedShaders", - "getAttribLocation", - "getAttribute", - "getAttributeNS", - "getAttributeNode", - "getAttributeNodeNS", - "getAudioTracks", - "getBBox", - "getBattery", - "getBlob", - "getBookmark", - "getBoundingClientRect", - "getBufferParameter", - "getByteFrequencyData", - "getByteTimeDomainData", - "getCSSCanvasContext", - "getCTM", - "getCandidateWindowClientRect", - "getChannelData", - "getCharNumAtPosition", - "getClientRect", - "getClientRects", - "getCompositionAlternatives", - "getComputedStyle", - "getComputedTextLength", - "getConfiguration", - "getContext", - "getContextAttributes", - "getCounterValue", - "getCueAsHTML", - "getCueById", - "getCurrentPosition", - "getCurrentTime", - "getData", - "getDatabaseNames", - "getDate", - "getDay", - "getDefaultComputedStyle", - "getDestinationInsertionPoints", - "getDistributedNodes", - "getEditable", - "getElementById", - "getElementsByClassName", - "getElementsByName", - "getElementsByTagName", - "getElementsByTagNameNS", - "getEnclosureList", - "getEndPositionOfChar", - "getEntries", - "getEntriesByName", - "getEntriesByType", - "getError", - "getExtension", - "getExtentOfChar", - "getFeature", - "getFile", - "getFloat32", - "getFloat64", - "getFloatFrequencyData", - "getFloatTimeDomainData", - "getFloatValue", - "getFramebufferAttachmentParameter", - "getFrequencyResponse", - "getFullYear", - "getGamepads", - "getHours", - "getImageData", - "getInt16", - "getInt32", - "getInt8", - "getIntersectionList", - "getItem", - "getItems", - "getKey", - "getLineDash", - "getLocalStreams", - "getMarks", - "getMatchedCSSRules", - "getMeasures", - "getMetadata", - "getMilliseconds", - "getMinutes", - "getModifierState", - "getMonth", - "getNamedItem", - "getNamedItemNS", - "getNotifier", - "getNumberOfChars", - "getOverrideHistoryNavigationMode", - "getOverrideStyle", - "getOwnPropertyDescriptor", - "getOwnPropertyNames", - "getOwnPropertySymbols", - "getParameter", - "getPathSegAtLength", - "getPointAtLength", - "getPreference", - "getPreferenceDefault", - "getPresentationAttribute", - "getPreventDefault", - "getProgramInfoLog", - "getProgramParameter", - "getPropertyCSSValue", - "getPropertyPriority", - "getPropertyShorthand", - "getPropertyValue", - "getPrototypeOf", - "getRGBColorValue", - "getRandomValues", - "getRangeAt", - "getReceivers", - "getRectValue", - "getRegistration", - "getRemoteStreams", - "getRenderbufferParameter", - "getResponseHeader", - "getRoot", - "getRotationOfChar", - "getSVGDocument", - "getScreenCTM", - "getSeconds", - "getSelection", - "getSenders", - "getShaderInfoLog", - "getShaderParameter", - "getShaderPrecisionFormat", - "getShaderSource", - "getSimpleDuration", - "getSiteIcons", - "getSources", - "getSpeculativeParserUrls", - "getStartPositionOfChar", - "getStartTime", - "getStats", - "getStorageUpdates", - "getStreamById", - "getStringValue", - "getSubStringLength", - "getSubscription", - "getSupportedExtensions", - "getTexParameter", - "getTime", - "getTimezoneOffset", - "getTotalLength", - "getTrackById", - "getTracks", - "getTransformToElement", - "getUTCDate", - "getUTCDay", - "getUTCFullYear", - "getUTCHours", - "getUTCMilliseconds", - "getUTCMinutes", - "getUTCMonth", - "getUTCSeconds", - "getUint16", - "getUint32", - "getUint8", - "getUniform", - "getUniformLocation", - "getUserMedia", - "getValues", - "getVarDate", - "getVariableValue", - "getVertexAttrib", - "getVertexAttribOffset", - "getVideoPlaybackQuality", - "getVideoTracks", - "getWakeLockState", - "getYear", - "givenName", - "global", - "globalAlpha", - "globalCompositeOperation", - "glyphOrientationHorizontal", - "glyphOrientationVertical", - "glyphRef", - "go", - "gradientTransform", - "gradientUnits", - "grammars", - "green", - "group", - "groupCollapsed", - "groupEnd", - "hardwareConcurrency", - "has", - "hasAttribute", - "hasAttributeNS", - "hasAttributes", - "hasChildNodes", - "hasComposition", - "hasExtension", - "hasFeature", - "hasFocus", - "hasLayout", - "hasOwnProperty", - "hash", - "head", - "headers", - "heading", - "height", - "hidden", - "hide", - "hideFocus", - "high", - "hint", - "history", - "honorificPrefix", - "honorificSuffix", - "horizontalOverflow", - "host", - "hostname", - "href", - "hreflang", - "hspace", - "html5TagCheckInerface", - "htmlFor", - "htmlText", - "httpEquiv", - "hwTimestamp", - "hypot", - "iccId", - "iceConnectionState", - "iceGatheringState", - "icon", - "id", - "identifier", - "identity", - "ignoreBOM", - "ignoreCase", - "image-orientation", - "image-rendering", - "imageOrientation", - "imageRendering", - "images", - "ime-mode", - "imeMode", - "implementation", - "importKey", - "importNode", - "importStylesheet", - "imports", - "impp", - "imul", - "in1", - "in2", - "inBandMetadataTrackDispatchType", - "inRange", - "includes", - "incremental", - "indeterminate", - "index", - "indexNames", - "indexOf", - "indexedDB", - "inertiaDestinationX", - "inertiaDestinationY", - "info", - "init", - "initAnimationEvent", - "initBeforeLoadEvent", - "initClipboardEvent", - "initCloseEvent", - "initCommandEvent", - "initCompositionEvent", - "initCustomEvent", - "initData", - "initDeviceMotionEvent", - "initDeviceOrientationEvent", - "initDragEvent", - "initErrorEvent", - "initEvent", - "initFocusEvent", - "initGestureEvent", - "initHashChangeEvent", - "initKeyEvent", - "initKeyboardEvent", - "initMSManipulationEvent", - "initMessageEvent", - "initMouseEvent", - "initMouseScrollEvent", - "initMouseWheelEvent", - "initMutationEvent", - "initNSMouseEvent", - "initOverflowEvent", - "initPageEvent", - "initPageTransitionEvent", - "initPointerEvent", - "initPopStateEvent", - "initProgressEvent", - "initScrollAreaEvent", - "initSimpleGestureEvent", - "initStorageEvent", - "initTextEvent", - "initTimeEvent", - "initTouchEvent", - "initTransitionEvent", - "initUIEvent", - "initWebKitAnimationEvent", - "initWebKitTransitionEvent", - "initWebKitWheelEvent", - "initWheelEvent", - "initialTime", - "initialize", - "initiatorType", - "inner", - "innerHTML", - "innerHeight", - "innerText", - "innerWidth", - "input", - "inputBuffer", - "inputEncoding", - "inputMethod", - "insertAdjacentElement", - "insertAdjacentHTML", - "insertAdjacentText", - "insertBefore", - "insertCell", - "insertData", - "insertItemBefore", - "insertNode", - "insertRow", - "insertRule", - "instanceRoot", - "intercept", - "interimResults", - "internalSubset", - "intersectsNode", - "interval", - "invalidIteratorState", - "inverse", - "invertSelf", - "is", - "is2D", - "isAlternate", - "isArray", - "isBingCurrentSearchDefault", - "isBuffer", - "isCandidateWindowVisible", - "isChar", - "isCollapsed", - "isComposing", - "isContentEditable", - "isContentHandlerRegistered", - "isContextLost", - "isDefaultNamespace", - "isDisabled", - "isEnabled", - "isEqual", - "isEqualNode", - "isExtensible", - "isFinite", - "isFramebuffer", - "isFrozen", - "isGenerator", - "isId", - "isInjected", - "isInteger", - "isMap", - "isMultiLine", - "isNaN", - "isOpen", - "isPointInFill", - "isPointInPath", - "isPointInRange", - "isPointInStroke", - "isPrefAlternate", - "isPrimary", - "isProgram", - "isPropertyImplicit", - "isProtocolHandlerRegistered", - "isPrototypeOf", - "isRenderbuffer", - "isSafeInteger", - "isSameNode", - "isSealed", - "isShader", - "isSupported", - "isTextEdit", - "isTexture", - "isTrusted", - "isTypeSupported", - "isView", - "isolation", - "italics", - "item", - "itemId", - "itemProp", - "itemRef", - "itemScope", - "itemType", - "itemValue", - "iterateNext", - "iterator", - "javaEnabled", - "jobTitle", - "join", - "json", - "justify-content", - "justifyContent", - "k1", - "k2", - "k3", - "k4", - "kernelMatrix", - "kernelUnitLengthX", - "kernelUnitLengthY", - "kerning", - "key", - "keyCode", - "keyFor", - "keyIdentifier", - "keyLightEnabled", - "keyLocation", - "keyPath", - "keySystem", - "keyText", - "keyUsage", - "keys", - "keytype", - "kind", - "knee", - "label", - "labels", - "lang", - "language", - "languages", - "largeArcFlag", - "lastChild", - "lastElementChild", - "lastEventId", - "lastIndex", - "lastIndexOf", - "lastMatch", - "lastMessageSubject", - "lastMessageType", - "lastModified", - "lastModifiedDate", - "lastPage", - "lastParen", - "lastState", - "lastStyleSheetSet", - "latitude", - "layerX", - "layerY", - "layoutFlow", - "layoutGrid", - "layoutGridChar", - "layoutGridLine", - "layoutGridMode", - "layoutGridType", - "lbound", - "left", - "leftContext", - "leftMargin", - "length", - "lengthAdjust", - "lengthComputable", - "letter-spacing", - "letterSpacing", - "level", - "lighting-color", - "lightingColor", - "limitingConeAngle", - "line", - "line-height", - "lineAlign", - "lineBreak", - "lineCap", - "lineDashOffset", - "lineHeight", - "lineJoin", - "lineNumber", - "lineTo", - "lineWidth", - "linearRampToValueAtTime", - "lineno", - "link", - "linkColor", - "linkProgram", - "links", - "list", - "list-style", - "list-style-image", - "list-style-position", - "list-style-type", - "listStyle", - "listStyleImage", - "listStylePosition", - "listStyleType", - "listener", - "load", - "loadEventEnd", - "loadEventStart", - "loadTimes", - "loaded", - "localDescription", - "localName", - "localStorage", - "locale", - "localeCompare", - "location", - "locationbar", - "lock", - "lockedFile", - "log", - "log10", - "log1p", - "log2", - "logicalXDPI", - "logicalYDPI", - "longDesc", - "longitude", - "lookupNamespaceURI", - "lookupPrefix", - "loop", - "loopEnd", - "loopStart", - "looping", - "low", - "lower", - "lowerBound", - "lowerOpen", - "lowsrc", - "m11", - "m12", - "m13", - "m14", - "m21", - "m22", - "m23", - "m24", - "m31", - "m32", - "m33", - "m34", - "m41", - "m42", - "m43", - "m44", - "manifest", - "map", - "mapping", - "margin", - "margin-bottom", - "margin-left", - "margin-right", - "margin-top", - "marginBottom", - "marginHeight", - "marginLeft", - "marginRight", - "marginTop", - "marginWidth", - "mark", - "marker", - "marker-end", - "marker-mid", - "marker-offset", - "marker-start", - "markerEnd", - "markerHeight", - "markerMid", - "markerOffset", - "markerStart", - "markerUnits", - "markerWidth", - "marks", - "mask", - "mask-type", - "maskContentUnits", - "maskType", - "maskUnits", - "match", - "matchMedia", - "matchMedium", - "matches", - "matrix", - "matrixTransform", - "max", - "max-height", - "max-width", - "maxAlternatives", - "maxChannelCount", - "maxConnectionsPerServer", - "maxDecibels", - "maxDistance", - "maxHeight", - "maxLength", - "maxTouchPoints", - "maxValue", - "maxWidth", - "measure", - "measureText", - "media", - "mediaDevices", - "mediaElement", - "mediaGroup", - "mediaKeys", - "mediaText", - "meetOrSlice", - "memory", - "menubar", - "mergeAttributes", - "message", - "messageClass", - "messageHandlers", - "metaKey", - "method", - "mimeType", - "mimeTypes", - "min", - "min-height", - "min-width", - "minDecibels", - "minHeight", - "minValue", - "minWidth", - "miterLimit", - "mix-blend-mode", - "mixBlendMode", - "mode", - "modify", - "mount", - "move", - "moveBy", - "moveEnd", - "moveFirst", - "moveFocusDown", - "moveFocusLeft", - "moveFocusRight", - "moveFocusUp", - "moveNext", - "moveRow", - "moveStart", - "moveTo", - "moveToBookmark", - "moveToElementText", - "moveToPoint", - "mozAdd", - "mozAnimationStartTime", - "mozAnon", - "mozApps", - "mozAudioCaptured", - "mozAudioChannelType", - "mozAutoplayEnabled", - "mozCancelAnimationFrame", - "mozCancelFullScreen", - "mozCancelRequestAnimationFrame", - "mozCaptureStream", - "mozCaptureStreamUntilEnded", - "mozClearDataAt", - "mozContact", - "mozContacts", - "mozCreateFileHandle", - "mozCurrentTransform", - "mozCurrentTransformInverse", - "mozCursor", - "mozDash", - "mozDashOffset", - "mozDecodedFrames", - "mozExitPointerLock", - "mozFillRule", - "mozFragmentEnd", - "mozFrameDelay", - "mozFullScreen", - "mozFullScreenElement", - "mozFullScreenEnabled", - "mozGetAll", - "mozGetAllKeys", - "mozGetAsFile", - "mozGetDataAt", - "mozGetMetadata", - "mozGetUserMedia", - "mozHasAudio", - "mozHasItem", - "mozHidden", - "mozImageSmoothingEnabled", - "mozIndexedDB", - "mozInnerScreenX", - "mozInnerScreenY", - "mozInputSource", - "mozIsTextField", - "mozItem", - "mozItemCount", - "mozItems", - "mozLength", - "mozLockOrientation", - "mozMatchesSelector", - "mozMovementX", - "mozMovementY", - "mozOpaque", - "mozOrientation", - "mozPaintCount", - "mozPaintedFrames", - "mozParsedFrames", - "mozPay", - "mozPointerLockElement", - "mozPresentedFrames", - "mozPreservesPitch", - "mozPressure", - "mozPrintCallback", - "mozRTCIceCandidate", - "mozRTCPeerConnection", - "mozRTCSessionDescription", - "mozRemove", - "mozRequestAnimationFrame", - "mozRequestFullScreen", - "mozRequestPointerLock", - "mozSetDataAt", - "mozSetImageElement", - "mozSourceNode", - "mozSrcObject", - "mozSystem", - "mozTCPSocket", - "mozTextStyle", - "mozTypesAt", - "mozUnlockOrientation", - "mozUserCancelled", - "mozVisibilityState", - "msAnimation", - "msAnimationDelay", - "msAnimationDirection", - "msAnimationDuration", - "msAnimationFillMode", - "msAnimationIterationCount", - "msAnimationName", - "msAnimationPlayState", - "msAnimationStartTime", - "msAnimationTimingFunction", - "msBackfaceVisibility", - "msBlockProgression", - "msCSSOMElementFloatMetrics", - "msCaching", - "msCachingEnabled", - "msCancelRequestAnimationFrame", - "msCapsLockWarningOff", - "msClearImmediate", - "msClose", - "msContentZoomChaining", - "msContentZoomFactor", - "msContentZoomLimit", - "msContentZoomLimitMax", - "msContentZoomLimitMin", - "msContentZoomSnap", - "msContentZoomSnapPoints", - "msContentZoomSnapType", - "msContentZooming", - "msConvertURL", - "msCrypto", - "msDoNotTrack", - "msElementsFromPoint", - "msElementsFromRect", - "msExitFullscreen", - "msExtendedCode", - "msFillRule", - "msFirstPaint", - "msFlex", - "msFlexAlign", - "msFlexDirection", - "msFlexFlow", - "msFlexItemAlign", - "msFlexLinePack", - "msFlexNegative", - "msFlexOrder", - "msFlexPack", - "msFlexPositive", - "msFlexPreferredSize", - "msFlexWrap", - "msFlowFrom", - "msFlowInto", - "msFontFeatureSettings", - "msFullscreenElement", - "msFullscreenEnabled", - "msGetInputContext", - "msGetRegionContent", - "msGetUntransformedBounds", - "msGraphicsTrustStatus", - "msGridColumn", - "msGridColumnAlign", - "msGridColumnSpan", - "msGridColumns", - "msGridRow", - "msGridRowAlign", - "msGridRowSpan", - "msGridRows", - "msHidden", - "msHighContrastAdjust", - "msHyphenateLimitChars", - "msHyphenateLimitLines", - "msHyphenateLimitZone", - "msHyphens", - "msImageSmoothingEnabled", - "msImeAlign", - "msIndexedDB", - "msInterpolationMode", - "msIsStaticHTML", - "msKeySystem", - "msKeys", - "msLaunchUri", - "msLockOrientation", - "msManipulationViewsEnabled", - "msMatchMedia", - "msMatchesSelector", - "msMaxTouchPoints", - "msOrientation", - "msOverflowStyle", - "msPerspective", - "msPerspectiveOrigin", - "msPlayToDisabled", - "msPlayToPreferredSourceUri", - "msPlayToPrimary", - "msPointerEnabled", - "msRegionOverflow", - "msReleasePointerCapture", - "msRequestAnimationFrame", - "msRequestFullscreen", - "msSaveBlob", - "msSaveOrOpenBlob", - "msScrollChaining", - "msScrollLimit", - "msScrollLimitXMax", - "msScrollLimitXMin", - "msScrollLimitYMax", - "msScrollLimitYMin", - "msScrollRails", - "msScrollSnapPointsX", - "msScrollSnapPointsY", - "msScrollSnapType", - "msScrollSnapX", - "msScrollSnapY", - "msScrollTranslation", - "msSetImmediate", - "msSetMediaKeys", - "msSetPointerCapture", - "msTextCombineHorizontal", - "msTextSizeAdjust", - "msToBlob", - "msTouchAction", - "msTouchSelect", - "msTraceAsyncCallbackCompleted", - "msTraceAsyncCallbackStarting", - "msTraceAsyncOperationCompleted", - "msTraceAsyncOperationStarting", - "msTransform", - "msTransformOrigin", - "msTransformStyle", - "msTransition", - "msTransitionDelay", - "msTransitionDuration", - "msTransitionProperty", - "msTransitionTimingFunction", - "msUnlockOrientation", - "msUpdateAsyncCallbackRelation", - "msUserSelect", - "msVisibilityState", - "msWrapFlow", - "msWrapMargin", - "msWrapThrough", - "msWriteProfilerMark", - "msZoom", - "msZoomTo", - "mt", - "multiEntry", - "multiSelectionObj", - "multiline", - "multiple", - "multiply", - "multiplySelf", - "mutableFile", - "muted", - "n", - "name", - "nameProp", - "namedItem", - "namedRecordset", - "names", - "namespaceURI", - "namespaces", - "naturalHeight", - "naturalWidth", - "navigate", - "navigation", - "navigationMode", - "navigationStart", - "navigator", - "near", - "nearestViewportElement", - "negative", - "netscape", - "networkState", - "newScale", - "newTranslate", - "newURL", - "newValue", - "newValueSpecifiedUnits", - "newVersion", - "newhome", - "next", - "nextElementSibling", - "nextNode", - "nextPage", - "nextSibling", - "nickname", - "noHref", - "noResize", - "noShade", - "noValidate", - "noWrap", - "nodeName", - "nodeType", - "nodeValue", - "normalize", - "normalizedPathSegList", - "notationName", - "notations", - "note", - "noteGrainOn", - "noteOff", - "noteOn", - "now", - "numOctaves", - "number", - "numberOfChannels", - "numberOfInputs", - "numberOfItems", - "numberOfOutputs", - "numberValue", - "oMatchesSelector", - "object", - "object-fit", - "object-position", - "objectFit", - "objectPosition", - "objectStore", - "objectStoreNames", - "observe", - "of", - "offscreenBuffering", - "offset", - "offsetHeight", - "offsetLeft", - "offsetNode", - "offsetParent", - "offsetTop", - "offsetWidth", - "offsetX", - "offsetY", - "ok", - "oldURL", - "oldValue", - "oldVersion", - "olderShadowRoot", - "onLine", - "onabort", - "onactivate", - "onactive", - "onaddstream", - "onaddtrack", - "onafterprint", - "onafterscriptexecute", - "onafterupdate", - "onaudioend", - "onaudioprocess", - "onaudiostart", - "onautocomplete", - "onautocompleteerror", - "onbeforeactivate", - "onbeforecopy", - "onbeforecut", - "onbeforedeactivate", - "onbeforeeditfocus", - "onbeforepaste", - "onbeforeprint", - "onbeforescriptexecute", - "onbeforeunload", - "onbeforeupdate", - "onblocked", - "onblur", - "onbounce", - "onboundary", - "oncached", - "oncancel", - "oncandidatewindowhide", - "oncandidatewindowshow", - "oncandidatewindowupdate", - "oncanplay", - "oncanplaythrough", - "oncellchange", - "onchange", - "onchargingchange", - "onchargingtimechange", - "onchecking", - "onclick", - "onclose", - "oncompassneedscalibration", - "oncomplete", - "oncontextmenu", - "oncontrolselect", - "oncopy", - "oncuechange", - "oncut", - "ondataavailable", - "ondatachannel", - "ondatasetchanged", - "ondatasetcomplete", - "ondblclick", - "ondeactivate", - "ondevicelight", - "ondevicemotion", - "ondeviceorientation", - "ondeviceproximity", - "ondischargingtimechange", - "ondisplay", - "ondownloading", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onencrypted", - "onend", - "onended", - "onenter", - "onerror", - "onerrorupdate", - "onexit", - "onfilterchange", - "onfinish", - "onfocus", - "onfocusin", - "onfocusout", - "onfullscreenchange", - "onfullscreenerror", - "ongesturechange", - "ongestureend", - "ongesturestart", - "ongotpointercapture", - "onhashchange", - "onhelp", - "onicecandidate", - "oniceconnectionstatechange", - "oninactive", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onlayoutcomplete", - "onlevelchange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onlosecapture", - "onlostpointercapture", - "only", - "onmark", - "onmessage", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onmove", - "onmoveend", - "onmovestart", - "onmozfullscreenchange", - "onmozfullscreenerror", - "onmozorientationchange", - "onmozpointerlockchange", - "onmozpointerlockerror", - "onmscontentzoom", - "onmsfullscreenchange", - "onmsfullscreenerror", - "onmsgesturechange", - "onmsgesturedoubletap", - "onmsgestureend", - "onmsgesturehold", - "onmsgesturestart", - "onmsgesturetap", - "onmsgotpointercapture", - "onmsinertiastart", - "onmslostpointercapture", - "onmsmanipulationstatechanged", - "onmsneedkey", - "onmsorientationchange", - "onmspointercancel", - "onmspointerdown", - "onmspointerenter", - "onmspointerhover", - "onmspointerleave", - "onmspointermove", - "onmspointerout", - "onmspointerover", - "onmspointerup", - "onmssitemodejumplistitemremoved", - "onmsthumbnailclick", - "onnegotiationneeded", - "onnomatch", - "onnoupdate", - "onobsolete", - "onoffline", - "ononline", - "onopen", - "onorientationchange", - "onpagechange", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpluginstreamstart", - "onpointercancel", - "onpointerdown", - "onpointerenter", - "onpointerleave", - "onpointerlockchange", - "onpointerlockerror", - "onpointermove", - "onpointerout", - "onpointerover", - "onpointerup", - "onpopstate", - "onprogress", - "onpropertychange", - "onratechange", - "onreadystatechange", - "onremovestream", - "onremovetrack", - "onreset", - "onresize", - "onresizeend", - "onresizestart", - "onresourcetimingbufferfull", - "onresult", - "onresume", - "onrowenter", - "onrowexit", - "onrowsdelete", - "onrowsinserted", - "onscroll", - "onsearch", - "onseeked", - "onseeking", - "onselect", - "onselectionchange", - "onselectstart", - "onshow", - "onsignalingstatechange", - "onsoundend", - "onsoundstart", - "onspeechend", - "onspeechstart", - "onstalled", - "onstart", - "onstatechange", - "onstop", - "onstorage", - "onstoragecommit", - "onsubmit", - "onsuccess", - "onsuspend", - "ontextinput", - "ontimeout", - "ontimeupdate", - "ontoggle", - "ontouchcancel", - "ontouchend", - "ontouchmove", - "ontouchstart", - "ontransitionend", - "onunload", - "onupdateready", - "onupgradeneeded", - "onuserproximity", - "onversionchange", - "onvoiceschanged", - "onvolumechange", - "onwaiting", - "onwarning", - "onwebkitanimationend", - "onwebkitanimationiteration", - "onwebkitanimationstart", - "onwebkitcurrentplaybacktargetiswirelesschanged", - "onwebkitfullscreenchange", - "onwebkitfullscreenerror", - "onwebkitkeyadded", - "onwebkitkeyerror", - "onwebkitkeymessage", - "onwebkitneedkey", - "onwebkitorientationchange", - "onwebkitplaybacktargetavailabilitychanged", - "onwebkitpointerlockchange", - "onwebkitpointerlockerror", - "onwebkitresourcetimingbufferfull", - "onwebkittransitionend", - "onwheel", - "onzoom", - "opacity", - "open", - "openCursor", - "openDatabase", - "openKeyCursor", - "opener", - "opera", - "operationType", - "operator", - "opr", - "optimum", - "options", - "order", - "orderX", - "orderY", - "ordered", - "org", - "orient", - "orientAngle", - "orientType", - "orientation", - "origin", - "originalTarget", - "orphans", - "oscpu", - "outerHTML", - "outerHeight", - "outerText", - "outerWidth", - "outline", - "outline-color", - "outline-offset", - "outline-style", - "outline-width", - "outlineColor", - "outlineOffset", - "outlineStyle", - "outlineWidth", - "outputBuffer", - "overflow", - "overflow-x", - "overflow-y", - "overflowX", - "overflowY", - "overrideMimeType", - "oversample", - "ownerDocument", - "ownerElement", - "ownerNode", - "ownerRule", - "ownerSVGElement", - "owningElement", - "p1", - "p2", - "p3", - "p4", - "pad", - "padding", - "padding-bottom", - "padding-left", - "padding-right", - "padding-top", - "paddingBottom", - "paddingLeft", - "paddingRight", - "paddingTop", - "page", - "page-break-after", - "page-break-before", - "page-break-inside", - "pageBreakAfter", - "pageBreakBefore", - "pageBreakInside", - "pageCount", - "pageX", - "pageXOffset", - "pageY", - "pageYOffset", - "pages", - "paint-order", - "paintOrder", - "paintRequests", - "paintType", - "palette", - "panningModel", - "parent", - "parentElement", - "parentNode", - "parentRule", - "parentStyleSheet", - "parentTextEdit", - "parentWindow", - "parse", - "parseFloat", - "parseFromString", - "parseInt", - "participants", - "password", - "pasteHTML", - "path", - "pathLength", - "pathSegList", - "pathSegType", - "pathSegTypeAsLetter", - "pathname", - "pattern", - "patternContentUnits", - "patternMismatch", - "patternTransform", - "patternUnits", - "pause", - "pauseAnimations", - "pauseOnExit", - "paused", - "pending", - "performance", - "permission", - "persisted", - "personalbar", - "perspective", - "perspective-origin", - "perspectiveOrigin", - "phoneticFamilyName", - "phoneticGivenName", - "photo", - "ping", - "pitch", - "pixelBottom", - "pixelDepth", - "pixelHeight", - "pixelLeft", - "pixelRight", - "pixelStorei", - "pixelTop", - "pixelUnitToMillimeterX", - "pixelUnitToMillimeterY", - "pixelWidth", - "placeholder", - "platform", - "play", - "playbackRate", - "playbackState", - "playbackTime", - "played", - "plugins", - "pluginspage", - "pname", - "pointer-events", - "pointerBeforeReferenceNode", - "pointerEnabled", - "pointerEvents", - "pointerId", - "pointerLockElement", - "pointerType", - "points", - "pointsAtX", - "pointsAtY", - "pointsAtZ", - "polygonOffset", - "pop", - "popupWindowFeatures", - "popupWindowName", - "popupWindowURI", - "port", - "port1", - "port2", - "ports", - "posBottom", - "posHeight", - "posLeft", - "posRight", - "posTop", - "posWidth", - "position", - "positionAlign", - "postError", - "postMessage", - "poster", - "pow", - "powerOff", - "preMultiplySelf", - "precision", - "preferredStyleSheetSet", - "preferredStylesheetSet", - "prefix", - "preload", - "preserveAlpha", - "preserveAspectRatio", - "preserveAspectRatioString", - "pressed", - "pressure", - "prevValue", - "preventDefault", - "preventExtensions", - "previousElementSibling", - "previousNode", - "previousPage", - "previousScale", - "previousSibling", - "previousTranslate", - "primaryKey", - "primitiveType", - "primitiveUnits", - "principals", - "print", - "privateKey", - "probablySupportsContext", - "process", - "processIceMessage", - "product", - "productSub", - "profile", - "profileEnd", - "profiles", - "prompt", - "properties", - "propertyIsEnumerable", - "propertyName", - "protocol", - "protocolLong", - "prototype", - "pseudoClass", - "pseudoElement", - "publicId", - "publicKey", - "published", - "push", - "pushNotification", - "pushState", - "put", - "putImageData", - "quadraticCurveTo", - "qualifier", - "queryCommandEnabled", - "queryCommandIndeterm", - "queryCommandState", - "queryCommandSupported", - "queryCommandText", - "queryCommandValue", - "querySelector", - "querySelectorAll", - "quote", - "quotes", - "r", - "r1", - "r2", - "race", - "radiogroup", - "radiusX", - "radiusY", - "random", - "range", - "rangeCount", - "rangeMax", - "rangeMin", - "rangeOffset", - "rangeOverflow", - "rangeParent", - "rangeUnderflow", - "rate", - "ratio", - "raw", - "read", - "readAsArrayBuffer", - "readAsBinaryString", - "readAsBlob", - "readAsDataURL", - "readAsText", - "readOnly", - "readPixels", - "readReportRequested", - "readyState", - "reason", - "reboot", - "receiver", - "receivers", - "recordNumber", - "recordset", - "rect", - "red", - "redirectCount", - "redirectEnd", - "redirectStart", - "reduce", - "reduceRight", - "reduction", - "refDistance", - "refX", - "refY", - "referenceNode", - "referrer", - "refresh", - "region", - "regionAnchorX", - "regionAnchorY", - "regionId", - "regions", - "register", - "registerContentHandler", - "registerElement", - "registerProtocolHandler", - "reject", - "rel", - "relList", - "relatedNode", - "relatedTarget", - "release", - "releaseCapture", - "releaseEvents", - "releasePointerCapture", - "releaseShaderCompiler", - "reliable", - "reload", - "remainingSpace", - "remoteDescription", - "remove", - "removeAllRanges", - "removeAttribute", - "removeAttributeNS", - "removeAttributeNode", - "removeBehavior", - "removeChild", - "removeCue", - "removeEventListener", - "removeFilter", - "removeImport", - "removeItem", - "removeListener", - "removeNamedItem", - "removeNamedItemNS", - "removeNode", - "removeParameter", - "removeProperty", - "removeRange", - "removeRegion", - "removeRule", - "removeSiteSpecificTrackingException", - "removeSourceBuffer", - "removeStream", - "removeTrack", - "removeVariable", - "removeWakeLockListener", - "removeWebWideTrackingException", - "removedNodes", - "renderbufferStorage", - "renderedBuffer", - "renderingMode", - "repeat", - "replace", - "replaceAdjacentText", - "replaceChild", - "replaceData", - "replaceId", - "replaceItem", - "replaceNode", - "replaceState", - "replaceTrack", - "replaceWholeText", - "reportValidity", - "requestAnimationFrame", - "requestAutocomplete", - "requestData", - "requestFullscreen", - "requestMediaKeySystemAccess", - "requestPermission", - "requestPointerLock", - "requestStart", - "requestingWindow", - "required", - "requiredExtensions", - "requiredFeatures", - "reset", - "resetTransform", - "resize", - "resizeBy", - "resizeTo", - "resolve", - "response", - "responseBody", - "responseEnd", - "responseStart", - "responseText", - "responseType", - "responseURL", - "responseXML", - "restore", - "result", - "resultType", - "resume", - "returnValue", - "rev", - "reverse", - "reversed", - "revocable", - "revokeObjectURL", - "rgbColor", - "right", - "rightContext", - "rightMargin", - "rolloffFactor", - "root", - "rootElement", - "rotate", - "rotateAxisAngle", - "rotateAxisAngleSelf", - "rotateFromVector", - "rotateFromVectorSelf", - "rotateSelf", - "rotation", - "rotationRate", - "round", - "rowIndex", - "rowSpan", - "rows", - "rubyAlign", - "rubyOverhang", - "rubyPosition", - "rules", - "runtime", - "runtimeStyle", - "rx", - "ry", - "safari", - "sampleCoverage", - "sampleRate", - "sandbox", - "save", - "scale", - "scale3d", - "scale3dSelf", - "scaleNonUniform", - "scaleNonUniformSelf", - "scaleSelf", - "scheme", - "scissor", - "scope", - "scopeName", - "scoped", - "screen", - "screenBrightness", - "screenEnabled", - "screenLeft", - "screenPixelToMillimeterX", - "screenPixelToMillimeterY", - "screenTop", - "screenX", - "screenY", - "scripts", - "scroll", - "scroll-behavior", - "scrollAmount", - "scrollBehavior", - "scrollBy", - "scrollByLines", - "scrollByPages", - "scrollDelay", - "scrollHeight", - "scrollIntoView", - "scrollIntoViewIfNeeded", - "scrollLeft", - "scrollLeftMax", - "scrollMaxX", - "scrollMaxY", - "scrollTo", - "scrollTop", - "scrollTopMax", - "scrollWidth", - "scrollX", - "scrollY", - "scrollbar3dLightColor", - "scrollbarArrowColor", - "scrollbarBaseColor", - "scrollbarDarkShadowColor", - "scrollbarFaceColor", - "scrollbarHighlightColor", - "scrollbarShadowColor", - "scrollbarTrackColor", - "scrollbars", - "scrolling", - "sdp", - "sdpMLineIndex", - "sdpMid", - "seal", - "search", - "searchBox", - "searchBoxJavaBridge_", - "searchParams", - "sectionRowIndex", - "secureConnectionStart", - "security", - "seed", - "seekable", - "seeking", - "select", - "selectAllChildren", - "selectNode", - "selectNodeContents", - "selectNodes", - "selectSingleNode", - "selectSubString", - "selected", - "selectedIndex", - "selectedOptions", - "selectedStyleSheetSet", - "selectedStylesheetSet", - "selection", - "selectionDirection", - "selectionEnd", - "selectionStart", - "selector", - "selectorText", - "self", - "send", - "sendAsBinary", - "sendBeacon", - "sender", - "sentTimestamp", - "separator", - "serializeToString", - "serviceWorker", - "sessionId", - "sessionStorage", - "set", - "setActive", - "setAlpha", - "setAttribute", - "setAttributeNS", - "setAttributeNode", - "setAttributeNodeNS", - "setBaseAndExtent", - "setBingCurrentSearchDefault", - "setCapture", - "setColor", - "setCompositeOperation", - "setCurrentTime", - "setCustomValidity", - "setData", - "setDate", - "setDragImage", - "setEnd", - "setEndAfter", - "setEndBefore", - "setEndPoint", - "setFillColor", - "setFilterRes", - "setFloat32", - "setFloat64", - "setFloatValue", - "setFullYear", - "setHours", - "setImmediate", - "setInt16", - "setInt32", - "setInt8", - "setInterval", - "setItem", - "setLineCap", - "setLineDash", - "setLineJoin", - "setLineWidth", - "setLocalDescription", - "setMatrix", - "setMatrixValue", - "setMediaKeys", - "setMilliseconds", - "setMinutes", - "setMiterLimit", - "setMonth", - "setNamedItem", - "setNamedItemNS", - "setNonUserCodeExceptions", - "setOrientToAngle", - "setOrientToAuto", - "setOrientation", - "setOverrideHistoryNavigationMode", - "setPaint", - "setParameter", - "setPeriodicWave", - "setPointerCapture", - "setPosition", - "setPreference", - "setProperty", - "setPrototypeOf", - "setRGBColor", - "setRGBColorICCColor", - "setRadius", - "setRangeText", - "setRemoteDescription", - "setRequestHeader", - "setResizable", - "setResourceTimingBufferSize", - "setRotate", - "setScale", - "setSeconds", - "setSelectionRange", - "setServerCertificate", - "setShadow", - "setSkewX", - "setSkewY", - "setStart", - "setStartAfter", - "setStartBefore", - "setStdDeviation", - "setStringValue", - "setStrokeColor", - "setSuggestResult", - "setTargetAtTime", - "setTargetValueAtTime", - "setTime", - "setTimeout", - "setTransform", - "setTranslate", - "setUTCDate", - "setUTCFullYear", - "setUTCHours", - "setUTCMilliseconds", - "setUTCMinutes", - "setUTCMonth", - "setUTCSeconds", - "setUint16", - "setUint32", - "setUint8", - "setUri", - "setValueAtTime", - "setValueCurveAtTime", - "setVariable", - "setVelocity", - "setVersion", - "setYear", - "settingName", - "settingValue", - "sex", - "shaderSource", - "shadowBlur", - "shadowColor", - "shadowOffsetX", - "shadowOffsetY", - "shadowRoot", - "shape", - "shape-rendering", - "shapeRendering", - "sheet", - "shift", - "shiftKey", - "shiftLeft", - "show", - "showHelp", - "showModal", - "showModalDialog", - "showModelessDialog", - "showNotification", - "sidebar", - "sign", - "signalingState", - "sin", - "singleNodeValue", - "sinh", - "size", - "sizeToContent", - "sizes", - "skewX", - "skewXSelf", - "skewY", - "skewYSelf", - "slice", - "slope", - "small", - "smil", - "smoothingTimeConstant", - "snapToLines", - "snapshotItem", - "snapshotLength", - "some", - "sort", - "source", - "sourceBuffer", - "sourceBuffers", - "sourceIndex", - "spacing", - "span", - "speakAs", - "speaking", - "specified", - "specularConstant", - "specularExponent", - "speechSynthesis", - "speed", - "speedOfSound", - "spellcheck", - "splice", - "split", - "splitText", - "spreadMethod", - "sqrt", - "src", - "srcElement", - "srcFilter", - "srcUrn", - "srcdoc", - "srclang", - "srcset", - "stack", - "stackTraceLimit", - "stacktrace", - "standalone", - "standby", - "start", - "startContainer", - "startIce", - "startOffset", - "startRendering", - "startTime", - "startsWith", - "state", - "status", - "statusMessage", - "statusText", - "statusbar", - "stdDeviationX", - "stdDeviationY", - "stencilFunc", - "stencilFuncSeparate", - "stencilMask", - "stencilMaskSeparate", - "stencilOp", - "stencilOpSeparate", - "step", - "stepDown", - "stepMismatch", - "stepUp", - "sticky", - "stitchTiles", - "stop", - "stop-color", - "stop-opacity", - "stopColor", - "stopImmediatePropagation", - "stopOpacity", - "stopPropagation", - "storageArea", - "storageName", - "storageStatus", - "storeSiteSpecificTrackingException", - "storeWebWideTrackingException", - "stpVersion", - "stream", - "strike", - "stringValue", - "stringify", - "stroke", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "strokeDasharray", - "strokeDashoffset", - "strokeLinecap", - "strokeLinejoin", - "strokeMiterlimit", - "strokeOpacity", - "strokeRect", - "strokeStyle", - "strokeText", - "strokeWidth", - "style", - "styleFloat", - "styleMedia", - "styleSheet", - "styleSheetSets", - "styleSheets", - "sub", - "subarray", - "subject", - "submit", - "subscribe", - "substr", - "substring", - "substringData", - "subtle", - "suffix", - "suffixes", - "summary", - "sup", - "supports", - "surfaceScale", - "surroundContents", - "suspend", - "suspendRedraw", - "swapCache", - "swapNode", - "sweepFlag", - "symbols", - "system", - "systemCode", - "systemId", - "systemLanguage", - "systemXDPI", - "systemYDPI", - "tBodies", - "tFoot", - "tHead", - "tabIndex", - "table", - "table-layout", - "tableLayout", - "tableValues", - "tag", - "tagName", - "tagUrn", - "tags", - "taintEnabled", - "takeRecords", - "tan", - "tanh", - "target", - "targetElement", - "targetTouches", - "targetX", - "targetY", - "tel", - "terminate", - "test", - "texImage2D", - "texParameterf", - "texParameteri", - "texSubImage2D", - "text", - "text-align", - "text-anchor", - "text-decoration", - "text-decoration-color", - "text-decoration-line", - "text-decoration-style", - "text-indent", - "text-overflow", - "text-rendering", - "text-shadow", - "text-transform", - "textAlign", - "textAlignLast", - "textAnchor", - "textAutospace", - "textBaseline", - "textContent", - "textDecoration", - "textDecorationBlink", - "textDecorationColor", - "textDecorationLine", - "textDecorationLineThrough", - "textDecorationNone", - "textDecorationOverline", - "textDecorationStyle", - "textDecorationUnderline", - "textIndent", - "textJustify", - "textJustifyTrim", - "textKashida", - "textKashidaSpace", - "textLength", - "textOverflow", - "textRendering", - "textShadow", - "textTracks", - "textTransform", - "textUnderlinePosition", - "then", - "threadId", - "threshold", - "tiltX", - "tiltY", - "time", - "timeEnd", - "timeStamp", - "timeout", - "timestamp", - "timestampOffset", - "timing", - "title", - "toArray", - "toBlob", - "toDataURL", - "toDateString", - "toElement", - "toExponential", - "toFixed", - "toFloat32Array", - "toFloat64Array", - "toGMTString", - "toISOString", - "toJSON", - "toLocaleDateString", - "toLocaleFormat", - "toLocaleLowerCase", - "toLocaleString", - "toLocaleTimeString", - "toLocaleUpperCase", - "toLowerCase", - "toMethod", - "toPrecision", - "toSdp", - "toSource", - "toStaticHTML", - "toString", - "toStringTag", - "toTimeString", - "toUTCString", - "toUpperCase", - "toggle", - "toggleLongPressEnabled", - "tooLong", - "toolbar", - "top", - "topMargin", - "total", - "totalFrameDelay", - "totalVideoFrames", - "touchAction", - "touches", - "trace", - "track", - "transaction", - "transactions", - "transform", - "transform-origin", - "transform-style", - "transformOrigin", - "transformPoint", - "transformString", - "transformStyle", - "transformToDocument", - "transformToFragment", - "transition", - "transition-delay", - "transition-duration", - "transition-property", - "transition-timing-function", - "transitionDelay", - "transitionDuration", - "transitionProperty", - "transitionTimingFunction", - "translate", - "translateSelf", - "translationX", - "translationY", - "trim", - "trimLeft", - "trimRight", - "trueSpeed", - "trunc", - "truncate", - "type", - "typeDetail", - "typeMismatch", - "typeMustMatch", - "types", - "ubound", - "undefined", - "unescape", - "uneval", - "unicode-bidi", - "unicodeBidi", - "uniform1f", - "uniform1fv", - "uniform1i", - "uniform1iv", - "uniform2f", - "uniform2fv", - "uniform2i", - "uniform2iv", - "uniform3f", - "uniform3fv", - "uniform3i", - "uniform3iv", - "uniform4f", - "uniform4fv", - "uniform4i", - "uniform4iv", - "uniformMatrix2fv", - "uniformMatrix3fv", - "uniformMatrix4fv", - "unique", - "uniqueID", - "uniqueNumber", - "unitType", - "units", - "unloadEventEnd", - "unloadEventStart", - "unlock", - "unmount", - "unobserve", - "unpause", - "unpauseAnimations", - "unreadCount", - "unregister", - "unregisterContentHandler", - "unregisterProtocolHandler", - "unscopables", - "unselectable", - "unshift", - "unsubscribe", - "unsuspendRedraw", - "unsuspendRedrawAll", - "unwatch", - "unwrapKey", - "update", - "updateCommands", - "updateIce", - "updateInterval", - "updateSettings", - "updated", - "updating", - "upload", - "upper", - "upperBound", - "upperOpen", - "uri", - "url", - "urn", - "urns", - "usages", - "useCurrentView", - "useMap", - "useProgram", - "usedSpace", - "userAgent", - "userLanguage", - "username", - "v8BreakIterator", - "vAlign", - "vLink", - "valid", - "validateProgram", - "validationMessage", - "validity", - "value", - "valueAsDate", - "valueAsNumber", - "valueAsString", - "valueInSpecifiedUnits", - "valueMissing", - "valueOf", - "valueText", - "valueType", - "values", - "vector-effect", - "vectorEffect", - "velocityAngular", - "velocityExpansion", - "velocityX", - "velocityY", - "vendor", - "vendorSub", - "verify", - "version", - "vertexAttrib1f", - "vertexAttrib1fv", - "vertexAttrib2f", - "vertexAttrib2fv", - "vertexAttrib3f", - "vertexAttrib3fv", - "vertexAttrib4f", - "vertexAttrib4fv", - "vertexAttribDivisorANGLE", - "vertexAttribPointer", - "vertical", - "vertical-align", - "verticalAlign", - "verticalOverflow", - "vibrate", - "videoHeight", - "videoTracks", - "videoWidth", - "view", - "viewBox", - "viewBoxString", - "viewTarget", - "viewTargetString", - "viewport", - "viewportAnchorX", - "viewportAnchorY", - "viewportElement", - "visibility", - "visibilityState", - "visible", - "vlinkColor", - "voice", - "volume", - "vrml", - "vspace", - "w", - "wand", - "warn", - "wasClean", - "watch", - "watchPosition", - "webdriver", - "webkitAddKey", - "webkitAnimation", - "webkitAnimationDelay", - "webkitAnimationDirection", - "webkitAnimationDuration", - "webkitAnimationFillMode", - "webkitAnimationIterationCount", - "webkitAnimationName", - "webkitAnimationPlayState", - "webkitAnimationTimingFunction", - "webkitAppearance", - "webkitAudioContext", - "webkitAudioDecodedByteCount", - "webkitAudioPannerNode", - "webkitBackfaceVisibility", - "webkitBackground", - "webkitBackgroundAttachment", - "webkitBackgroundClip", - "webkitBackgroundColor", - "webkitBackgroundImage", - "webkitBackgroundOrigin", - "webkitBackgroundPosition", - "webkitBackgroundPositionX", - "webkitBackgroundPositionY", - "webkitBackgroundRepeat", - "webkitBackgroundSize", - "webkitBackingStorePixelRatio", - "webkitBorderImage", - "webkitBorderImageOutset", - "webkitBorderImageRepeat", - "webkitBorderImageSlice", - "webkitBorderImageSource", - "webkitBorderImageWidth", - "webkitBoxAlign", - "webkitBoxDirection", - "webkitBoxFlex", - "webkitBoxOrdinalGroup", - "webkitBoxOrient", - "webkitBoxPack", - "webkitBoxSizing", - "webkitCancelAnimationFrame", - "webkitCancelFullScreen", - "webkitCancelKeyRequest", - "webkitCancelRequestAnimationFrame", - "webkitClearResourceTimings", - "webkitClosedCaptionsVisible", - "webkitConvertPointFromNodeToPage", - "webkitConvertPointFromPageToNode", - "webkitCreateShadowRoot", - "webkitCurrentFullScreenElement", - "webkitCurrentPlaybackTargetIsWireless", - "webkitDirectionInvertedFromDevice", - "webkitDisplayingFullscreen", - "webkitEnterFullScreen", - "webkitEnterFullscreen", - "webkitExitFullScreen", - "webkitExitFullscreen", - "webkitExitPointerLock", - "webkitFullScreenKeyboardInputAllowed", - "webkitFullscreenElement", - "webkitFullscreenEnabled", - "webkitGenerateKeyRequest", - "webkitGetAsEntry", - "webkitGetDatabaseNames", - "webkitGetEntries", - "webkitGetEntriesByName", - "webkitGetEntriesByType", - "webkitGetFlowByName", - "webkitGetGamepads", - "webkitGetImageDataHD", - "webkitGetNamedFlows", - "webkitGetRegionFlowRanges", - "webkitGetUserMedia", - "webkitHasClosedCaptions", - "webkitHidden", - "webkitIDBCursor", - "webkitIDBDatabase", - "webkitIDBDatabaseError", - "webkitIDBDatabaseException", - "webkitIDBFactory", - "webkitIDBIndex", - "webkitIDBKeyRange", - "webkitIDBObjectStore", - "webkitIDBRequest", - "webkitIDBTransaction", - "webkitImageSmoothingEnabled", - "webkitIndexedDB", - "webkitInitMessageEvent", - "webkitIsFullScreen", - "webkitKeys", - "webkitLineDashOffset", - "webkitLockOrientation", - "webkitMatchesSelector", - "webkitMediaStream", - "webkitNotifications", - "webkitOfflineAudioContext", - "webkitOrientation", - "webkitPeerConnection00", - "webkitPersistentStorage", - "webkitPointerLockElement", - "webkitPostMessage", - "webkitPreservesPitch", - "webkitPutImageDataHD", - "webkitRTCPeerConnection", - "webkitRegionOverset", - "webkitRequestAnimationFrame", - "webkitRequestFileSystem", - "webkitRequestFullScreen", - "webkitRequestFullscreen", - "webkitRequestPointerLock", - "webkitResolveLocalFileSystemURL", - "webkitSetMediaKeys", - "webkitSetResourceTimingBufferSize", - "webkitShadowRoot", - "webkitShowPlaybackTargetPicker", - "webkitSlice", - "webkitSpeechGrammar", - "webkitSpeechGrammarList", - "webkitSpeechRecognition", - "webkitSpeechRecognitionError", - "webkitSpeechRecognitionEvent", - "webkitStorageInfo", - "webkitSupportsFullscreen", - "webkitTemporaryStorage", - "webkitTextSizeAdjust", - "webkitTransform", - "webkitTransformOrigin", - "webkitTransition", - "webkitTransitionDelay", - "webkitTransitionDuration", - "webkitTransitionProperty", - "webkitTransitionTimingFunction", - "webkitURL", - "webkitUnlockOrientation", - "webkitUserSelect", - "webkitVideoDecodedByteCount", - "webkitVisibilityState", - "webkitWirelessVideoPlaybackDisabled", - "webkitdropzone", - "webstore", - "weight", - "whatToShow", - "wheelDelta", - "wheelDeltaX", - "wheelDeltaY", - "which", - "white-space", - "whiteSpace", - "wholeText", - "widows", - "width", - "will-change", - "willChange", - "willValidate", - "window", - "withCredentials", - "word-break", - "word-spacing", - "word-wrap", - "wordBreak", - "wordSpacing", - "wordWrap", - "wrap", - "wrapKey", - "write", - "writeln", - "writingMode", - "x", - "x1", - "x2", - "xChannelSelector", - "xmlEncoding", - "xmlStandalone", - "xmlVersion", - "xmlbase", - "xmllang", - "xmlspace", - "y", - "y1", - "y2", - "yChannelSelector", - "yandex", - "z", - "z-index", - "zIndex", - "zoom", - "zoomAndPan", - "zoomRectScreen" -] diff --git a/tools/node_modules/terser/tools/exit.js b/tools/node_modules/terser/tools/exit.js deleted file mode 100644 index 17048d8ef34a..000000000000 --- a/tools/node_modules/terser/tools/exit.js +++ /dev/null @@ -1,15 +0,0 @@ -// workaround for tty output truncation upon process.exit() -var exit = process.exit; -process.exit = function() { - var args = [].slice.call(arguments); - process.once("uncaughtException", function() { - (function callback() { - if (process.stdout.bufferSize || process.stderr.bufferSize) { - setImmediate(callback); - } else { - exit.apply(process, args); - } - })(); - }); - throw exit; -}; diff --git a/tools/node_modules/terser/tools/exports.js b/tools/node_modules/terser/tools/exports.js deleted file mode 100644 index 50f1a1a1df51..000000000000 --- a/tools/node_modules/terser/tools/exports.js +++ /dev/null @@ -1,14 +0,0 @@ -exports["Dictionary"] = Dictionary; -exports["minify"] = minify; -exports["parse"] = parse; -exports["push_uniq"] = push_uniq; -exports["OutputStream"] = OutputStream; -exports["TreeTransformer"] = TreeTransformer; -exports["TreeWalker"] = TreeWalker; -exports["string_template"] = string_template; -exports["Compressor"] = Compressor; -exports["defaults"] = defaults; -exports["base54"] = base54; -exports["mangle_properties"] = mangle_properties; -exports["reserve_quoted_keys"] = reserve_quoted_keys; -exports["to_ascii"] = to_ascii; diff --git a/tools/node_modules/terser/tools/node.js b/tools/node_modules/terser/tools/node.js deleted file mode 100644 index 8e7a14228d6d..000000000000 --- a/tools/node_modules/terser/tools/node.js +++ /dev/null @@ -1,55 +0,0 @@ -var fs = require("fs"); - -var UglifyJS = exports; -var FILES = UglifyJS.FILES = [ - "./domprops.js", - "../lib/utils.js", - "../lib/ast.js", - "../lib/parse.js", - "../lib/transform.js", - "../lib/scope.js", - "../lib/output.js", - "../lib/compress.js", - "../lib/sourcemap.js", - "../lib/mozilla-ast.js", - "../lib/propmangle.js", - "../lib/minify.js", - "./exports.js", -].map(function(file){ - return require.resolve(file); -}); - -try { - var istanbul = require("istanbul"); - var instrumenter = new istanbul.Instrumenter(); -} catch (ex) {} - -new Function("MOZ_SourceMap", "exports", "require", function() { - var code = FILES.map(function(file) { - var contents = fs.readFileSync(file, "utf8"); - if (instrumenter && global.__IS_TESTING__) return instrumenter.instrumentSync(contents, file); - return contents; - }); - return code.join("\n\n"); -}())( - require("source-map"), - UglifyJS, - require -); - -function infer_options(options) { - var result = UglifyJS.minify("", options); - return result.error && result.error.defs; -} - -UglifyJS.default_options = function() { - var defs = {}; - Object.keys(infer_options({ 0: 0 })).forEach(function(component) { - var options = {}; - options[component] = { 0: 0 }; - if (options = infer_options(options)) { - defs[component] = options; - } - }); - return defs; -}; diff --git a/tools/node_modules/terser/tools/props.html b/tools/node_modules/terser/tools/props.html deleted file mode 100644 index 28b575fb8e7d..000000000000 --- a/tools/node_modules/terser/tools/props.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - diff --git a/tools/node_modules/terser/tools/terser.d.ts b/tools/node_modules/terser/tools/terser.d.ts deleted file mode 100644 index d57ace702ee0..000000000000 --- a/tools/node_modules/terser/tools/terser.d.ts +++ /dev/null @@ -1,790 +0,0 @@ -import { RawSourceMap } from 'source-map'; - -export type ECMA = 5 | 6 | 7 | 8 | 9; - -export interface ParseOptions { - bare_returns?: boolean; - ecma?: ECMA; - html5_comments?: boolean; - shebang?: boolean; -} - -export interface CompressOptions { - arguments?: boolean; - arrows?: boolean; - booleans?: boolean; - collapse_vars?: boolean; - comparisons?: boolean; - conditionals?: boolean; - dead_code?: boolean; - defaults?: boolean; - directives?: boolean; - drop_console?: boolean; - drop_debugger?: boolean; - evaluate?: boolean; - expression?: boolean; - global_defs?: object; - hoist_funs?: boolean; - hoist_props?: boolean; - hoist_vars?: boolean; - if_return?: boolean; - inline?: boolean | InlineFunctions; - join_vars?: boolean; - keep_classnames?: boolean | RegExp; - keep_fargs?: boolean; - keep_fnames?: boolean | RegExp; - keep_infinity?: boolean; - loops?: boolean; - negate_iife?: boolean; - passes?: number; - properties?: boolean; - pure_funcs?: string[]; - pure_getters?: boolean | 'strict'; - reduce_funcs?: boolean; - reduce_vars?: boolean; - sequences?: boolean | number; - side_effects?: boolean; - switches?: boolean; - toplevel?: boolean; - top_retain?: null | string | string[] | RegExp; - typeofs?: boolean; - unsafe?: boolean; - unsafe_arrows?: boolean; - unsafe_comps?: boolean; - unsafe_Function?: boolean; - unsafe_math?: boolean; - unsafe_methods?: boolean; - unsafe_proto?: boolean; - unsafe_regexp?: boolean; - unsafe_undefined?: boolean; - unused?: boolean; - warnings?: boolean; -} - -export enum InlineFunctions { - Disabled = 0, - SimpleFunctions = 1, - WithArguments = 2, - WithArgumentsAndVariables = 3 -} - -export interface MangleOptions { - eval?: boolean; - keep_classnames?: boolean | RegExp; - keep_fnames?: boolean | RegExp; - module?: boolean; - properties?: boolean | ManglePropertiesOptions; - reserved?: string[]; - safari10?: boolean; - toplevel?: boolean; -} - -export interface ManglePropertiesOptions { - builtins?: boolean; - debug?: boolean; - keep_quoted?: boolean; - regex?: RegExp; - reserved?: string[]; -} - -export interface OutputOptions { - ascii_only?: boolean; - beautify?: boolean; - braces?: boolean; - comments?: boolean | 'all' | 'some' | RegExp; - ecma?: ECMA; - indent_level?: number; - indent_start?: boolean; - inline_script?: boolean; - ie8?: boolean; - keep_quoted_props?: boolean; - max_line_len?: boolean; - preamble?: string; - quote_keys?: boolean; - quote_style?: OutputQuoteStyle; - safari10?: boolean; - semicolons?: boolean; - shebang?: boolean; - shorthand?: boolean; - source_map?: SourceMapOptions; - webkit?: boolean; - width?: number; - wrap_iife?: boolean; -} - -export enum OutputQuoteStyle { - PreferDouble = 0, - AlwaysSingle = 1, - AlwaysDouble = 2, - AlwaysOriginal = 3 -} - -export interface MinifyOptions { - compress?: boolean | CompressOptions; - ecma?: ECMA; - ie8?: boolean; - keep_classnames?: boolean | RegExp; - keep_fnames?: boolean | RegExp; - mangle?: boolean | MangleOptions; - module?: boolean; - nameCache?: object; - output?: OutputOptions; - parse?: ParseOptions; - safari10?: boolean; - sourceMap?: boolean | SourceMapOptions; - toplevel?: boolean; - warnings?: boolean | 'verbose'; -} - -export interface MinifyOutput { - ast?: AST_Node; - code?: string; - error?: Error; - map?: string; - warnings?: string[]; -} - -export interface SourceMapOptions { - content?: RawSourceMap; - includeSources?: boolean; - filename?: string; - root?: string; - url?: string | 'inline'; -} - -declare function parse(text: string, options?: ParseOptions): AST_Node; - -export class TreeWalker { - constructor(callback: (node: AST_Node, descend?: (node: AST_Node) => void) => boolean | undefined); - directives: object; - find_parent(type: AST_Node): AST_Node | undefined; - has_directive(type: string): boolean; - loopcontrol_target(node: AST_Node): AST_Node | undefined; - parent(n: number): AST_Node | undefined; - pop(): void; - push(node: AST_Node): void; - self(): AST_Node | undefined; - stack: AST_Node[]; - visit: (node: AST_Node, descend: boolean) => any; -} - -export class TreeTransformer extends TreeWalker { - constructor( - before: (node: AST_Node, descend?: (node: AST_Node, tw: TreeWalker) => void, in_list?: boolean) => AST_Node | undefined, - after?: (node: AST_Node, in_list?: boolean) => AST_Node | undefined - ); - before: (node: AST_Node) => AST_Node; - after?: (node: AST_Node) => AST_Node; -} - -export function push_uniq(array: T[], el: T): void; - -type DictEachCallback = (val: any, key: string) => any; - -export class Dictionary { - static fromObject(obj: object): Dictionary; - add(key: string, val: any): this; - clone(): Dictionary; - del(key: string): this; - each(fn: DictEachCallback): void; - get(key: string): any; - has(key: string): boolean; - map(fn: DictEachCallback): any[]; - set(key: string, val: any): this; - size(): number; -} - -export function minify(files: string | string[] | { [file: string]: string } | AST_Node, options?: MinifyOptions): MinifyOutput; - -export class AST_Node { - constructor(props?: object); - static BASE?: AST_Node; - static PROPS: string[]; - static SELF_PROPS: string[]; - static SUBCLASSES: AST_Node[]; - static documentation: string; - static propdoc?: Record; - static expressions?: AST_Node[]; - static warn?: (text: string, props: any) => void; - static from_mozilla_ast?: (node: AST_Node) => any; - walk: (visitor: TreeWalker) => void; - print_to_string: (options?: OutputOptions) => string; - transform: (tt: TreeTransformer, in_list?: boolean) => AST_Node; - TYPE: string; - CTOR: typeof AST_Node; -} - -declare class SymbolDef { - constructor(scope?: AST_Scope, orig?: object, init?: object); - name: string; - orig: AST_SymbolRef[]; - init: AST_SymbolRef; - eliminated: number; - scope: AST_Scope; - references: AST_SymbolRef[]; - replaced: number; - global: boolean; - export: boolean; - mangled_name: null | string; - undeclared: boolean; - id: number; -} - -type ArgType = AST_SymbolFunarg | AST_DefaultAssign | AST_Destructuring | AST_Expansion; - -declare class AST_Statement extends AST_Node { - constructor(props?: object); -} - -declare class AST_Debugger extends AST_Statement { - constructor(props?: object); -} - -declare class AST_Directive extends AST_Statement { - constructor(props?: object); - value: string; - quote: string; -} - -declare class AST_SimpleStatement extends AST_Statement { - constructor(props?: object); - body: AST_Node[]; -} - -declare class AST_Block extends AST_Statement { - constructor(props?: object); - body: AST_Node[]; - block_scope: AST_Scope | null; -} - -declare class AST_BlockStatement extends AST_Block { - constructor(props?: object); -} - -declare class AST_Scope extends AST_Block { - constructor(props?: object); - variables: any; - functions: any; - uses_with: boolean; - uses_eval: boolean; - parent_scope: AST_Scope | null; - enclosed: any; - cname: any; -} - -declare class AST_Toplevel extends AST_Scope { - constructor(props?: object); - globals: any; -} - -declare class AST_Lambda extends AST_Scope { - constructor(props?: object); - name: AST_SymbolDeclaration | null; - argnames: ArgType[]; - uses_arguments: boolean; - is_generator: boolean; - async: boolean; -} - -declare class AST_Accessor extends AST_Lambda { - constructor(props?: object); -} - -declare class AST_Function extends AST_Lambda { - constructor(props?: object); - inlined: boolean; -} - -declare class AST_Arrow extends AST_Lambda { - constructor(props?: object); - inlined: boolean; -} - -declare class AST_Defun extends AST_Lambda { - constructor(props?: object); - inlined: boolean; -} - -declare class AST_Class extends AST_Scope { - constructor(props?: object); - name: AST_SymbolClass | AST_SymbolDefClass | null; - extends: AST_Node | null; - properties: AST_ObjectProperty[]; - inlined: boolean; -} - -declare class AST_DefClass extends AST_Class { - constructor(props?: object); -} - -declare class AST_ClassExpression extends AST_Class { - constructor(props?: object); -} - -declare class AST_Switch extends AST_Block { - constructor(props?: object); - expression: AST_Node; -} - -declare class AST_SwitchBranch extends AST_Block { - constructor(props?: object); -} - -declare class AST_Default extends AST_SwitchBranch { - constructor(props?: object); -} - -declare class AST_Case extends AST_SwitchBranch { - constructor(props?: object); - expression: AST_Node; -} - -declare class AST_Try extends AST_Block { - constructor(props?: object); - bcatch: AST_Catch; - bfinally: null | AST_Finally; -} - -declare class AST_Catch extends AST_Block { - constructor(props?: object); - argname: ArgType; -} - -declare class AST_Finally extends AST_Block { - constructor(props?: object); -} - -declare class AST_EmptyStatement extends AST_Statement { - constructor(props?: object); -} - -declare class AST_StatementWithBody extends AST_Statement { - constructor(props?: object); - body: AST_Node[]; -} - -declare class AST_LabeledStatement extends AST_StatementWithBody { - constructor(props?: object); - label: AST_Label; -} - -declare class AST_IterationStatement extends AST_StatementWithBody { - constructor(props?: object); - block_scope: AST_Scope | null; -} - -declare class AST_DWLoop extends AST_IterationStatement { - constructor(props?: object); - condition: AST_Node; -} - -declare class AST_Do extends AST_DWLoop { - constructor(props?: object); -} - -declare class AST_While extends AST_DWLoop { - constructor(props?: object); -} - -declare class AST_For extends AST_IterationStatement { - constructor(props?: object); - init: AST_Node | null; - condition: AST_Node | null; - step: AST_Node | null; -} - -declare class AST_ForIn extends AST_IterationStatement { - constructor(props?: object); - init: AST_Node | null; - object: AST_Node; -} - -declare class AST_ForOf extends AST_ForIn { - constructor(props?: object); - await: boolean; -} - -declare class AST_With extends AST_StatementWithBody { - constructor(props?: object); - expression: AST_Node; -} - -declare class AST_If extends AST_StatementWithBody { - constructor(props?: object); - condition: AST_Node; - alternative: AST_Node | null; -} - -declare class AST_Jump extends AST_Statement { - constructor(props?: object); -} - -declare class AST_Exit extends AST_Jump { - constructor(props?: object); - value: AST_Node | null; -} - -declare class AST_Return extends AST_Exit { - constructor(props?: object); -} - -declare class AST_Throw extends AST_Exit { - constructor(props?: object); -} - -declare class AST_LoopControl extends AST_Jump { - constructor(props?: object); - label: null | AST_LabelRef; -} - -declare class AST_Break extends AST_LoopControl { - constructor(props?: object); -} - -declare class AST_Continue extends AST_LoopControl { - constructor(props?: object); -} - -declare class AST_Definitions extends AST_Statement { - constructor(props?: object); - definitions: AST_VarDef[]; -} - -declare class AST_Var extends AST_Definitions { - constructor(props?: object); -} - -declare class AST_Let extends AST_Definitions { - constructor(props?: object); -} - -declare class AST_Const extends AST_Definitions { - constructor(props?: object); -} - -declare class AST_Export extends AST_Statement { - constructor(props?: object); - exported_definition: AST_Definitions | AST_Lambda | AST_DefClass | null; - exported_value: AST_Node | null; - is_default: boolean; - exported_names: AST_NameMapping[]; - module_name: AST_String; -} - -declare class AST_Expansion extends AST_Node { - constructor(props?: object); - expression: AST_Node; -} - -declare class AST_Destructuring extends AST_Node { - constructor(props?: object); - names: AST_Node[]; - is_array: boolean; -} - -declare class AST_PrefixedTemplateString extends AST_Node { - constructor(props?: object); - template_string: AST_TemplateString; - prefix: AST_Node; -} - -declare class AST_TemplateString extends AST_Node { - constructor(props?: object); - segments: AST_Node[]; -} - -declare class AST_TemplateSegment extends AST_Node { - constructor(props?: object); - value: string; - raw: string; -} - -declare class AST_NameMapping extends AST_Node { - constructor(props?: object); - foreign_name: AST_Symbol; - name: AST_SymbolExport | AST_SymbolImport; -} - -declare class AST_Import extends AST_Node { - constructor(props?: object); - imported_name: null | AST_SymbolImport; - imported_names: AST_NameMapping[]; - module_name: AST_String; -} - -declare class AST_VarDef extends AST_Node { - constructor(props?: object); - name: AST_Destructuring | AST_SymbolConst | AST_SymbolLet | AST_SymbolVar; - value: AST_Node | null; -} - -declare class AST_Call extends AST_Node { - constructor(props?: object); - expression: AST_Node; - args: AST_Node[]; -} - -declare class AST_New extends AST_Call { - constructor(props?: object); -} - -declare class AST_Sequence extends AST_Node { - constructor(props?: object); - expressions: AST_Node[]; -} - -declare class AST_PropAccess extends AST_Node { - constructor(props?: object); - expression: AST_Node; - property: AST_Node | string; -} - -declare class AST_Dot extends AST_PropAccess { - constructor(props?: object); -} - -declare class AST_Sub extends AST_PropAccess { - constructor(props?: object); -} - -declare class AST_Unary extends AST_Node { - constructor(props?: object); - operator: string; - expression: AST_Node; -} - -declare class AST_UnaryPrefix extends AST_Unary { - constructor(props?: object); -} - -declare class AST_UnaryPostfix extends AST_Unary { - constructor(props?: object); -} - -declare class AST_Binary extends AST_Node { - constructor(props?: object); - operator: string; - left: AST_Node; - right: AST_Node; -} - -declare class AST_Assign extends AST_Binary { - constructor(props?: object); -} - -declare class AST_DefaultAssign extends AST_Binary { - constructor(props?: object); -} - -declare class AST_Conditional extends AST_Node { - constructor(props?: object); - condition: AST_Node; - consequent: AST_Node; - alternative: AST_Node; -} - -declare class AST_Array extends AST_Node { - constructor(props?: object); - elements: AST_Node[]; -} - -declare class AST_Object extends AST_Node { - constructor(props?: object); - properties: AST_ObjectProperty[]; -} - -declare class AST_ObjectProperty extends AST_Node { - constructor(props?: object); - key: string | number | AST_Node; - value: AST_Node; -} - -declare class AST_ObjectKeyVal extends AST_ObjectProperty { - constructor(props?: object); - quote: string; -} - -declare class AST_ObjectSetter extends AST_ObjectProperty { - constructor(props?: object); - quote: string; - static: boolean; -} - -declare class AST_ObjectGetter extends AST_ObjectProperty { - constructor(props?: object); - quote: string; - static: boolean; -} - -declare class AST_ConciseMethod extends AST_ObjectProperty { - constructor(props?: object); - quote: string; - static: boolean; - is_generator: boolean; - async: boolean; -} - -declare class AST_Symbol extends AST_Node { - constructor(props?: object); - scope: AST_Scope; - name: string; - thedef: SymbolDef; -} - -declare class AST_SymbolDeclaration extends AST_Symbol { - constructor(props?: object); - init: AST_Node | null; -} - -declare class AST_SymbolVar extends AST_SymbolDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolFunarg extends AST_SymbolVar { - constructor(props?: object); -} - -declare class AST_SymbolBlockDeclaration extends AST_SymbolDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolConst extends AST_SymbolBlockDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolLet extends AST_SymbolBlockDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolDefClass extends AST_SymbolBlockDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolCatch extends AST_SymbolBlockDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolImport extends AST_SymbolBlockDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolDefun extends AST_SymbolDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolLambda extends AST_SymbolDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolClass extends AST_SymbolDeclaration { - constructor(props?: object); -} - -declare class AST_SymbolMethod extends AST_Symbol { - constructor(props?: object); -} - -declare class AST_SymbolImportForeign extends AST_Symbol { - constructor(props?: object); -} - -declare class AST_Label extends AST_Symbol { - constructor(props?: object); - references: AST_LoopControl | null; -} - -declare class AST_SymbolRef extends AST_Symbol { - constructor(props?: object); -} - -declare class AST_SymbolExport extends AST_SymbolRef { - constructor(props?: object); -} - -declare class AST_SymbolExportForeign extends AST_Symbol { - constructor(props?: object); -} - -declare class AST_LabelRef extends AST_Symbol { - constructor(props?: object); -} - -declare class AST_This extends AST_Symbol { - constructor(props?: object); -} - -declare class AST_Super extends AST_This { - constructor(props?: object); -} - -declare class AST_NewTarget extends AST_Node { - constructor(props?: object); -} - -declare class AST_Constant extends AST_Node { - constructor(props?: object); -} - -declare class AST_String extends AST_Constant { - constructor(props?: object); - value: string; - quote: string; -} - -declare class AST_Number extends AST_Constant { - constructor(props?: object); - value: number; - literal: string; -} - -declare class AST_RegExp extends AST_Constant { - constructor(props?: object); - value: RegExp; -} - -declare class AST_Atom extends AST_Constant { - constructor(props?: object); -} - -declare class AST_Null extends AST_Atom { - constructor(props?: object); -} - -declare class AST_NaN extends AST_Atom { - constructor(props?: object); -} - -declare class AST_Undefined extends AST_Atom { - constructor(props?: object); -} - -declare class AST_Hole extends AST_Atom { - constructor(props?: object); -} - -declare class AST_Infinity extends AST_Atom { - constructor(props?: object); -} - -declare class AST_Boolean extends AST_Atom { - constructor(props?: object); -} - -declare class AST_False extends AST_Boolean { - constructor(props?: object); -} - -declare class AST_True extends AST_Boolean { - constructor(props?: object); -} - -declare class AST_Await extends AST_Node { - constructor(props?: object); - expression: AST_Node; -} - -declare class AST_Yield extends AST_Node { - constructor(props?: object); - expression: AST_Node; - is_star: boolean; -} From 463c72b20d518db36f95fd04f22ccc434957332c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 15:49:39 -0800 Subject: [PATCH 67/82] document --- tools/node_modules/acorn/README.md | 5 + tools/node_modules/acorn/bin/acorn | 4 - tools/node_modules/acorn/dist/acorn.d.ts | 209 - tools/node_modules/acorn/dist/acorn.js.map | 1 - tools/node_modules/acorn/dist/acorn.mjs | 5302 ------------------- tools/node_modules/acorn/dist/acorn.mjs.map | 1 - tools/node_modules/acorn/dist/bin.js | 68 - 7 files changed, 5 insertions(+), 5585 deletions(-) delete mode 100755 tools/node_modules/acorn/bin/acorn delete mode 100644 tools/node_modules/acorn/dist/acorn.d.ts delete mode 100644 tools/node_modules/acorn/dist/acorn.js.map delete mode 100644 tools/node_modules/acorn/dist/acorn.mjs delete mode 100644 tools/node_modules/acorn/dist/acorn.mjs.map delete mode 100644 tools/node_modules/acorn/dist/bin.js diff --git a/tools/node_modules/acorn/README.md b/tools/node_modules/acorn/README.md index e66dac31de22..d2c73a475064 100644 --- a/tools/node_modules/acorn/README.md +++ b/tools/node_modules/acorn/README.md @@ -267,3 +267,8 @@ Plugins for ECMAScript proposals: - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) - [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator) - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n + +# @LOCALMOD XXX EMSCRIPTEN + +Add a quote of the erroring text on parse errors, and point to where it is (search for `XXX EMSCRIPTEN` in `acorn.js`). + diff --git a/tools/node_modules/acorn/bin/acorn b/tools/node_modules/acorn/bin/acorn deleted file mode 100755 index cf7df46890fd..000000000000 --- a/tools/node_modules/acorn/bin/acorn +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -require('../dist/bin.js'); diff --git a/tools/node_modules/acorn/dist/acorn.d.ts b/tools/node_modules/acorn/dist/acorn.d.ts deleted file mode 100644 index c6f9841b809a..000000000000 --- a/tools/node_modules/acorn/dist/acorn.d.ts +++ /dev/null @@ -1,209 +0,0 @@ -export as namespace acorn -export = acorn - -declare namespace acorn { - function parse(input: string, options?: Options): Node - - function parseExpressionAt(input: string, pos?: number, options?: Options): Node - - function tokenizer(input: string, options?: Options): { - getToken(): Token - [Symbol.iterator](): Iterator - } - - interface Options { - ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019 - sourceType?: 'script' | 'module' - onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void - onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void - allowReserved?: boolean - allowReturnOutsideFunction?: boolean - allowImportExportEverywhere?: boolean - allowAwaitOutsideFunction?: boolean - allowHashBang?: boolean - locations?: boolean - onToken?: ((token: Token) => any) | Token[] - onComment?: (( - isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, - endLoc?: Position - ) => void) | Comment[] - ranges?: boolean - program?: Node - sourceFile?: string - directSourceFile?: string - preserveParens?: boolean - } - - class Parser { - constructor(options: Options, input: string, startPos?: number) - parse(): Node - static parse(input: string, options?: Options): Node - static parseExpressionAt(input: string, pos: number, options?: Options): Node - static tokenizer(input: string, options?: Options): { - getToken(): Token - [Symbol.iterator](): Iterator - } - static extend(...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser - } - - interface Position { line: number; column: number; offset: number } - - const defaultOptions: Options - - function getLineInfo(input: string, offset: number): Position - - class SourceLocation { - start: Position - end: Position - source?: string | null - constructor(p: Parser, start: Position, end: Position) - } - - class Node { - type: string - start: number - end: number - loc?: SourceLocation - sourceFile?: string - range?: [number, number] - constructor(parser: Parser, pos: number, loc?: SourceLocation) - } - - class TokenType { - label: string - keyword: string - beforeExpr: boolean - startsExpr: boolean - isLoop: boolean - isAssign: boolean - prefix: boolean - postfix: boolean - binop: number - updateContext?: (prevType: TokenType) => void - constructor(label: string, conf?: any) - } - - const tokTypes: { - num: TokenType - regexp: TokenType - string: TokenType - name: TokenType - eof: TokenType - bracketL: TokenType - bracketR: TokenType - braceL: TokenType - braceR: TokenType - parenL: TokenType - parenR: TokenType - comma: TokenType - semi: TokenType - colon: TokenType - dot: TokenType - question: TokenType - arrow: TokenType - template: TokenType - ellipsis: TokenType - backQuote: TokenType - dollarBraceL: TokenType - eq: TokenType - assign: TokenType - incDec: TokenType - prefix: TokenType - logicalOR: TokenType - logicalAND: TokenType - bitwiseOR: TokenType - bitwiseXOR: TokenType - bitwiseAND: TokenType - equality: TokenType - relational: TokenType - bitShift: TokenType - plusMin: TokenType - modulo: TokenType - star: TokenType - slash: TokenType - starstar: TokenType - _break: TokenType - _case: TokenType - _catch: TokenType - _continue: TokenType - _debugger: TokenType - _default: TokenType - _do: TokenType - _else: TokenType - _finally: TokenType - _for: TokenType - _function: TokenType - _if: TokenType - _return: TokenType - _switch: TokenType - _throw: TokenType - _try: TokenType - _var: TokenType - _const: TokenType - _while: TokenType - _with: TokenType - _new: TokenType - _this: TokenType - _super: TokenType - _class: TokenType - _extends: TokenType - _export: TokenType - _import: TokenType - _null: TokenType - _true: TokenType - _false: TokenType - _in: TokenType - _instanceof: TokenType - _typeof: TokenType - _void: TokenType - _delete: TokenType - } - - class TokContext { - constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void) - } - - const tokContexts: { - b_stat: TokContext - b_expr: TokContext - b_tmpl: TokContext - p_stat: TokContext - p_expr: TokContext - q_tmpl: TokContext - f_expr: TokContext - } - - function isIdentifierStart(code: number, astral?: boolean): boolean - - function isIdentifierChar(code: number, astral?: boolean): boolean - - interface AbstractToken { - } - - interface Comment extends AbstractToken { - type: string - value: string - start: number - end: number - loc?: SourceLocation - range?: [number, number] - } - - class Token { - type: TokenType - value: any - start: number - end: number - loc?: SourceLocation - range?: [number, number] - constructor(p: Parser) - } - - function isNewLine(code: number): boolean - - const lineBreak: RegExp - - const lineBreakG: RegExp - - const version: string -} diff --git a/tools/node_modules/acorn/dist/acorn.js.map b/tools/node_modules/acorn/dist/acorn.js.map deleted file mode 100644 index 377362ba76f8..000000000000 --- a/tools/node_modules/acorn/dist/acorn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"acorn.js","sources":["../src/identifier.js","../src/tokentype.js","../src/whitespace.js","../src/util.js","../src/locutil.js","../src/options.js","../src/scopeflags.js","../src/state.js","../src/parseutil.js","../src/statement.js","../src/lval.js","../src/expression.js","../src/location.js","../src/scope.js","../src/node.js","../src/tokencontext.js","../src/unicode-property-data.js","../src/regexp.js","../src/tokenize.js","../src/index.js"],"sourcesContent":["// Reserved word lists for various dialects of the language\n\nexport const reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n}\n\n// And the keywords\n\nconst ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\"\n\nexport const keywords = {\n 5: ecma5AndLessKeywords,\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n}\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\n// Generated by `bin/generate-identifier-regex.js`.\n\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08bd\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0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\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fef\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7b9\\ua7f7-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab65\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\"\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf2-\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\"\n\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\")\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\")\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null\n\n// These are a run-length and offset encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by bin/generate-identifier-regex.js\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code, set) {\n let pos = 0x10000\n for (let i = 0; i < set.length; i += 2) {\n pos += set[i]\n if (pos > code) return false\n pos += set[i + 1]\n if (pos >= code) return true\n }\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code, astral) {\n if (code < 65) return code === 36\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes)\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}\n","// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n//\n// The `startsExpr` property is used to check if the token ends a\n// `yield` expression. It is set on all token types that either can\n// directly start an expression (like a quotation mark) or can\n// continue an expression (like the body of a string).\n//\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nexport class TokenType {\n constructor(label, conf = {}) {\n this.label = label\n this.keyword = conf.keyword\n this.beforeExpr = !!conf.beforeExpr\n this.startsExpr = !!conf.startsExpr\n this.isLoop = !!conf.isLoop\n this.isAssign = !!conf.isAssign\n this.prefix = !!conf.prefix\n this.postfix = !!conf.postfix\n this.binop = conf.binop || null\n this.updateContext = null\n }\n}\n\nfunction binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n}\nconst beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}\n\n// Map keyword names to token types.\n\nexport const keywords = {}\n\n// Succinct definitions of keyword token types\nfunction kw(name, options = {}) {\n options.keyword = name\n return keywords[name] = new TokenType(name, options)\n}\n\nexport const types = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"/<=/>=\", 7),\n bitShift: binop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\"),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n}\n","// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\nexport const lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\")\n\nexport function isNewLine(code, ecma2019String) {\n return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))\n}\n\nexport const nonASCIIwhitespace = /[\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g\n","const {hasOwnProperty, toString} = Object.prototype\n\n// Checks if an object has a property.\n\nexport function has(obj, propName) {\n return hasOwnProperty.call(obj, propName)\n}\n\nexport const isArray = Array.isArray || ((obj) => (\n toString.call(obj) === \"[object Array]\"\n))\n","import {lineBreakG} from \"./whitespace\"\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n constructor(line, col) {\n this.line = line\n this.column = col\n }\n\n offset(n) {\n return new Position(this.line, this.column + n)\n }\n}\n\nexport class SourceLocation {\n constructor(p, start, end) {\n this.start = start\n this.end = end\n if (p.sourceFile !== null) this.source = p.sourceFile\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input, offset) {\n for (let line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n let match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}\n","import {has, isArray} from \"./util\"\nimport {SourceLocation} from \"./locutil\"\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport const defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10\n // (2019). This influences support for strict mode, the set of\n // reserved words, and support for new syntax features. The default\n // is 9.\n ecmaVersion: 9,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"` or `\"module\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called\n // when a semicolon is automatically inserted. It will be passed\n // the position of the comma as an offset, and if `locations` is\n // enabled, it is given the location as a `{line, column}` object\n // as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: false,\n // When enabled, hashbang directive in the beginning of file\n // is allowed and treated as a line comment.\n allowHashBang: false,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n}\n\n// Interpret and default an options object\n\nexport function getOptions(opts) {\n let options = {}\n\n for (let opt in defaultOptions)\n options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]\n\n if (options.ecmaVersion >= 2015)\n options.ecmaVersion -= 2009\n\n if (options.allowReserved == null)\n options.allowReserved = options.ecmaVersion < 5\n\n if (isArray(options.onToken)) {\n let tokens = options.onToken\n options.onToken = (token) => tokens.push(token)\n }\n if (isArray(options.onComment))\n options.onComment = pushComment(options, options.onComment)\n\n return options\n}\n\nfunction pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n let comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n }\n if (options.locations)\n comment.loc = new SourceLocation(this, startLoc, endLoc)\n if (options.ranges)\n comment.range = [start, end]\n array.push(comment)\n }\n}\n","// Each scope gets a bitset that may contain these flags\nexport const\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128\n\nexport function functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n}\n\n// Used in checkLVal and declareName to determine the type of a binding\nexport const\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5 // Special case for function names as bound inside the function\n","import {reservedWords, keywords} from \"./identifier\"\nimport {types as tt} from \"./tokentype\"\nimport {lineBreak} from \"./whitespace\"\nimport {getOptions} from \"./options\"\nimport {SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_SUPER, SCOPE_DIRECT_SUPER} from \"./scopeflags\"\n\nfunction keywordRegexp(words) {\n return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n}\n\nexport class Parser {\n constructor(options, input, startPos) {\n this.options = options = getOptions(options)\n this.sourceFile = options.sourceFile\n this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5])\n let reserved = \"\"\n if (!options.allowReserved) {\n for (let v = options.ecmaVersion;; v--)\n if (reserved = reservedWords[v]) break\n if (options.sourceType === \"module\") reserved += \" await\"\n }\n this.reservedWords = keywordRegexp(reserved)\n let reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict\n this.reservedWordsStrict = keywordRegexp(reservedStrict)\n this.reservedWordsStrictBind = keywordRegexp(reservedStrict + \" \" + reservedWords.strictBind)\n this.input = String(input)\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length\n } else {\n this.pos = this.lineStart = 0\n this.curLine = 1\n }\n\n // Properties of the current token:\n // Its type\n this.type = tt.eof\n // For tokens that include more information than their type, the value\n this.value = null\n // Its start and end offset\n this.start = this.end = this.pos\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition()\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null\n this.lastTokStart = this.lastTokEnd = this.pos\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext()\n this.exprAllowed = true\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\"\n this.strict = this.inModule || this.strictDirective(this.pos)\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = 0\n // Labels in scope.\n this.labels = []\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n this.skipLineComment(2)\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = []\n this.enterScope(SCOPE_TOP)\n\n // For RegExp validation\n this.regexpState = null\n }\n\n parse() {\n let node = this.options.program || this.startNode()\n this.nextToken()\n return this.parseTopLevel(node)\n }\n\n get inFunction() { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }\n get inGenerator() { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }\n get inAsync() { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }\n get allowSuper() { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }\n get allowDirectSuper() { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }\n\n // Switch to a getter for 7.0.0.\n inNonArrowFunction() { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }\n\n static extend(...plugins) {\n let cls = this\n for (let i = 0; i < plugins.length; i++) cls = plugins[i](cls)\n return cls\n }\n\n static parse(input, options) {\n return new this(options, input).parse()\n }\n\n static parseExpressionAt(input, pos, options) {\n let parser = new this(options, input, pos)\n parser.nextToken()\n return parser.parseExpression()\n }\n\n static tokenizer(input, options) {\n return new this(options, input)\n }\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace\"\n\nconst pp = Parser.prototype\n\n// ## Parser utilities\n\nconst literal = /^(?:'((?:\\\\.|[^'])*?)'|\"((?:\\\\.|[^\"])*?)\"|;)/\npp.strictDirective = function(start) {\n for (;;) {\n skipWhiteSpace.lastIndex = start\n start += skipWhiteSpace.exec(this.input)[0].length\n let match = literal.exec(this.input.slice(start))\n if (!match) return false\n if ((match[1] || match[2]) === \"use strict\") return true\n start += match[0].length\n }\n}\n\n// Predicate that tests whether the next token is of the given\n// type, and if yes, consumes it as a side effect.\n\npp.eat = function(type) {\n if (this.type === type) {\n this.next()\n return true\n } else {\n return false\n }\n}\n\n// Tests whether parsed token is a contextual keyword.\n\npp.isContextual = function(name) {\n return this.type === tt.name && this.value === name && !this.containsEsc\n}\n\n// Consumes contextual keyword if possible.\n\npp.eatContextual = function(name) {\n if (!this.isContextual(name)) return false\n this.next()\n return true\n}\n\n// Asserts that following token is given contextual keyword.\n\npp.expectContextual = function(name) {\n if (!this.eatContextual(name)) this.unexpected()\n}\n\n// Test whether a semicolon can be inserted at the current position.\n\npp.canInsertSemicolon = function() {\n return this.type === tt.eof ||\n this.type === tt.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\npp.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc)\n return true\n }\n}\n\n// Consume a semicolon, or, failing that, see if we are allowed to\n// pretend that there is a semicolon at this position.\n\npp.semicolon = function() {\n if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected()\n}\n\npp.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc)\n if (!notNext)\n this.next()\n return true\n }\n}\n\n// Expect a token of a given type. If found, consume it, otherwise,\n// raise an unexpected token error.\n\npp.expect = function(type) {\n this.eat(type) || this.unexpected()\n}\n\n// Raise an unexpected token error.\n\npp.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\")\n}\n\nexport function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1\n}\n\npp.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) return\n if (refDestructuringErrors.trailingComma > -1)\n this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\")\n let parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind\n if (parens > -1) this.raiseRecoverable(parens, \"Parenthesized pattern\")\n}\n\npp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) return false\n let {shorthandAssign, doubleProto} = refDestructuringErrors\n if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0\n if (shorthandAssign >= 0)\n this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\")\n if (doubleProto >= 0)\n this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\")\n}\n\npp.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n this.raise(this.yieldPos, \"Yield expression cannot be a default value\")\n if (this.awaitPos)\n this.raise(this.awaitPos, \"Await expression cannot be a default value\")\n}\n\npp.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n return this.isSimpleAssignTarget(expr.expression)\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace\"\nimport {isIdentifierStart, isIdentifierChar, keywordRelationalOperator} from \"./identifier\"\nimport {has} from \"./util\"\nimport {DestructuringErrors} from \"./parseutil\"\nimport {functionFlags, SCOPE_SIMPLE_CATCH, BIND_SIMPLE_CATCH, BIND_LEXICAL, BIND_VAR, BIND_FUNCTION} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// ### Statement parsing\n\n// Parse a program. Initializes the parser, reads any number of\n// statements, and wraps them in a Program node. Optionally takes a\n// `program` argument. If present, the statements will be appended\n// to its body instead of creating a new node.\n\npp.parseTopLevel = function(node) {\n let exports = {}\n if (!node.body) node.body = []\n while (this.type !== tt.eof) {\n let stmt = this.parseStatement(null, true, exports)\n node.body.push(stmt)\n }\n this.adaptDirectivePrologue(node.body)\n this.next()\n if (this.options.ecmaVersion >= 6) {\n node.sourceType = this.options.sourceType\n }\n return this.finishNode(node, \"Program\")\n}\n\nconst loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"}\n\npp.isLet = function() {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) return false\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next)\n if (nextCh === 123 && !lineBreak.test(this.input.slice(this.end, next)) // '{'\n || nextCh === 91) return true // '['\n if (isIdentifierStart(nextCh, true)) {\n let pos = next + 1\n while (isIdentifierChar(this.input.charCodeAt(pos), true)) ++pos\n let ident = this.input.slice(next, pos)\n if (!keywordRelationalOperator.test(ident)) return true\n }\n return false\n}\n\n// check 'async [no LineTerminator here] function'\n// - 'async /*foo*/ function' is OK.\n// - 'async /*\\n*/ function' is invalid.\npp.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n return false\n\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))\n}\n\n// Parse a single statement.\n//\n// If expecting a statement and finding a slash operator, parse a\n// regular expression literal. This is to handle cases like\n// `if (foo) /blah/.exec(foo)`, where looking at the previous token\n// does not help.\n\npp.parseStatement = function(context, topLevel, exports) {\n let starttype = this.type, node = this.startNode(), kind\n\n if (this.isLet()) {\n starttype = tt._var\n kind = \"let\"\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case tt._debugger: return this.parseDebuggerStatement(node)\n case tt._do: return this.parseDoStatement(node)\n case tt._for: return this.parseForStatement(node)\n case tt._function:\n if ((context && (this.strict || context !== \"if\")) && this.options.ecmaVersion >= 6) this.unexpected()\n return this.parseFunctionStatement(node, false, !context)\n case tt._class:\n if (context) this.unexpected()\n return this.parseClass(node, true)\n case tt._if: return this.parseIfStatement(node)\n case tt._return: return this.parseReturnStatement(node)\n case tt._switch: return this.parseSwitchStatement(node)\n case tt._throw: return this.parseThrowStatement(node)\n case tt._try: return this.parseTryStatement(node)\n case tt._const: case tt._var:\n kind = kind || this.value\n if (context && kind !== \"var\") this.unexpected()\n return this.parseVarStatement(node, kind)\n case tt._while: return this.parseWhileStatement(node)\n case tt._with: return this.parseWithStatement(node)\n case tt.braceL: return this.parseBlock(true, node)\n case tt.semi: return this.parseEmptyStatement(node)\n case tt._export:\n case tt._import:\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n this.raise(this.start, \"'import' and 'export' may only appear at the top level\")\n if (!this.inModule)\n this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\")\n }\n return starttype === tt._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) this.unexpected()\n this.next()\n return this.parseFunctionStatement(node, true, !context)\n }\n\n let maybeName = this.value, expr = this.parseExpression()\n if (starttype === tt.name && expr.type === \"Identifier\" && this.eat(tt.colon))\n return this.parseLabeledStatement(node, maybeName, expr, context)\n else return this.parseExpressionStatement(node, expr)\n }\n}\n\npp.parseBreakContinueStatement = function(node, keyword) {\n let isBreak = keyword === \"break\"\n this.next()\n if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null\n else if (this.type !== tt.name) this.unexpected()\n else {\n node.label = this.parseIdent()\n this.semicolon()\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n let i = 0\n for (; i < this.labels.length; ++i) {\n let lab = this.labels[i]\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break\n if (node.label && isBreak) break\n }\n }\n if (i === this.labels.length) this.raise(node.start, \"Unsyntactic \" + keyword)\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n}\n\npp.parseDebuggerStatement = function(node) {\n this.next()\n this.semicolon()\n return this.finishNode(node, \"DebuggerStatement\")\n}\n\npp.parseDoStatement = function(node) {\n this.next()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"do\")\n this.labels.pop()\n this.expect(tt._while)\n node.test = this.parseParenExpression()\n if (this.options.ecmaVersion >= 6)\n this.eat(tt.semi)\n else\n this.semicolon()\n return this.finishNode(node, \"DoWhileStatement\")\n}\n\n// Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n// loop is non-trivial. Basically, we have to parse the init `var`\n// statement or expression, disallowing the `in` operator (see\n// the second parameter to `parseExpression`), and then check\n// whether the next token is `in` or `of`. When there is no init\n// part (semicolon immediately after the opening parenthesis), it\n// is a regular `for` loop.\n\npp.parseForStatement = function(node) {\n this.next()\n let awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual(\"await\")) ? this.lastTokStart : -1\n this.labels.push(loopLabel)\n this.enterScope(0)\n this.expect(tt.parenL)\n if (this.type === tt.semi) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, null)\n }\n let isLet = this.isLet()\n if (this.type === tt._var || this.type === tt._const || isLet) {\n let init = this.startNode(), kind = isLet ? \"let\" : this.value\n this.next()\n this.parseVar(init, true, kind)\n this.finishNode(init, \"VariableDeclaration\")\n if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init.declarations.length === 1 &&\n !(kind !== \"var\" && init.declarations[0].init)) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n return this.parseForIn(node, init)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n }\n let refDestructuringErrors = new DestructuringErrors\n let init = this.parseExpression(true, refDestructuringErrors)\n if (this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n this.toAssignable(init, false, refDestructuringErrors)\n this.checkLVal(init)\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n}\n\npp.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next()\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n}\n\npp.parseIfStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\")\n node.alternate = this.eat(tt._else) ? this.parseStatement(\"if\") : null\n return this.finishNode(node, \"IfStatement\")\n}\n\npp.parseReturnStatement = function(node) {\n if (!this.inFunction && !this.options.allowReturnOutsideFunction)\n this.raise(this.start, \"'return' outside of function\")\n this.next()\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null\n else { node.argument = this.parseExpression(); this.semicolon() }\n return this.finishNode(node, \"ReturnStatement\")\n}\n\npp.parseSwitchStatement = function(node) {\n this.next()\n node.discriminant = this.parseParenExpression()\n node.cases = []\n this.expect(tt.braceL)\n this.labels.push(switchLabel)\n this.enterScope(0)\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n let cur\n for (let sawDefault = false; this.type !== tt.braceR;) {\n if (this.type === tt._case || this.type === tt._default) {\n let isCase = this.type === tt._case\n if (cur) this.finishNode(cur, \"SwitchCase\")\n node.cases.push(cur = this.startNode())\n cur.consequent = []\n this.next()\n if (isCase) {\n cur.test = this.parseExpression()\n } else {\n if (sawDefault) this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\")\n sawDefault = true\n cur.test = null\n }\n this.expect(tt.colon)\n } else {\n if (!cur) this.unexpected()\n cur.consequent.push(this.parseStatement(null))\n }\n }\n this.exitScope()\n if (cur) this.finishNode(cur, \"SwitchCase\")\n this.next() // Closing brace\n this.labels.pop()\n return this.finishNode(node, \"SwitchStatement\")\n}\n\npp.parseThrowStatement = function(node) {\n this.next()\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n this.raise(this.lastTokEnd, \"Illegal newline after throw\")\n node.argument = this.parseExpression()\n this.semicolon()\n return this.finishNode(node, \"ThrowStatement\")\n}\n\n// Reused empty array added for node fields that are always empty.\n\nconst empty = []\n\npp.parseTryStatement = function(node) {\n this.next()\n node.block = this.parseBlock()\n node.handler = null\n if (this.type === tt._catch) {\n let clause = this.startNode()\n this.next()\n if (this.eat(tt.parenL)) {\n clause.param = this.parseBindingAtom()\n let simple = clause.param.type === \"Identifier\"\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0)\n this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL)\n this.expect(tt.parenR)\n } else {\n if (this.options.ecmaVersion < 10) this.unexpected()\n clause.param = null\n this.enterScope(0)\n }\n clause.body = this.parseBlock(false)\n this.exitScope()\n node.handler = this.finishNode(clause, \"CatchClause\")\n }\n node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null\n if (!node.handler && !node.finalizer)\n this.raise(node.start, \"Missing catch or finally clause\")\n return this.finishNode(node, \"TryStatement\")\n}\n\npp.parseVarStatement = function(node, kind) {\n this.next()\n this.parseVar(node, false, kind)\n this.semicolon()\n return this.finishNode(node, \"VariableDeclaration\")\n}\n\npp.parseWhileStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"while\")\n this.labels.pop()\n return this.finishNode(node, \"WhileStatement\")\n}\n\npp.parseWithStatement = function(node) {\n if (this.strict) this.raise(this.start, \"'with' in strict mode\")\n this.next()\n node.object = this.parseParenExpression()\n node.body = this.parseStatement(\"with\")\n return this.finishNode(node, \"WithStatement\")\n}\n\npp.parseEmptyStatement = function(node) {\n this.next()\n return this.finishNode(node, \"EmptyStatement\")\n}\n\npp.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (let label of this.labels)\n if (label.name === maybeName)\n this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\")\n let kind = this.type.isLoop ? \"loop\" : this.type === tt._switch ? \"switch\" : null\n for (let i = this.labels.length - 1; i >= 0; i--) {\n let label = this.labels[i]\n if (label.statementStart === node.start) {\n // Update information about previous labels on this node\n label.statementStart = this.start\n label.kind = kind\n } else break\n }\n this.labels.push({name: maybeName, kind, statementStart: this.start})\n node.body = this.parseStatement(context)\n if (node.body.type === \"ClassDeclaration\" ||\n node.body.type === \"VariableDeclaration\" && node.body.kind !== \"var\" ||\n node.body.type === \"FunctionDeclaration\" && (this.strict || node.body.generator || node.body.async))\n this.raiseRecoverable(node.body.start, \"Invalid labeled declaration\")\n this.labels.pop()\n node.label = expr\n return this.finishNode(node, \"LabeledStatement\")\n}\n\npp.parseExpressionStatement = function(node, expr) {\n node.expression = expr\n this.semicolon()\n return this.finishNode(node, \"ExpressionStatement\")\n}\n\n// Parse a semicolon-enclosed block of statements, handling `\"use\n// strict\"` declarations when `allowStrict` is true (used for\n// function bodies).\n\npp.parseBlock = function(createNewLexicalScope = true, node = this.startNode()) {\n node.body = []\n this.expect(tt.braceL)\n if (createNewLexicalScope) this.enterScope(0)\n while (!this.eat(tt.braceR)) {\n let stmt = this.parseStatement(null)\n node.body.push(stmt)\n }\n if (createNewLexicalScope) this.exitScope()\n return this.finishNode(node, \"BlockStatement\")\n}\n\n// Parse a regular `for` loop. The disambiguation code in\n// `parseStatement` will already have parsed the init statement or\n// expression.\n\npp.parseFor = function(node, init) {\n node.init = init\n this.expect(tt.semi)\n node.test = this.type === tt.semi ? null : this.parseExpression()\n this.expect(tt.semi)\n node.update = this.type === tt.parenR ? null : this.parseExpression()\n this.expect(tt.parenR)\n this.exitScope()\n node.body = this.parseStatement(\"for\")\n this.labels.pop()\n return this.finishNode(node, \"ForStatement\")\n}\n\n// Parse a `for`/`in` and `for`/`of` loop, which are almost\n// same from parser's perspective.\n\npp.parseForIn = function(node, init) {\n let type = this.type === tt._in ? \"ForInStatement\" : \"ForOfStatement\"\n this.next()\n if (type === \"ForInStatement\") {\n if (init.type === \"AssignmentPattern\" ||\n (init.type === \"VariableDeclaration\" && init.declarations[0].init != null &&\n (this.strict || init.declarations[0].id.type !== \"Identifier\")))\n this.raise(init.start, \"Invalid assignment in for-in loop head\")\n }\n node.left = init\n node.right = type === \"ForInStatement\" ? this.parseExpression() : this.parseMaybeAssign()\n this.expect(tt.parenR)\n this.exitScope()\n node.body = this.parseStatement(\"for\")\n this.labels.pop()\n return this.finishNode(node, type)\n}\n\n// Parse a list of variable declarations.\n\npp.parseVar = function(node, isFor, kind) {\n node.declarations = []\n node.kind = kind\n for (;;) {\n let decl = this.startNode()\n this.parseVarId(decl, kind)\n if (this.eat(tt.eq)) {\n decl.init = this.parseMaybeAssign(isFor)\n } else if (kind === \"const\" && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected()\n } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === tt._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\")\n } else {\n decl.init = null\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"))\n if (!this.eat(tt.comma)) break\n }\n return node\n}\n\npp.parseVarId = function(decl, kind) {\n decl.id = this.parseBindingAtom(kind)\n this.checkLVal(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false)\n}\n\nconst FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4\n\n// Parse a function declaration or literal (depending on the\n// `isStatement` parameter).\n\npp.parseFunction = function(node, statement, allowExpressionBody, isAsync) {\n this.initFunction(node)\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync)\n node.generator = this.eat(tt.star)\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== tt.name ? null : this.parseIdent()\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n this.checkLVal(node.id, this.inModule && !this.inFunction ? BIND_LEXICAL : BIND_FUNCTION)\n }\n\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n this.yieldPos = 0\n this.awaitPos = 0\n this.enterScope(functionFlags(node.async, node.generator))\n\n if (!(statement & FUNC_STATEMENT))\n node.id = this.type === tt.name ? this.parseIdent() : null\n\n this.parseFunctionParams(node)\n this.parseFunctionBody(node, allowExpressionBody)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n}\n\npp.parseFunctionParams = function(node) {\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n}\n\n// Parse a class declaration or literal (depending on the\n// `isStatement` parameter).\n\npp.parseClass = function(node, isStatement) {\n this.next()\n\n this.parseClassId(node, isStatement)\n this.parseClassSuper(node)\n let classBody = this.startNode()\n let hadConstructor = false\n classBody.body = []\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n const element = this.parseClassElement(node.superClass !== null)\n if (element) {\n classBody.body.push(element)\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) this.raise(element.start, \"Duplicate constructor in the same class\")\n hadConstructor = true\n }\n }\n }\n node.body = this.finishNode(classBody, \"ClassBody\")\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n}\n\npp.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(tt.semi)) return null\n\n let method = this.startNode()\n const tryContextual = (k, noLineBreak = false) => {\n const start = this.start, startLoc = this.startLoc\n if (!this.eatContextual(k)) return false\n if (this.type !== tt.parenL && (!noLineBreak || !this.canInsertSemicolon())) return true\n if (method.key) this.unexpected()\n method.computed = false\n method.key = this.startNodeAt(start, startLoc)\n method.key.name = k\n this.finishNode(method.key, \"Identifier\")\n return false\n }\n\n method.kind = \"method\"\n method.static = tryContextual(\"static\")\n let isGenerator = this.eat(tt.star)\n let isAsync = false\n if (!isGenerator) {\n if (this.options.ecmaVersion >= 8 && tryContextual(\"async\", true)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n } else if (tryContextual(\"get\")) {\n method.kind = \"get\"\n } else if (tryContextual(\"set\")) {\n method.kind = \"set\"\n }\n }\n if (!method.key) this.parsePropertyName(method)\n let {key} = method\n let allowsDirectSuper = false\n if (!method.computed && !method.static && (key.type === \"Identifier\" && key.name === \"constructor\" ||\n key.type === \"Literal\" && key.value === \"constructor\")) {\n if (method.kind !== \"method\") this.raise(key.start, \"Constructor can't have get/set modifier\")\n if (isGenerator) this.raise(key.start, \"Constructor can't be a generator\")\n if (isAsync) this.raise(key.start, \"Constructor can't be an async method\")\n method.kind = \"constructor\"\n allowsDirectSuper = constructorAllowsSuper\n } else if (method.static && key.type === \"Identifier\" && key.name === \"prototype\") {\n this.raise(key.start, \"Classes may not have a static property named prototype\")\n }\n this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper)\n if (method.kind === \"get\" && method.value.params.length !== 0)\n this.raiseRecoverable(method.value.start, \"getter should have no params\")\n if (method.kind === \"set\" && method.value.params.length !== 1)\n this.raiseRecoverable(method.value.start, \"setter should have exactly one param\")\n if (method.kind === \"set\" && method.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(method.value.params[0].start, \"Setter cannot use rest params\")\n return method\n}\n\npp.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper)\n return this.finishNode(method, \"MethodDefinition\")\n}\n\npp.parseClassId = function(node, isStatement) {\n node.id = this.type === tt.name ? this.parseIdent() : isStatement === true ? this.unexpected() : null\n}\n\npp.parseClassSuper = function(node) {\n node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null\n}\n\n// Parses module export declaration.\n\npp.parseExport = function(node, exports) {\n this.next()\n // export * from '...'\n if (this.eat(tt.star)) {\n this.expectContextual(\"from\")\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n this.semicolon()\n return this.finishNode(node, \"ExportAllDeclaration\")\n }\n if (this.eat(tt._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart)\n let isAsync\n if (this.type === tt._function || (isAsync = this.isAsyncFunction())) {\n let fNode = this.startNode()\n this.next()\n if (isAsync) this.next()\n node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync, true)\n } else if (this.type === tt._class) {\n let cNode = this.startNode()\n node.declaration = this.parseClass(cNode, \"nullableID\")\n } else {\n node.declaration = this.parseMaybeAssign()\n this.semicolon()\n }\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseStatement(null)\n if (node.declaration.type === \"VariableDeclaration\")\n this.checkVariableExport(exports, node.declaration.declarations)\n else\n this.checkExport(exports, node.declaration.id.name, node.declaration.id.start)\n node.specifiers = []\n node.source = null\n } else { // export { x, y as z } [from '...']\n node.declaration = null\n node.specifiers = this.parseExportSpecifiers(exports)\n if (this.eatContextual(\"from\")) {\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n } else {\n // check for keywords used as local names\n for (let spec of node.specifiers) {\n this.checkUnreserved(spec.local)\n }\n\n node.source = null\n }\n this.semicolon()\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n}\n\npp.checkExport = function(exports, name, pos) {\n if (!exports) return\n if (has(exports, name))\n this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\")\n exports[name] = true\n}\n\npp.checkPatternExport = function(exports, pat) {\n let type = pat.type\n if (type === \"Identifier\")\n this.checkExport(exports, pat.name, pat.start)\n else if (type === \"ObjectPattern\")\n for (let prop of pat.properties)\n this.checkPatternExport(exports, prop)\n else if (type === \"ArrayPattern\")\n for (let elt of pat.elements) {\n if (elt) this.checkPatternExport(exports, elt)\n }\n else if (type === \"Property\")\n this.checkPatternExport(exports, pat.value)\n else if (type === \"AssignmentPattern\")\n this.checkPatternExport(exports, pat.left)\n else if (type === \"RestElement\")\n this.checkPatternExport(exports, pat.argument)\n else if (type === \"ParenthesizedExpression\")\n this.checkPatternExport(exports, pat.expression)\n}\n\npp.checkVariableExport = function(exports, decls) {\n if (!exports) return\n for (let decl of decls)\n this.checkPatternExport(exports, decl.id)\n}\n\npp.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n}\n\n// Parses a comma-separated list of module exports.\n\npp.parseExportSpecifiers = function(exports) {\n let nodes = [], first = true\n // export { x, y as z } [from '...']\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.local = this.parseIdent(true)\n node.exported = this.eatContextual(\"as\") ? this.parseIdent(true) : node.local\n this.checkExport(exports, node.exported.name, node.exported.start)\n nodes.push(this.finishNode(node, \"ExportSpecifier\"))\n }\n return nodes\n}\n\n// Parses import declaration.\n\npp.parseImport = function(node) {\n this.next()\n // import '...'\n if (this.type === tt.string) {\n node.specifiers = empty\n node.source = this.parseExprAtom()\n } else {\n node.specifiers = this.parseImportSpecifiers()\n this.expectContextual(\"from\")\n node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected()\n }\n this.semicolon()\n return this.finishNode(node, \"ImportDeclaration\")\n}\n\n// Parses a comma-separated list of module imports.\n\npp.parseImportSpecifiers = function() {\n let nodes = [], first = true\n if (this.type === tt.name) {\n // import defaultObj, { x, y as z } from '...'\n let node = this.startNode()\n node.local = this.parseIdent()\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"))\n if (!this.eat(tt.comma)) return nodes\n }\n if (this.type === tt.star) {\n let node = this.startNode()\n this.next()\n this.expectContextual(\"as\")\n node.local = this.parseIdent()\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportNamespaceSpecifier\"))\n return nodes\n }\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.imported = this.parseIdent(true)\n if (this.eatContextual(\"as\")) {\n node.local = this.parseIdent()\n } else {\n this.checkUnreserved(node.imported)\n node.local = node.imported\n }\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportSpecifier\"))\n }\n return nodes\n}\n\n// Set `ExpressionStatement#directive` property for directive prologues.\npp.adaptDirectivePrologue = function(statements) {\n for (let i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1)\n }\n}\npp.isDirectiveCandidate = function(statement) {\n return (\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {has} from \"./util\"\nimport {BIND_NONE, BIND_OUTSIDE} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// Convert existing expression atom to assignable pattern\n// if possible.\n\npp.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n this.raise(node.start, \"Can not use 'await' as identifier inside an async function\")\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n for (let prop of node.properties) {\n this.toAssignable(prop, isBinding)\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\")\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") this.raise(node.key.start, \"Object pattern can't contain getter or setter\")\n this.toAssignable(node.value, isBinding)\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n this.toAssignableList(node.elements, isBinding)\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\"\n this.toAssignable(node.argument, isBinding)\n if (node.argument.type === \"AssignmentPattern\")\n this.raise(node.argument.start, \"Rest elements cannot have a default value\")\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\")\n node.type = \"AssignmentPattern\"\n delete node.operator\n this.toAssignable(node.left, isBinding)\n // falls through to AssignmentPattern\n\n case \"AssignmentPattern\":\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors)\n break\n\n case \"MemberExpression\":\n if (!isBinding) break\n\n default:\n this.raise(node.start, \"Assigning to rvalue\")\n }\n } else if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n return node\n}\n\n// Convert list of expression atoms to binding list.\n\npp.toAssignableList = function(exprList, isBinding) {\n let end = exprList.length\n for (let i = 0; i < end; i++) {\n let elt = exprList[i]\n if (elt) this.toAssignable(elt, isBinding)\n }\n if (end) {\n let last = exprList[end - 1]\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n this.unexpected(last.argument.start)\n }\n return exprList\n}\n\n// Parses spread element.\n\npp.parseSpread = function(refDestructuringErrors) {\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n return this.finishNode(node, \"SpreadElement\")\n}\n\npp.parseRestBinding = function() {\n let node = this.startNode()\n this.next()\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== tt.name)\n this.unexpected()\n\n node.argument = this.parseBindingAtom()\n\n return this.finishNode(node, \"RestElement\")\n}\n\n// Parses lvalue (assignable) atom.\n\npp.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case tt.bracketL:\n let node = this.startNode()\n this.next()\n node.elements = this.parseBindingList(tt.bracketR, true, true)\n return this.finishNode(node, \"ArrayPattern\")\n\n case tt.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n}\n\npp.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (first) first = false\n else this.expect(tt.comma)\n if (allowEmpty && this.type === tt.comma) {\n elts.push(null)\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === tt.ellipsis) {\n let rest = this.parseRestBinding()\n this.parseBindingListItem(rest)\n elts.push(rest)\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n this.expect(close)\n break\n } else {\n let elem = this.parseMaybeDefault(this.start, this.startLoc)\n this.parseBindingListItem(elem)\n elts.push(elem)\n }\n }\n return elts\n}\n\npp.parseBindingListItem = function(param) {\n return param\n}\n\n// Parses assignment pattern around given atom if possible.\n\npp.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom()\n if (this.options.ecmaVersion < 6 || !this.eat(tt.eq)) return left\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.right = this.parseMaybeAssign()\n return this.finishNode(node, \"AssignmentPattern\")\n}\n\n// Verify that a node is an lval — something that can be assigned\n// to.\n// bindingType can be either:\n// 'var' indicating that the lval creates a 'var' binding\n// 'let' indicating that the lval creates a lexical ('let' or 'const') binding\n// 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references\n\npp.checkLVal = function(expr, bindingType = BIND_NONE, checkClashes) {\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n this.raiseRecoverable(expr.start, (bindingType ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\")\n if (checkClashes) {\n if (has(checkClashes, expr.name))\n this.raiseRecoverable(expr.start, \"Argument name clash\")\n checkClashes[expr.name] = true\n }\n if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) this.declareName(expr.name, bindingType, expr.start)\n break\n\n case \"MemberExpression\":\n if (bindingType) this.raiseRecoverable(expr.start, \"Binding member expression\")\n break\n\n case \"ObjectPattern\":\n for (let prop of expr.properties)\n this.checkLVal(prop, bindingType, checkClashes)\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLVal(expr.value, bindingType, checkClashes)\n break\n\n case \"ArrayPattern\":\n for (let elem of expr.elements) {\n if (elem) this.checkLVal(elem, bindingType, checkClashes)\n }\n break\n\n case \"AssignmentPattern\":\n this.checkLVal(expr.left, bindingType, checkClashes)\n break\n\n case \"RestElement\":\n this.checkLVal(expr.argument, bindingType, checkClashes)\n break\n\n case \"ParenthesizedExpression\":\n this.checkLVal(expr.expression, bindingType, checkClashes)\n break\n\n default:\n this.raise(expr.start, (bindingType ? \"Binding\" : \"Assigning to\") + \" rvalue\")\n }\n}\n","// A recursive descent parser operates by defining functions for all\n// syntactic elements, and recursively calling those, each function\n// advancing the input stream and returning an AST node. Precedence\n// of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n// instead of `(!x)[1]` is handled by the fact that the parser\n// function that parses unary prefix operators is called first, and\n// in turn calls the function that parses `[]` subscripts — that\n// way, it'll receive the node for `x[1]` already parsed, and wraps\n// *that* in the unary operator node.\n//\n// Acorn uses an [operator precedence parser][opp] to handle binary\n// operator precedence, because it is much more compact than using\n// the technique outlined above, which uses different, nesting\n// functions to specify precedence, for all of the ten binary\n// precedence levels that JavaScript defines.\n//\n// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\nimport {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {DestructuringErrors} from \"./parseutil\"\nimport {lineBreak} from \"./whitespace\"\nimport {functionFlags, SCOPE_ARROW, SCOPE_SUPER, SCOPE_DIRECT_SUPER, BIND_OUTSIDE, BIND_VAR} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// Check if property name clashes with already added.\n// Object/class getters and setters are not allowed to clash —\n// either with each other or with an init property — and in\n// strict mode, init properties are also not allowed to be repeated.\n\npp.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n return\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n return\n let {key} = prop, name\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n let {kind} = prop\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) refDestructuringErrors.doubleProto = key.start\n // Backwards-compat kludge. Can be removed in version 6.0\n else this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\")\n }\n propHash.proto = true\n }\n return\n }\n name = \"$\" + name\n let other = propHash[name]\n if (other) {\n let redefinition\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set\n } else {\n redefinition = other.init || other[kind]\n }\n if (redefinition)\n this.raiseRecoverable(key.start, \"Redefinition of property\")\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n }\n }\n other[kind] = true\n}\n\n// ### Expression parsing\n\n// These nest, from the most general expression type at the top to\n// 'atomic', nondivisible expression types at the bottom. Most of\n// the functions will simply let the function(s) below them parse,\n// and, *if* the syntactic construct they handle is present, wrap\n// the AST node that the inner parser gave them in another node.\n\n// Parse a full expression. The optional arguments are used to\n// forbid the `in` operator (in for loops initalization expressions)\n// and provide reference for storing '=' operator inside shorthand\n// property assignment in contexts where both object expression\n// and object pattern might appear (so it's possible to raise\n// delayed syntax error at correct position).\n\npp.parseExpression = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeAssign(noIn, refDestructuringErrors)\n if (this.type === tt.comma) {\n let node = this.startNodeAt(startPos, startLoc)\n node.expressions = [expr]\n while (this.eat(tt.comma)) node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors))\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n}\n\n// Parse an assignment expression. This includes applications of\n// operators like `+=`.\n\npp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) return this.parseYield()\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else this.exprAllowed = false\n }\n\n let ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign\n oldTrailingComma = refDestructuringErrors.trailingComma\n oldShorthandAssign = refDestructuringErrors.shorthandAssign\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1\n } else {\n refDestructuringErrors = new DestructuringErrors\n ownDestructuringErrors = true\n }\n\n let startPos = this.start, startLoc = this.startLoc\n if (this.type === tt.parenL || this.type === tt.name)\n this.potentialArrowAt = this.start\n let left = this.parseMaybeConditional(noIn, refDestructuringErrors)\n if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc)\n if (this.type.isAssign) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n node.left = this.type === tt.eq ? this.toAssignable(left, false, refDestructuringErrors) : left\n if (!ownDestructuringErrors) DestructuringErrors.call(refDestructuringErrors)\n refDestructuringErrors.shorthandAssign = -1 // reset because shorthand default was used correctly\n this.checkLVal(left)\n this.next()\n node.right = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (oldParenAssign > -1) refDestructuringErrors.parenthesizedAssign = oldParenAssign\n if (oldTrailingComma > -1) refDestructuringErrors.trailingComma = oldTrailingComma\n if (oldShorthandAssign > -1) refDestructuringErrors.shorthandAssign = oldShorthandAssign\n return left\n}\n\n// Parse a ternary conditional (`?:`) operator.\n\npp.parseMaybeConditional = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprOps(noIn, refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n if (this.eat(tt.question)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.test = expr\n node.consequent = this.parseMaybeAssign()\n this.expect(tt.colon)\n node.alternate = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n}\n\n// Start the precedence parser.\n\npp.parseExprOps = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeUnary(refDestructuringErrors, false)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)\n}\n\n// Parse binary operators with the operator precedence parsing\n// algorithm. `left` is the left-hand side of the operator.\n// `minPrec` provides context that allows the function to stop and\n// defer further parser to one of its callers when it encounters an\n// operator that has a lower precedence than the set it is parsing.\n\npp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {\n let prec = this.type.binop\n if (prec != null && (!noIn || this.type !== tt._in)) {\n if (prec > minPrec) {\n let logical = this.type === tt.logicalOR || this.type === tt.logicalAND\n let op = this.value\n this.next()\n let startPos = this.start, startLoc = this.startLoc\n let right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn)\n let node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical)\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)\n }\n }\n return left\n}\n\npp.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.operator = op\n node.right = right\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n}\n\n// Parse unary operators, both prefix and postfix.\n\npp.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {\n let startPos = this.start, startLoc = this.startLoc, expr\n if (this.isContextual(\"await\") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {\n expr = this.parseAwait()\n sawUnary = true\n } else if (this.type.prefix) {\n let node = this.startNode(), update = this.type === tt.incDec\n node.operator = this.value\n node.prefix = true\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n this.checkExpressionErrors(refDestructuringErrors, true)\n if (update) this.checkLVal(node.argument)\n else if (this.strict && node.operator === \"delete\" &&\n node.argument.type === \"Identifier\")\n this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\")\n else sawUnary = true\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\")\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n while (this.type.postfix && !this.canInsertSemicolon()) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n node.prefix = false\n node.argument = expr\n this.checkLVal(expr)\n this.next()\n expr = this.finishNode(node, \"UpdateExpression\")\n }\n }\n\n if (!sawUnary && this.eat(tt.starstar))\n return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), \"**\", false)\n else\n return expr\n}\n\n// Parse call, dot, and `[]`-subscript expressions.\n\npp.parseExprSubscripts = function(refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprAtom(refDestructuringErrors)\n let skipArrowSubscripts = expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\"\n if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr\n let result = this.parseSubscripts(expr, startPos, startLoc)\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) refDestructuringErrors.parenthesizedAssign = -1\n if (refDestructuringErrors.parenthesizedBind >= result.start) refDestructuringErrors.parenthesizedBind = -1\n }\n return result\n}\n\npp.parseSubscripts = function(base, startPos, startLoc, noCalls) {\n let maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === \"async\"\n for (let computed;;) {\n if ((computed = this.eat(tt.bracketL)) || this.eat(tt.dot)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.object = base\n node.property = computed ? this.parseExpression() : this.parseIdent(true)\n node.computed = !!computed\n if (computed) this.expect(tt.bracketR)\n base = this.finishNode(node, \"MemberExpression\")\n } else if (!noCalls && this.eat(tt.parenL)) {\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n this.yieldPos = 0\n this.awaitPos = 0\n let exprList = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors)\n if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)\n }\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n let node = this.startNodeAt(startPos, startLoc)\n node.callee = base\n node.arguments = exprList\n base = this.finishNode(node, \"CallExpression\")\n } else if (this.type === tt.backQuote) {\n let node = this.startNodeAt(startPos, startLoc)\n node.tag = base\n node.quasi = this.parseTemplate({isTagged: true})\n base = this.finishNode(node, \"TaggedTemplateExpression\")\n } else {\n return base\n }\n }\n}\n\n// Parse an atomic expression — either a single token that is an\n// expression, an expression started by a keyword like `function` or\n// `new`, or an expression wrapped in punctuation like `()`, `[]`,\n// or `{}`.\n\npp.parseExprAtom = function(refDestructuringErrors) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === tt.slash) this.readRegexp()\n\n let node, canBeArrow = this.potentialArrowAt === this.start\n switch (this.type) {\n case tt._super:\n if (!this.allowSuper)\n this.raise(this.start, \"'super' keyword outside a method\")\n node = this.startNode()\n this.next()\n if (this.type === tt.parenL && !this.allowDirectSuper)\n this.raise(node.start, \"super() call outside constructor of a subclass\")\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super Arguments\n if (this.type !== tt.dot && this.type !== tt.bracketL && this.type !== tt.parenL)\n this.unexpected()\n return this.finishNode(node, \"Super\")\n\n case tt._this:\n node = this.startNode()\n this.next()\n return this.finishNode(node, \"ThisExpression\")\n\n case tt.name:\n let startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc\n let id = this.parseIdent(this.type !== tt.name)\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(tt._function))\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true)\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(tt.arrow))\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false)\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === tt.name && !containsEsc) {\n id = this.parseIdent()\n if (this.canInsertSemicolon() || !this.eat(tt.arrow))\n this.unexpected()\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)\n }\n }\n return id\n\n case tt.regexp:\n let value = this.value\n node = this.parseLiteral(value.value)\n node.regex = {pattern: value.pattern, flags: value.flags}\n return node\n\n case tt.num: case tt.string:\n return this.parseLiteral(this.value)\n\n case tt._null: case tt._true: case tt._false:\n node = this.startNode()\n node.value = this.type === tt._null ? null : this.type === tt._true\n node.raw = this.type.keyword\n this.next()\n return this.finishNode(node, \"Literal\")\n\n case tt.parenL:\n let start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow)\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n refDestructuringErrors.parenthesizedAssign = start\n if (refDestructuringErrors.parenthesizedBind < 0)\n refDestructuringErrors.parenthesizedBind = start\n }\n return expr\n\n case tt.bracketL:\n node = this.startNode()\n this.next()\n node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors)\n return this.finishNode(node, \"ArrayExpression\")\n\n case tt.braceL:\n return this.parseObj(false, refDestructuringErrors)\n\n case tt._function:\n node = this.startNode()\n this.next()\n return this.parseFunction(node, 0)\n\n case tt._class:\n return this.parseClass(this.startNode(), false)\n\n case tt._new:\n return this.parseNew()\n\n case tt.backQuote:\n return this.parseTemplate()\n\n default:\n this.unexpected()\n }\n}\n\npp.parseLiteral = function(value) {\n let node = this.startNode()\n node.value = value\n node.raw = this.input.slice(this.start, this.end)\n this.next()\n return this.finishNode(node, \"Literal\")\n}\n\npp.parseParenExpression = function() {\n this.expect(tt.parenL)\n let val = this.parseExpression()\n this.expect(tt.parenR)\n return val\n}\n\npp.parseParenAndDistinguishExpression = function(canBeArrow) {\n let startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8\n if (this.options.ecmaVersion >= 6) {\n this.next()\n\n let innerStartPos = this.start, innerStartLoc = this.startLoc\n let exprList = [], first = true, lastIsComma = false\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart\n this.yieldPos = 0\n this.awaitPos = 0\n while (this.type !== tt.parenR) {\n first ? first = false : this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(tt.parenR, true)) {\n lastIsComma = true\n break\n } else if (this.type === tt.ellipsis) {\n spreadStart = this.start\n exprList.push(this.parseParenItem(this.parseRestBinding()))\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem))\n }\n }\n let innerEndPos = this.start, innerEndLoc = this.startLoc\n this.expect(tt.parenR)\n\n if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.parseParenArrowList(startPos, startLoc, exprList)\n }\n\n if (!exprList.length || lastIsComma) this.unexpected(this.lastTokStart)\n if (spreadStart) this.unexpected(spreadStart)\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc)\n val.expressions = exprList\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc)\n } else {\n val = exprList[0]\n }\n } else {\n val = this.parseParenExpression()\n }\n\n if (this.options.preserveParens) {\n let par = this.startNodeAt(startPos, startLoc)\n par.expression = val\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n}\n\npp.parseParenItem = function(item) {\n return item\n}\n\npp.parseParenArrowList = function(startPos, startLoc, exprList) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)\n}\n\n// New's precedence is slightly tricky. It must allow its argument to\n// be a `[]` or dot subscript expression, but not a call — at least,\n// not without wrapping it in parentheses. Thus, it uses the noCalls\n// argument to parseSubscripts to prevent it from consuming the\n// argument list.\n\nconst empty = []\n\npp.parseNew = function() {\n let node = this.startNode()\n let meta = this.parseIdent(true)\n if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) {\n node.meta = meta\n let containsEsc = this.containsEsc\n node.property = this.parseIdent(true)\n if (node.property.name !== \"target\" || containsEsc)\n this.raiseRecoverable(node.property.start, \"The only valid meta property for new is new.target\")\n if (!this.inNonArrowFunction())\n this.raiseRecoverable(node.start, \"new.target can only be used in functions\")\n return this.finishNode(node, \"MetaProperty\")\n }\n let startPos = this.start, startLoc = this.startLoc\n node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true)\n if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false)\n else node.arguments = empty\n return this.finishNode(node, \"NewExpression\")\n}\n\n// Parse template expression.\n\npp.parseTemplateElement = function({isTagged}) {\n let elem = this.startNode()\n if (this.type === tt.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\")\n }\n elem.value = {\n raw: this.value,\n cooked: null\n }\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n }\n }\n this.next()\n elem.tail = this.type === tt.backQuote\n return this.finishNode(elem, \"TemplateElement\")\n}\n\npp.parseTemplate = function({isTagged = false} = {}) {\n let node = this.startNode()\n this.next()\n node.expressions = []\n let curElt = this.parseTemplateElement({isTagged})\n node.quasis = [curElt]\n while (!curElt.tail) {\n if (this.type === tt.eof) this.raise(this.pos, \"Unterminated template literal\")\n this.expect(tt.dollarBraceL)\n node.expressions.push(this.parseExpression())\n this.expect(tt.braceR)\n node.quasis.push(curElt = this.parseTemplateElement({isTagged}))\n }\n this.next()\n return this.finishNode(node, \"TemplateLiteral\")\n}\n\npp.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === tt.name || this.type === tt.num || this.type === tt.string || this.type === tt.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === tt.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\n// Parse an object literal or binding pattern.\n\npp.parseObj = function(isPattern, refDestructuringErrors) {\n let node = this.startNode(), first = true, propHash = {}\n node.properties = []\n this.next()\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n const prop = this.parseProperty(isPattern, refDestructuringErrors)\n if (!isPattern) this.checkPropClash(prop, propHash, refDestructuringErrors)\n node.properties.push(prop)\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n}\n\npp.parseProperty = function(isPattern, refDestructuringErrors) {\n let prop = this.startNode(), isGenerator, isAsync, startPos, startLoc\n if (this.options.ecmaVersion >= 9 && this.eat(tt.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false)\n if (this.type === tt.comma) {\n this.raise(this.start, \"Comma is not permitted after the rest element\")\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // To disallow parenthesized identifier via `this.toAssignable()`.\n if (this.type === tt.parenL && refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0) {\n refDestructuringErrors.parenthesizedAssign = this.start\n }\n if (refDestructuringErrors.parenthesizedBind < 0) {\n refDestructuringErrors.parenthesizedBind = this.start\n }\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === tt.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false\n prop.shorthand = false\n if (isPattern || refDestructuringErrors) {\n startPos = this.start\n startLoc = this.startLoc\n }\n if (!isPattern)\n isGenerator = this.eat(tt.star)\n }\n let containsEsc = this.containsEsc\n this.parsePropertyName(prop)\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n this.parsePropertyName(prop, refDestructuringErrors)\n } else {\n isAsync = false\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc)\n return this.finishNode(prop, \"Property\")\n}\n\npp.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === tt.colon)\n this.unexpected()\n\n if (this.eat(tt.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors)\n prop.kind = \"init\"\n } else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) {\n if (isPattern) this.unexpected()\n prop.kind = \"init\"\n prop.method = true\n prop.value = this.parseMethod(isGenerator, isAsync)\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== tt.comma && this.type !== tt.braceR)) {\n if (isGenerator || isAsync) this.unexpected()\n prop.kind = prop.key.name\n this.parsePropertyName(prop)\n prop.value = this.parseMethod(false)\n let paramCount = prop.kind === \"get\" ? 0 : 1\n if (prop.value.params.length !== paramCount) {\n let start = prop.value.start\n if (prop.kind === \"get\")\n this.raiseRecoverable(start, \"getter should have no params\")\n else\n this.raiseRecoverable(start, \"setter should have exactly one param\")\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\")\n }\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n this.checkUnreserved(prop.key)\n prop.kind = \"init\"\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)\n } else if (this.type === tt.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n refDestructuringErrors.shorthandAssign = this.start\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)\n } else {\n prop.value = prop.key\n }\n prop.shorthand = true\n } else this.unexpected()\n}\n\npp.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(tt.bracketL)) {\n prop.computed = true\n prop.key = this.parseMaybeAssign()\n this.expect(tt.bracketR)\n return prop.key\n } else {\n prop.computed = false\n }\n }\n return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(true)\n}\n\n// Initialize empty function node.\n\npp.initFunction = function(node) {\n node.id = null\n if (this.options.ecmaVersion >= 6) node.generator = node.expression = false\n if (this.options.ecmaVersion >= 8) node.async = false\n}\n\n// Parse object or class method.\n\npp.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n let node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n\n this.initFunction(node)\n if (this.options.ecmaVersion >= 6)\n node.generator = isGenerator\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0))\n\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n this.parseFunctionBody(node, false)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.finishNode(node, \"FunctionExpression\")\n}\n\n// Parse arrow function expression with given parameters.\n\npp.parseArrowExpression = function(node, params, isAsync) {\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW)\n this.initFunction(node)\n if (this.options.ecmaVersion >= 8) node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n\n node.params = this.toAssignableList(params, true)\n this.parseFunctionBody(node, true)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.finishNode(node, \"ArrowFunctionExpression\")\n}\n\n// Parse function body and check parameters.\n\npp.parseFunctionBody = function(node, isArrowFunction) {\n let isExpression = isArrowFunction && this.type !== tt.braceL\n let oldStrict = this.strict, useStrict = false\n\n if (isExpression) {\n node.body = this.parseMaybeAssign()\n node.expression = true\n this.checkParams(node, false)\n } else {\n let nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params)\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end)\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\")\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n let oldLabels = this.labels\n this.labels = []\n if (useStrict) this.strict = true\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && this.isSimpleParamList(node.params))\n node.body = this.parseBlock(false)\n node.expression = false\n this.adaptDirectivePrologue(node.body.body)\n this.labels = oldLabels\n }\n this.exitScope()\n\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) this.checkLVal(node.id, BIND_OUTSIDE)\n this.strict = oldStrict\n}\n\npp.isSimpleParamList = function(params) {\n for (let param of params)\n if (param.type !== \"Identifier\") return false\n return true\n}\n\n// Checks function params for various disallowed patterns such as using \"eval\"\n// or \"arguments\" and duplicate parameters.\n\npp.checkParams = function(node, allowDuplicates) {\n let nameHash = {}\n for (let param of node.params)\n this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash)\n}\n\n// Parses a comma-separated list of expressions, and returns them as\n// an array. `close` is the token type that ends the list, and\n// `allowEmpty` can be turned on to allow subsequent commas with\n// nothing in between them to be parsed as `null` (which is needed\n// for array literals).\n\npp.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (!first) {\n this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(close)) break\n } else first = false\n\n let elt\n if (allowEmpty && this.type === tt.comma)\n elt = null\n else if (this.type === tt.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors)\n if (refDestructuringErrors && this.type === tt.comma && refDestructuringErrors.trailingComma < 0)\n refDestructuringErrors.trailingComma = this.start\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors)\n }\n elts.push(elt)\n }\n return elts\n}\n\npp.checkUnreserved = function({start, end, name}) {\n if (this.inGenerator && name === \"yield\")\n this.raiseRecoverable(start, \"Can not use 'yield' as identifier inside a generator\")\n if (this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Can not use 'await' as identifier inside an async function\")\n if (this.keywords.test(name))\n this.raise(start, `Unexpected keyword '${name}'`)\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) return\n const re = this.strict ? this.reservedWordsStrict : this.reservedWords\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Can not use keyword 'await' outside an async function\")\n this.raiseRecoverable(start, `The keyword '${name}' is reserved`)\n }\n}\n\n// Parse the next token as an identifier. If `liberal` is true (used\n// when parsing properties), it will also convert keywords into\n// identifiers.\n\npp.parseIdent = function(liberal, isBinding) {\n let node = this.startNode()\n if (liberal && this.options.allowReserved === \"never\") liberal = false\n if (this.type === tt.name) {\n node.name = this.value\n } else if (this.type.keyword) {\n node.name = this.type.keyword\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop()\n }\n } else {\n this.unexpected()\n }\n this.next()\n this.finishNode(node, \"Identifier\")\n if (!liberal) this.checkUnreserved(node)\n return node\n}\n\n// Parses yield expression inside generator.\n\npp.parseYield = function() {\n if (!this.yieldPos) this.yieldPos = this.start\n\n let node = this.startNode()\n this.next()\n if (this.type === tt.semi || this.canInsertSemicolon() || (this.type !== tt.star && !this.type.startsExpr)) {\n node.delegate = false\n node.argument = null\n } else {\n node.delegate = this.eat(tt.star)\n node.argument = this.parseMaybeAssign()\n }\n return this.finishNode(node, \"YieldExpression\")\n}\n\npp.parseAwait = function() {\n if (!this.awaitPos) this.awaitPos = this.start\n\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n return this.finishNode(node, \"AwaitExpression\")\n}\n","import {Parser} from \"./state\"\nimport {Position, getLineInfo} from \"./locutil\"\n\nconst pp = Parser.prototype\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\npp.raise = function(pos, message) {\n let loc = getLineInfo(this.input, pos)\n message += \" (\" + loc.line + \":\" + loc.column + \")\"\n let err = new SyntaxError(message)\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos\n throw err\n}\n\npp.raiseRecoverable = pp.raise\n\npp.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n}\n","import {Parser} from \"./state\"\nimport {SCOPE_VAR, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, BIND_LEXICAL, BIND_SIMPLE_CATCH, BIND_FUNCTION} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\nclass Scope {\n constructor(flags) {\n this.flags = flags\n // A list of var-declared names in the current lexical scope\n this.var = []\n // A list of lexically-declared names in the current lexical scope\n this.lexical = []\n }\n}\n\n// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\npp.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags))\n}\n\npp.exitScope = function() {\n this.scopeStack.pop()\n}\n\npp.declareName = function(name, bindingType, pos) {\n let redeclared = false\n if (bindingType === BIND_LEXICAL) {\n const scope = this.currentScope()\n redeclared = scope.lexical.indexOf(name) > -1 || scope.var.indexOf(name) > -1\n scope.lexical.push(name)\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n const scope = this.currentScope()\n scope.lexical.push(name)\n } else if (bindingType === BIND_FUNCTION) {\n const scope = this.currentScope()\n redeclared = scope.lexical.indexOf(name) > -1\n scope.var.push(name)\n } else {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n const scope = this.scopeStack[i]\n if (scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH) && scope.lexical[0] === name) redeclared = true\n scope.var.push(name)\n if (scope.flags & SCOPE_VAR) break\n }\n }\n if (redeclared) this.raiseRecoverable(pos, `Identifier '${name}' has already been declared`)\n}\n\npp.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n}\n\npp.currentVarScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR) return scope\n }\n}\n\n// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\npp.currentThisScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) return scope\n }\n}\n","import {Parser} from \"./state\"\nimport {SourceLocation} from \"./locutil\"\n\nexport class Node {\n constructor(parser, pos, loc) {\n this.type = \"\"\n this.start = pos\n this.end = 0\n if (parser.options.locations)\n this.loc = new SourceLocation(parser, loc)\n if (parser.options.directSourceFile)\n this.sourceFile = parser.options.directSourceFile\n if (parser.options.ranges)\n this.range = [pos, 0]\n }\n}\n\n// Start an AST node, attaching a start offset.\n\nconst pp = Parser.prototype\n\npp.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n}\n\npp.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n}\n\n// Finish an AST node, adding `type` and `end` properties.\n\nfunction finishNodeAt(node, type, pos, loc) {\n node.type = type\n node.end = pos\n if (this.options.locations)\n node.loc.end = loc\n if (this.options.ranges)\n node.range[1] = pos\n return node\n}\n\npp.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n}\n\n// Finish node at given position\n\npp.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n}\n","// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\nimport {Parser} from \"./state\"\nimport {types as tt} from \"./tokentype\"\nimport {lineBreak} from \"./whitespace\"\n\nexport class TokContext {\n constructor(token, isExpr, preserveSpace, override, generator) {\n this.token = token\n this.isExpr = !!isExpr\n this.preserveSpace = !!preserveSpace\n this.override = override\n this.generator = !!generator\n }\n}\n\nexport const types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, p => p.tryReadTemplateToken()),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n}\n\nconst pp = Parser.prototype\n\npp.initialContext = function() {\n return [types.b_stat]\n}\n\npp.braceIsBlock = function(prevType) {\n let parent = this.curContext()\n if (parent === types.f_expr || parent === types.f_stat)\n return true\n if (prevType === tt.colon && (parent === types.b_stat || parent === types.b_expr))\n return !parent.isExpr\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === tt._return || prevType === tt.name && this.exprAllowed)\n return lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR || prevType === tt.arrow)\n return true\n if (prevType === tt.braceL)\n return parent === types.b_stat\n if (prevType === tt._var || prevType === tt._const || prevType === tt.name)\n return false\n return !this.exprAllowed\n}\n\npp.inGeneratorContext = function() {\n for (let i = this.context.length - 1; i >= 1; i--) {\n let context = this.context[i]\n if (context.token === \"function\")\n return context.generator\n }\n return false\n}\n\npp.updateContext = function(prevType) {\n let update, type = this.type\n if (type.keyword && prevType === tt.dot)\n this.exprAllowed = false\n else if (update = type.updateContext)\n update.call(this, prevType)\n else\n this.exprAllowed = type.beforeExpr\n}\n\n// Token-specific context update code\n\ntt.parenR.updateContext = tt.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true\n return\n }\n let out = this.context.pop()\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop()\n }\n this.exprAllowed = !out.isExpr\n}\n\ntt.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr)\n this.exprAllowed = true\n}\n\ntt.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl)\n this.exprAllowed = true\n}\n\ntt.parenL.updateContext = function(prevType) {\n let statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while\n this.context.push(statementParens ? types.p_stat : types.p_expr)\n this.exprAllowed = true\n}\n\ntt.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n}\n\ntt._function.updateContext = tt._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== tt.semi && prevType !== tt._else &&\n !(prevType === tt._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === tt.colon || prevType === tt.braceL) && this.curContext() === types.b_stat))\n this.context.push(types.f_expr)\n else\n this.context.push(types.f_stat)\n this.exprAllowed = false\n}\n\ntt.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n this.context.pop()\n else\n this.context.push(types.q_tmpl)\n this.exprAllowed = false\n}\n\ntt.star.updateContext = function(prevType) {\n if (prevType === tt._function) {\n let index = this.context.length - 1\n if (this.context[index] === types.f_expr)\n this.context[index] = types.f_expr_gen\n else\n this.context[index] = types.f_gen\n }\n this.exprAllowed = true\n}\n\ntt.name.updateContext = function(prevType) {\n let allowed = false\n if (this.options.ecmaVersion >= 6 && prevType !== tt.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n allowed = true\n }\n this.exprAllowed = allowed\n}\n","const data = {\n \"$LONE\": [\n \"ASCII\",\n \"ASCII_Hex_Digit\",\n \"AHex\",\n \"Alphabetic\",\n \"Alpha\",\n \"Any\",\n \"Assigned\",\n \"Bidi_Control\",\n \"Bidi_C\",\n \"Bidi_Mirrored\",\n \"Bidi_M\",\n \"Case_Ignorable\",\n \"CI\",\n \"Cased\",\n \"Changes_When_Casefolded\",\n \"CWCF\",\n \"Changes_When_Casemapped\",\n \"CWCM\",\n \"Changes_When_Lowercased\",\n \"CWL\",\n \"Changes_When_NFKC_Casefolded\",\n \"CWKCF\",\n \"Changes_When_Titlecased\",\n \"CWT\",\n \"Changes_When_Uppercased\",\n \"CWU\",\n \"Dash\",\n \"Default_Ignorable_Code_Point\",\n \"DI\",\n \"Deprecated\",\n \"Dep\",\n \"Diacritic\",\n \"Dia\",\n \"Emoji\",\n \"Emoji_Component\",\n \"Emoji_Modifier\",\n \"Emoji_Modifier_Base\",\n \"Emoji_Presentation\",\n \"Extender\",\n \"Ext\",\n \"Grapheme_Base\",\n \"Gr_Base\",\n \"Grapheme_Extend\",\n \"Gr_Ext\",\n \"Hex_Digit\",\n \"Hex\",\n \"IDS_Binary_Operator\",\n \"IDSB\",\n \"IDS_Trinary_Operator\",\n \"IDST\",\n \"ID_Continue\",\n \"IDC\",\n \"ID_Start\",\n \"IDS\",\n \"Ideographic\",\n \"Ideo\",\n \"Join_Control\",\n \"Join_C\",\n \"Logical_Order_Exception\",\n \"LOE\",\n \"Lowercase\",\n \"Lower\",\n \"Math\",\n \"Noncharacter_Code_Point\",\n \"NChar\",\n \"Pattern_Syntax\",\n \"Pat_Syn\",\n \"Pattern_White_Space\",\n \"Pat_WS\",\n \"Quotation_Mark\",\n \"QMark\",\n \"Radical\",\n \"Regional_Indicator\",\n \"RI\",\n \"Sentence_Terminal\",\n \"STerm\",\n \"Soft_Dotted\",\n \"SD\",\n \"Terminal_Punctuation\",\n \"Term\",\n \"Unified_Ideograph\",\n \"UIdeo\",\n \"Uppercase\",\n \"Upper\",\n \"Variation_Selector\",\n \"VS\",\n \"White_Space\",\n \"space\",\n \"XID_Continue\",\n \"XIDC\",\n \"XID_Start\",\n \"XIDS\"\n ],\n \"General_Category\": [\n \"Cased_Letter\",\n \"LC\",\n \"Close_Punctuation\",\n \"Pe\",\n \"Connector_Punctuation\",\n \"Pc\",\n \"Control\",\n \"Cc\",\n \"cntrl\",\n \"Currency_Symbol\",\n \"Sc\",\n \"Dash_Punctuation\",\n \"Pd\",\n \"Decimal_Number\",\n \"Nd\",\n \"digit\",\n \"Enclosing_Mark\",\n \"Me\",\n \"Final_Punctuation\",\n \"Pf\",\n \"Format\",\n \"Cf\",\n \"Initial_Punctuation\",\n \"Pi\",\n \"Letter\",\n \"L\",\n \"Letter_Number\",\n \"Nl\",\n \"Line_Separator\",\n \"Zl\",\n \"Lowercase_Letter\",\n \"Ll\",\n \"Mark\",\n \"M\",\n \"Combining_Mark\",\n \"Math_Symbol\",\n \"Sm\",\n \"Modifier_Letter\",\n \"Lm\",\n \"Modifier_Symbol\",\n \"Sk\",\n \"Nonspacing_Mark\",\n \"Mn\",\n \"Number\",\n \"N\",\n \"Open_Punctuation\",\n \"Ps\",\n \"Other\",\n \"C\",\n \"Other_Letter\",\n \"Lo\",\n \"Other_Number\",\n \"No\",\n \"Other_Punctuation\",\n \"Po\",\n \"Other_Symbol\",\n \"So\",\n \"Paragraph_Separator\",\n \"Zp\",\n \"Private_Use\",\n \"Co\",\n \"Punctuation\",\n \"P\",\n \"punct\",\n \"Separator\",\n \"Z\",\n \"Space_Separator\",\n \"Zs\",\n \"Spacing_Mark\",\n \"Mc\",\n \"Surrogate\",\n \"Cs\",\n \"Symbol\",\n \"S\",\n \"Titlecase_Letter\",\n \"Lt\",\n \"Unassigned\",\n \"Cn\",\n \"Uppercase_Letter\",\n \"Lu\"\n ],\n \"Script\": [\n \"Adlam\",\n \"Adlm\",\n \"Ahom\",\n \"Anatolian_Hieroglyphs\",\n \"Hluw\",\n \"Arabic\",\n \"Arab\",\n \"Armenian\",\n \"Armn\",\n \"Avestan\",\n \"Avst\",\n \"Balinese\",\n \"Bali\",\n \"Bamum\",\n \"Bamu\",\n \"Bassa_Vah\",\n \"Bass\",\n \"Batak\",\n \"Batk\",\n \"Bengali\",\n \"Beng\",\n \"Bhaiksuki\",\n \"Bhks\",\n \"Bopomofo\",\n \"Bopo\",\n \"Brahmi\",\n \"Brah\",\n \"Braille\",\n \"Brai\",\n \"Buginese\",\n \"Bugi\",\n \"Buhid\",\n \"Buhd\",\n \"Canadian_Aboriginal\",\n \"Cans\",\n \"Carian\",\n \"Cari\",\n \"Caucasian_Albanian\",\n \"Aghb\",\n \"Chakma\",\n \"Cakm\",\n \"Cham\",\n \"Cherokee\",\n \"Cher\",\n \"Common\",\n \"Zyyy\",\n \"Coptic\",\n \"Copt\",\n \"Qaac\",\n \"Cuneiform\",\n \"Xsux\",\n \"Cypriot\",\n \"Cprt\",\n \"Cyrillic\",\n \"Cyrl\",\n \"Deseret\",\n \"Dsrt\",\n \"Devanagari\",\n \"Deva\",\n \"Duployan\",\n \"Dupl\",\n \"Egyptian_Hieroglyphs\",\n \"Egyp\",\n \"Elbasan\",\n \"Elba\",\n \"Ethiopic\",\n \"Ethi\",\n \"Georgian\",\n \"Geor\",\n \"Glagolitic\",\n \"Glag\",\n \"Gothic\",\n \"Goth\",\n \"Grantha\",\n \"Gran\",\n \"Greek\",\n \"Grek\",\n \"Gujarati\",\n \"Gujr\",\n \"Gurmukhi\",\n \"Guru\",\n \"Han\",\n \"Hani\",\n \"Hangul\",\n \"Hang\",\n \"Hanunoo\",\n \"Hano\",\n \"Hatran\",\n \"Hatr\",\n \"Hebrew\",\n \"Hebr\",\n \"Hiragana\",\n \"Hira\",\n \"Imperial_Aramaic\",\n \"Armi\",\n \"Inherited\",\n \"Zinh\",\n \"Qaai\",\n \"Inscriptional_Pahlavi\",\n \"Phli\",\n \"Inscriptional_Parthian\",\n \"Prti\",\n \"Javanese\",\n \"Java\",\n \"Kaithi\",\n \"Kthi\",\n \"Kannada\",\n \"Knda\",\n \"Katakana\",\n \"Kana\",\n \"Kayah_Li\",\n \"Kali\",\n \"Kharoshthi\",\n \"Khar\",\n \"Khmer\",\n \"Khmr\",\n \"Khojki\",\n \"Khoj\",\n \"Khudawadi\",\n \"Sind\",\n \"Lao\",\n \"Laoo\",\n \"Latin\",\n \"Latn\",\n \"Lepcha\",\n \"Lepc\",\n \"Limbu\",\n \"Limb\",\n \"Linear_A\",\n \"Lina\",\n \"Linear_B\",\n \"Linb\",\n \"Lisu\",\n \"Lycian\",\n \"Lyci\",\n \"Lydian\",\n \"Lydi\",\n \"Mahajani\",\n \"Mahj\",\n \"Malayalam\",\n \"Mlym\",\n \"Mandaic\",\n \"Mand\",\n \"Manichaean\",\n \"Mani\",\n \"Marchen\",\n \"Marc\",\n \"Masaram_Gondi\",\n \"Gonm\",\n \"Meetei_Mayek\",\n \"Mtei\",\n \"Mende_Kikakui\",\n \"Mend\",\n \"Meroitic_Cursive\",\n \"Merc\",\n \"Meroitic_Hieroglyphs\",\n \"Mero\",\n \"Miao\",\n \"Plrd\",\n \"Modi\",\n \"Mongolian\",\n \"Mong\",\n \"Mro\",\n \"Mroo\",\n \"Multani\",\n \"Mult\",\n \"Myanmar\",\n \"Mymr\",\n \"Nabataean\",\n \"Nbat\",\n \"New_Tai_Lue\",\n \"Talu\",\n \"Newa\",\n \"Nko\",\n \"Nkoo\",\n \"Nushu\",\n \"Nshu\",\n \"Ogham\",\n \"Ogam\",\n \"Ol_Chiki\",\n \"Olck\",\n \"Old_Hungarian\",\n \"Hung\",\n \"Old_Italic\",\n \"Ital\",\n \"Old_North_Arabian\",\n \"Narb\",\n \"Old_Permic\",\n \"Perm\",\n \"Old_Persian\",\n \"Xpeo\",\n \"Old_South_Arabian\",\n \"Sarb\",\n \"Old_Turkic\",\n \"Orkh\",\n \"Oriya\",\n \"Orya\",\n \"Osage\",\n \"Osge\",\n \"Osmanya\",\n \"Osma\",\n \"Pahawh_Hmong\",\n \"Hmng\",\n \"Palmyrene\",\n \"Palm\",\n \"Pau_Cin_Hau\",\n \"Pauc\",\n \"Phags_Pa\",\n \"Phag\",\n \"Phoenician\",\n \"Phnx\",\n \"Psalter_Pahlavi\",\n \"Phlp\",\n \"Rejang\",\n \"Rjng\",\n \"Runic\",\n \"Runr\",\n \"Samaritan\",\n \"Samr\",\n \"Saurashtra\",\n \"Saur\",\n \"Sharada\",\n \"Shrd\",\n \"Shavian\",\n \"Shaw\",\n \"Siddham\",\n \"Sidd\",\n \"SignWriting\",\n \"Sgnw\",\n \"Sinhala\",\n \"Sinh\",\n \"Sora_Sompeng\",\n \"Sora\",\n \"Soyombo\",\n \"Soyo\",\n \"Sundanese\",\n \"Sund\",\n \"Syloti_Nagri\",\n \"Sylo\",\n \"Syriac\",\n \"Syrc\",\n \"Tagalog\",\n \"Tglg\",\n \"Tagbanwa\",\n \"Tagb\",\n \"Tai_Le\",\n \"Tale\",\n \"Tai_Tham\",\n \"Lana\",\n \"Tai_Viet\",\n \"Tavt\",\n \"Takri\",\n \"Takr\",\n \"Tamil\",\n \"Taml\",\n \"Tangut\",\n \"Tang\",\n \"Telugu\",\n \"Telu\",\n \"Thaana\",\n \"Thaa\",\n \"Thai\",\n \"Tibetan\",\n \"Tibt\",\n \"Tifinagh\",\n \"Tfng\",\n \"Tirhuta\",\n \"Tirh\",\n \"Ugaritic\",\n \"Ugar\",\n \"Vai\",\n \"Vaii\",\n \"Warang_Citi\",\n \"Wara\",\n \"Yi\",\n \"Yiii\",\n \"Zanabazar_Square\",\n \"Zanb\"\n ]\n}\nArray.prototype.push.apply(data.$LONE, data.General_Category)\ndata.gc = data.General_Category\ndata.sc = data.Script_Extensions = data.scx = data.Script\n\nexport default data\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier.js\"\nimport {Parser} from \"./state.js\"\nimport UNICODE_PROPERTY_VALUES from \"./unicode-property-data.js\"\n\nconst pp = Parser.prototype\n\nexport class RegExpValidationState {\n constructor(parser) {\n this.parser = parser\n this.validFlags = `gim${parser.options.ecmaVersion >= 6 ? \"uy\" : \"\"}${parser.options.ecmaVersion >= 9 ? \"s\" : \"\"}`\n this.source = \"\"\n this.flags = \"\"\n this.start = 0\n this.switchU = false\n this.switchN = false\n this.pos = 0\n this.lastIntValue = 0\n this.lastStringValue = \"\"\n this.lastAssertionIsQuantifiable = false\n this.numCapturingParens = 0\n this.maxBackReference = 0\n this.groupNames = []\n this.backReferenceNames = []\n }\n\n reset(start, pattern, flags) {\n const unicode = flags.indexOf(\"u\") !== -1\n this.start = start | 0\n this.source = pattern + \"\"\n this.flags = flags\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9\n }\n\n raise(message) {\n this.parser.raiseRecoverable(this.start, `Invalid regular expression: /${this.source}/: ${message}`)\n }\n\n // If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\n at(i) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return -1\n }\n const c = s.charCodeAt(i)\n if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00\n }\n\n nextIndex(i) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return l\n }\n const c = s.charCodeAt(i)\n if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return i + 1\n }\n return i + 2\n }\n\n current() {\n return this.at(this.pos)\n }\n\n lookahead() {\n return this.at(this.nextIndex(this.pos))\n }\n\n advance() {\n this.pos = this.nextIndex(this.pos)\n }\n\n eat(ch) {\n if (this.current() === ch) {\n this.advance()\n return true\n }\n return false\n }\n}\n\nfunction codePointToString(ch) {\n if (ch <= 0xFFFF) return String.fromCharCode(ch)\n ch -= 0x10000\n return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)\n}\n\n/**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpFlags = function(state) {\n const validFlags = state.validFlags\n const flags = state.flags\n\n for (let i = 0; i < flags.length; i++) {\n const flag = flags.charAt(i)\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\")\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\")\n }\n }\n}\n\n/**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpPattern = function(state) {\n this.regexp_pattern(state)\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // 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 if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n state.switchN = true\n this.regexp_pattern(state)\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\npp.regexp_pattern = function(state) {\n state.pos = 0\n state.lastIntValue = 0\n state.lastStringValue = \"\"\n state.lastAssertionIsQuantifiable = false\n state.numCapturingParens = 0\n state.maxBackReference = 0\n state.groupNames.length = 0\n state.backReferenceNames.length = 0\n\n this.regexp_disjunction(state)\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\")\n }\n if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\")\n }\n for (const name of state.backReferenceNames) {\n if (state.groupNames.indexOf(name) === -1) {\n state.raise(\"Invalid named capture referenced\")\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\npp.regexp_disjunction = function(state) {\n this.regexp_alternative(state)\n while (state.eat(0x7C /* | */)) {\n this.regexp_alternative(state)\n }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\npp.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state))\n ;\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\npp.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\")\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state)\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\npp.regexp_eatAssertion = function(state) {\n const start = state.pos\n state.lastAssertionIsQuantifiable = false\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n let lookbehind = false\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */)\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state)\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\")\n }\n state.lastAssertionIsQuantifiable = !lookbehind\n return true\n }\n }\n\n state.pos = start\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\npp.regexp_eatQuantifier = function(state, noError = false) {\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\npp.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n}\npp.regexp_eatBracedQuantifier = function(state, noError) {\n const start = state.pos\n if (state.eat(0x7B /* { */)) {\n let min = 0, max = -1\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\")\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\npp.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n}\npp.regexp_eatReverseSolidusAtomEscape = function(state) {\n const start = state.pos\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatUncapturingGroup = function(state) {\n const start = state.pos\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\")\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state)\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\")\n }\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1\n return true\n }\n state.raise(\"Unterminated group\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\npp.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\npp.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\npp.regexp_eatSyntaxCharacter = function(state) {\n const ch = state.current()\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n return false\n}\nfunction isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n// But eat eager.\npp.regexp_eatPatternCharacters = function(state) {\n const start = state.pos\n let ch = 0\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance()\n }\n return state.pos !== start\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\npp.regexp_eatExtendedPatternCharacter = function(state) {\n const ch = state.current()\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance()\n return true\n }\n return false\n}\n\n// GroupSpecifier[U] ::\n// [empty]\n// `?` GroupName[?U]\npp.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (this.regexp_eatGroupName(state)) {\n if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n state.raise(\"Duplicate capture group name\")\n }\n state.groupNames.push(state.lastStringValue)\n return\n }\n state.raise(\"Invalid group\")\n }\n}\n\n// GroupName[U] ::\n// `<` RegExpIdentifierName[?U] `>`\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\"\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\")\n }\n return false\n}\n\n// RegExpIdentifierName[U] ::\n// RegExpIdentifierStart[?U]\n// RegExpIdentifierName[?U] RegExpIdentifierPart[?U]\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\"\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n }\n return true\n }\n return false\n}\n\n// RegExpIdentifierStart[U] ::\n// UnicodeIDStart\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[?U]\npp.regexp_eatRegExpIdentifierStart = function(state) {\n const start = state.pos\n let ch = state.current()\n state.advance()\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n}\n\n// RegExpIdentifierPart[U] ::\n// UnicodeIDContinue\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[?U]\n// \n// \npp.regexp_eatRegExpIdentifierPart = function(state) {\n const start = state.pos\n let ch = state.current()\n state.advance()\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\npp.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\")\n }\n state.raise(\"Invalid escape\")\n }\n return false\n}\npp.regexp_eatBackReference = function(state) {\n const start = state.pos\n if (this.regexp_eatDecimalEscape(state)) {\n const n = state.lastIntValue\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue)\n return true\n }\n state.raise(\"Invalid named reference\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\npp.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n}\npp.regexp_eatCControlLetter = function(state) {\n const start = state.pos\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\npp.regexp_eatControlEscape = function(state) {\n const ch = state.current()\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09 /* \\t */\n state.advance()\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A /* \\n */\n state.advance()\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B /* \\v */\n state.advance()\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C /* \\f */\n state.advance()\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D /* \\r */\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\npp.regexp_eatControlLetter = function(state) {\n const ch = state.current()\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\nfunction isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\npp.regexp_eatRegExpUnicodeEscapeSequence = function(state) {\n const start = state.pos\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n const lead = state.lastIntValue\n if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n const leadSurrogateEnd = state.pos\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n const trail = state.lastIntValue\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000\n return true\n }\n }\n state.pos = leadSurrogateEnd\n state.lastIntValue = lead\n }\n return true\n }\n if (\n state.switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid unicode escape\")\n }\n state.pos = start\n }\n\n return false\n}\nfunction isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\npp.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F /* / */\n return true\n }\n return false\n }\n\n const ch = state.current()\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\npp.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0\n let ch = state.current()\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\npp.regexp_eatCharacterClassEscape = function(state) {\n const ch = state.current()\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1\n state.advance()\n return true\n }\n\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n (ch === 0x50 /* P */ || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1\n state.advance()\n if (\n state.eat(0x7B /* { */) &&\n this.regexp_eatUnicodePropertyValueExpression(state) &&\n state.eat(0x7D /* } */)\n ) {\n return true\n }\n state.raise(\"Invalid property name\")\n }\n\n return false\n}\nfunction isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n}\n\n// UnicodePropertyValueExpression ::\n// UnicodePropertyName `=` UnicodePropertyValue\n// LoneUnicodePropertyNameOrValue\npp.regexp_eatUnicodePropertyValueExpression = function(state) {\n const start = state.pos\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n const name = state.lastStringValue\n if (this.regexp_eatUnicodePropertyValue(state)) {\n const value = state.lastStringValue\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value)\n return true\n }\n }\n state.pos = start\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n const nameOrValue = state.lastStringValue\n this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)\n return true\n }\n return false\n}\npp.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!UNICODE_PROPERTY_VALUES.hasOwnProperty(name) || UNICODE_PROPERTY_VALUES[name].indexOf(value) === -1) {\n state.raise(\"Invalid property name\")\n }\n}\npp.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (UNICODE_PROPERTY_VALUES.$LONE.indexOf(nameOrValue) === -1) {\n state.raise(\"Invalid property name\")\n }\n}\n\n// UnicodePropertyName ::\n// UnicodePropertyNameCharacters\npp.regexp_eatUnicodePropertyName = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n}\n\n// UnicodePropertyValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatUnicodePropertyValue = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n}\n\n// LoneUnicodePropertyNameOrValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\npp.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n state.eat(0x5E /* ^ */)\n this.regexp_classRanges(state)\n if (state.eat(0x5D /* [ */)) {\n return true\n }\n // Unreachable since it threw \"unterminated regular expression\" error before.\n state.raise(\"Unterminated character class\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\npp.regexp_classRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n const left = state.lastIntValue\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n const right = state.lastIntValue\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\")\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\")\n }\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\npp.regexp_eatClassAtom = function(state) {\n const start = state.pos\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n const ch = state.current()\n if (ch === 0x63 /* c */ || isOctalDigit(ch)) {\n state.raise(\"Invalid class escape\")\n }\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n\n const ch = state.current()\n if (ch !== 0x5D /* [ */) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\npp.regexp_eatClassEscape = function(state) {\n const start = state.pos\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08 /* */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\npp.regexp_eatClassControlLetter = function(state) {\n const ch = state.current()\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatHexEscapeSequence = function(state) {\n const start = state.pos\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\npp.regexp_eatDecimalDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\npp.regexp_eatHexDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n}\nfunction hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n// Allows only 0-377(octal) i.e. 0-255(decimal).\npp.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n const n1 = state.lastIntValue\n if (this.regexp_eatOctalDigit(state)) {\n const n2 = state.lastIntValue\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue\n } else {\n state.lastIntValue = n1 * 8 + n2\n }\n } else {\n state.lastIntValue = n1\n }\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\npp.regexp_eatOctalDigit = function(state) {\n const ch = state.current()\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30 /* 0 */\n state.advance()\n return true\n }\n state.lastIntValue = 0\n return false\n}\nfunction isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatFixedHexDigits = function(state, length) {\n const start = state.pos\n state.lastIntValue = 0\n for (let i = 0; i < length; ++i) {\n const ch = state.current()\n if (!isHexDigit(ch)) {\n state.pos = start\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return true\n}\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier\"\nimport {types as tt, keywords as keywordTypes} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {SourceLocation} from \"./locutil\"\nimport {RegExpValidationState} from \"./regexp\"\nimport {lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace} from \"./whitespace\"\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(p) {\n this.type = p.type\n this.value = p.value\n this.start = p.start\n this.end = p.end\n if (p.options.locations)\n this.loc = new SourceLocation(p, p.startLoc, p.endLoc)\n if (p.options.ranges)\n this.range = [p.start, p.end]\n }\n}\n\n// ## Tokenizer\n\nconst pp = Parser.prototype\n\n// Move to the next token\n\npp.next = function() {\n if (this.options.onToken)\n this.options.onToken(new Token(this))\n\n this.lastTokEnd = this.end\n this.lastTokStart = this.start\n this.lastTokEndLoc = this.endLoc\n this.lastTokStartLoc = this.startLoc\n this.nextToken()\n}\n\npp.getToken = function() {\n this.next()\n return new Token(this)\n}\n\n// If we're in an ES6 environment, make parsers iterable\nif (typeof Symbol !== \"undefined\")\n pp[Symbol.iterator] = function() {\n return {\n next: () => {\n let token = this.getToken()\n return {\n done: token.type === tt.eof,\n value: token\n }\n }\n }\n }\n\n// Toggle strict mode. Re-reads the next number or string to please\n// pedantic tests (`\"use strict\"; 010;` should fail).\n\npp.curContext = function() {\n return this.context[this.context.length - 1]\n}\n\n// Read a single token, updating the parser object's token-related\n// properties.\n\npp.nextToken = function() {\n let curContext = this.curContext()\n if (!curContext || !curContext.preserveSpace) this.skipSpace()\n\n this.start = this.pos\n if (this.options.locations) this.startLoc = this.curPosition()\n if (this.pos >= this.input.length) return this.finishToken(tt.eof)\n\n if (curContext.override) return curContext.override(this)\n else this.readToken(this.fullCharCodeAtPos())\n}\n\npp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n return this.readWord()\n\n return this.getTokenFromCode(code)\n}\n\npp.fullCharCodeAtPos = function() {\n let code = this.input.charCodeAt(this.pos)\n if (code <= 0xd7ff || code >= 0xe000) return code\n let next = this.input.charCodeAt(this.pos + 1)\n return (code << 10) + next - 0x35fdc00\n}\n\npp.skipBlockComment = function() {\n let startLoc = this.options.onComment && this.curPosition()\n let start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2)\n if (end === -1) this.raise(this.pos - 2, \"Unterminated comment\")\n this.pos = end + 2\n if (this.options.locations) {\n lineBreakG.lastIndex = start\n let match\n while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {\n ++this.curLine\n this.lineStart = match.index + match[0].length\n }\n }\n if (this.options.onComment)\n this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition())\n}\n\npp.skipLineComment = function(startSkip) {\n let start = this.pos\n let startLoc = this.options.onComment && this.curPosition()\n let ch = this.input.charCodeAt(this.pos += startSkip)\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos)\n }\n if (this.options.onComment)\n this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition())\n}\n\n// Called at the start of the parse and after every token. Skips\n// whitespace and comments, and.\n\npp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n let ch = this.input.charCodeAt(this.pos)\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos\n }\n case 10: case 8232: case 8233:\n ++this.pos\n if (this.options.locations) {\n ++this.curLine\n this.lineStart = this.pos\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment()\n break\n case 47:\n this.skipLineComment(2)\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos\n } else {\n break loop\n }\n }\n }\n}\n\n// Called at the end of every token. Sets `end`, `val`, and\n// maintains `context` and `exprAllowed`, and skips the space after\n// the token, so that the next one's `start` will point at the\n// right position.\n\npp.finishToken = function(type, val) {\n this.end = this.pos\n if (this.options.locations) this.endLoc = this.curPosition()\n let prevType = this.type\n this.type = type\n this.value = val\n\n this.updateContext(prevType)\n}\n\n// ### Token reading\n\n// This is the function that is called to fetch the next token. It\n// is somewhat obscure, because it works in character codes rather\n// than characters, and because operator parsing has been inlined\n// into it.\n//\n// All in the name of speed.\n//\npp.readToken_dot = function() {\n let next = this.input.charCodeAt(this.pos + 1)\n if (next >= 48 && next <= 57) return this.readNumber(true)\n let next2 = this.input.charCodeAt(this.pos + 2)\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3\n return this.finishToken(tt.ellipsis)\n } else {\n ++this.pos\n return this.finishToken(tt.dot)\n }\n}\n\npp.readToken_slash = function() { // '/'\n let next = this.input.charCodeAt(this.pos + 1)\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.slash, 1)\n}\n\npp.readToken_mult_modulo_exp = function(code) { // '%*'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n let tokentype = code === 42 ? tt.star : tt.modulo\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size\n tokentype = tt.starstar\n next = this.input.charCodeAt(this.pos + 2)\n }\n\n if (next === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tokentype, size)\n}\n\npp.readToken_pipe_amp = function(code) { // '|&'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2)\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1)\n}\n\npp.readToken_caret = function() { // '^'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.bitwiseXOR, 1)\n}\n\npp.readToken_plus_min = function(code) { // '+-'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types.incDec, 2) - } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) -}; - -pp$8.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` x ? y : false - if (self.left.operator == "||") { - var lr = self.left.right.evaluate(compressor); - if (!lr) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.right, - alternative: self.left.right - }).optimize(compressor); - } - break; - case "||": - var ll = self.left.truthy ? true : self.left.falsy ? false : self.left.evaluate(compressor); - if (!ll) { - compressor.warn("Condition left of || always false [{file}:{line},{col}]", self.start); - return make_sequence(self, [ self.left, self.right ]).optimize(compressor); - } else if (!(ll instanceof AST_Node)) { - compressor.warn("Condition left of || always true [{file}:{line},{col}]", self.start); - return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor); - } - var rr = self.right.evaluate(compressor); - if (!rr) { - var parent = compressor.parent(); - if (parent.operator == "||" && parent.left === compressor.self() || compressor.in_boolean_context()) { - compressor.warn("Dropping side-effect-free || [{file}:{line},{col}]", self.start); - return self.left.optimize(compressor); - } - } else if (!(rr instanceof AST_Node)) { - if (compressor.in_boolean_context()) { - compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start); - return make_sequence(self, [ - self.left, - make_node(AST_True, self) - ]).optimize(compressor); - } else self.truthy = true; - } - if (self.left.operator == "&&") { - var lr = self.left.right.evaluate(compressor); - if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.left.right, - alternative: self.right - }).optimize(compressor); - } - break; - } - var associative = true; - switch (self.operator) { - case "+": - // "foo" + ("bar" + x) => "foobar" + x - if (self.left instanceof AST_Constant - && self.right instanceof AST_Binary - && self.right.operator == "+" - && self.right.left instanceof AST_Constant - && self.right.is_string(compressor)) { - self = make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self.left, { - value: "" + self.left.getValue() + self.right.left.getValue(), - start: self.left.start, - end: self.right.left.end - }), - right: self.right.right - }); - } - // (x + "foo") + "bar" => x + "foobar" - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.right instanceof AST_Constant - && self.left.is_string(compressor)) { - self = make_node(AST_Binary, self, { - operator: "+", - left: self.left.left, - right: make_node(AST_String, self.right, { - value: "" + self.left.right.getValue() + self.right.getValue(), - start: self.left.right.start, - end: self.right.end - }) - }); - } - // (x + "foo") + ("bar" + y) => (x + "foobar") + y - if (self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.is_string(compressor) - && self.left.right instanceof AST_Constant - && self.right instanceof AST_Binary - && self.right.operator == "+" - && self.right.left instanceof AST_Constant - && self.right.is_string(compressor)) { - self = make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_Binary, self.left, { - operator: "+", - left: self.left.left, - right: make_node(AST_String, self.left.right, { - value: "" + self.left.right.getValue() + self.right.left.getValue(), - start: self.left.right.start, - end: self.right.left.end - }) - }), - right: self.right.right - }); - } - // a + -b => a - b - if (self.right instanceof AST_UnaryPrefix - && self.right.operator == "-" - && self.left.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.left, - right: self.right.expression - }); - break; - } - // -a + b => b - a - if (self.left instanceof AST_UnaryPrefix - && self.left.operator == "-" - && reversible() - && self.right.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.right, - right: self.left.expression - }); - break; - } - case "*": - associative = compressor.option("unsafe_math"); - case "&": - case "|": - case "^": - // a + +b => +b + a - if (self.left.is_number(compressor) - && self.right.is_number(compressor) - && reversible() - && !(self.left instanceof AST_Binary - && self.left.operator != self.operator - && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { - var reversed = make_node(AST_Binary, self, { - operator: self.operator, - left: self.right, - right: self.left - }); - if (self.right instanceof AST_Constant - && !(self.left instanceof AST_Constant)) { - self = best_of(compressor, reversed, self); - } else { - self = best_of(compressor, self, reversed); - } - } - if (associative && self.is_number(compressor)) { - // a + (b + c) => (a + b) + c - if (self.right instanceof AST_Binary - && self.right.operator == self.operator) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left, - right: self.right.left, - start: self.left.start, - end: self.right.left.end - }), - right: self.right.right - }); - } - // (n + 2) + 3 => 5 + n - // (2 * n) * 3 => 6 + n - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator == self.operator) { - if (self.left.left instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left.left, - right: self.right, - start: self.left.left.start, - end: self.right.end - }), - right: self.left.right - }); - } else if (self.left.right instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left.right, - right: self.right, - start: self.left.right.start, - end: self.right.end - }), - right: self.left.left - }); - } - } - // (a | 1) | (2 | d) => (3 | a) | b - if (self.left instanceof AST_Binary - && self.left.operator == self.operator - && self.left.right instanceof AST_Constant - && self.right instanceof AST_Binary - && self.right.operator == self.operator - && self.right.left instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: make_node(AST_Binary, self.left.left, { - operator: self.operator, - left: self.left.right, - right: self.right.left, - start: self.left.right.start, - end: self.right.left.end - }), - right: self.left.left - }), - right: self.right.right - }); - } - } - } - } - // x && (y && z) ==> x && y && z - // x || (y || z) ==> x || y || z - // x + ("y" + z) ==> x + "y" + z - // "x" + (y + "z")==> "x" + y + "z" - if (self.right instanceof AST_Binary - && self.right.operator == self.operator - && (lazy_op(self.operator) - || (self.operator == "+" - && (self.right.left.is_string(compressor) - || (self.left.is_string(compressor) - && self.right.right.is_string(compressor))))) - ) { - self.left = make_node(AST_Binary, self.left, { - operator : self.operator, - left : self.left, - right : self.right.left - }); - self.right = self.right.right; - return self.transform(compressor); - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; - }); - - OPT(AST_SymbolExport, function(self, compressor) { - return self; - }); - - function recursive_ref(compressor, def) { - var node; - for (var i = 0; node = compressor.parent(i); i++) { - if (node instanceof AST_Lambda) { - var name = node.name; - if (name && name.definition() === def) break; - } - } - return node; - } - - function within_array_or_object_literal(compressor) { - var node, level = 0; - while (node = compressor.parent(level++)) { - if (node instanceof AST_Statement) return false; - if (node instanceof AST_Array - || node instanceof AST_ObjectKeyVal - || node instanceof AST_Object) { - return true; - } - } - return false; - } - - OPT(AST_SymbolRef, function(self, compressor) { - if (!compressor.option("ie8") - && is_undeclared_ref(self) - && (!self.scope.uses_with || !compressor.find_parent(AST_With))) { - switch (self.name) { - case "undefined": - return make_node(AST_Undefined, self).optimize(compressor); - case "NaN": - return make_node(AST_NaN, self).optimize(compressor); - case "Infinity": - return make_node(AST_Infinity, self).optimize(compressor); - } - } - var parent = compressor.parent(); - if (compressor.option("reduce_vars") && is_lhs(self, parent) !== self) { - var d = self.definition(); - if (compressor.top_retain && d.global && compressor.top_retain(d)) { - d.fixed = false; - d.should_replace = false; - d.single_use = false; - return self; - } - var fixed = self.fixed_value(); - var single_use = d.single_use - && !(parent instanceof AST_Call && parent.is_expr_pure(compressor)); - if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { - if (retain_top_func(fixed, compressor)) { - single_use = false; - } else if (d.scope !== self.scope - && (!compressor.option("reduce_funcs") && fixed instanceof AST_Lambda - || d.escaped == 1 - || fixed.inlined - || within_array_or_object_literal(compressor))) { - single_use = false; - } else if (recursive_ref(compressor, d)) { - single_use = false; - } else if (d.scope !== self.scope || d.orig[0] instanceof AST_SymbolFunarg) { - single_use = fixed.is_constant_expression(self.scope); - if (single_use == "f") { - var scope = self.scope; - do { - if (scope instanceof AST_Defun || is_func_expr(scope)) { - scope.inlined = true; - } - } while (scope = scope.parent_scope); - } - } - } - if (single_use && fixed) { - if (fixed instanceof AST_DefClass) { - fixed = make_node(AST_ClassExpression, fixed, fixed); - } - if (fixed instanceof AST_Defun) { - fixed._squeezed = true; - fixed = make_node(AST_Function, fixed, fixed); - } - var value; - if (d.recursive_refs > 0 && fixed.name instanceof AST_SymbolDefun) { - value = fixed.clone(true); - var defun_def = value.name.definition(); - var lambda_def = value.variables.get(value.name.name); - var name = lambda_def && lambda_def.orig[0]; - if (!(name instanceof AST_SymbolLambda)) { - name = make_node(AST_SymbolLambda, value.name, value.name); - name.scope = value; - value.name = name; - lambda_def = value.def_function(name); - } - value.walk(new TreeWalker(function(node) { - if (node instanceof AST_SymbolRef && node.definition() === defun_def) { - node.thedef = lambda_def; - lambda_def.references.push(node); - } - })); - } else { - value = fixed.optimize(compressor); - if (value === fixed) value = fixed.clone(true); - } - return value; - } - if (fixed && d.should_replace === undefined) { - var init; - if (fixed instanceof AST_This) { - if (!(d.orig[0] instanceof AST_SymbolFunarg) - && all(d.references, function(ref) { - return d.scope === ref.scope; - })) { - init = fixed; - } - } else { - var ev = fixed.evaluate(compressor); - if (ev !== fixed && (compressor.option("unsafe_regexp") || !(ev instanceof RegExp))) { - init = make_node_from_constant(ev, fixed); - } - } - if (init) { - var value_length = init.optimize(compressor).print_to_string().length; - var fn; - if (has_symbol_ref(fixed)) { - fn = function() { - var result = init.optimize(compressor); - return result === init ? result.clone(true) : result; - }; - } else { - value_length = Math.min(value_length, fixed.print_to_string().length); - fn = function() { - var result = best_of_expression(init.optimize(compressor), fixed); - return result === init || result === fixed ? result.clone(true) : result; - }; - } - var name_length = d.name.length; - var overhead = 0; - if (compressor.option("unused") && !compressor.exposed(d)) { - overhead = (name_length + 2 + value_length) / (d.references.length - d.assignments); - } - d.should_replace = value_length <= name_length + overhead ? fn : false; - } else { - d.should_replace = false; - } - } - if (d.should_replace) { - return d.should_replace(); - } - } - return self; - - function has_symbol_ref(value) { - var found; - value.walk(new TreeWalker(function(node) { - if (node instanceof AST_SymbolRef) found = true; - if (found) return true; - })); - return found; - } - }); - - function is_atomic(lhs, self) { - return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE; - } - - OPT(AST_Undefined, function(self, compressor) { - if (compressor.option("unsafe_undefined")) { - var undef = find_variable(compressor, "undefined"); - if (undef) { - var ref = make_node(AST_SymbolRef, self, { - name : "undefined", - scope : undef.scope, - thedef : undef - }); - ref.is_undefined = true; - return ref; - } - } - var lhs = is_lhs(compressor.self(), compressor.parent()); - if (lhs && is_atomic(lhs, self)) return self; - return make_node(AST_UnaryPrefix, self, { - operator: "void", - expression: make_node(AST_Number, self, { - value: 0 - }) - }); - }); - - OPT(AST_Infinity, function(self, compressor) { - var lhs = is_lhs(compressor.self(), compressor.parent()); - if (lhs && is_atomic(lhs, self)) return self; - if (compressor.option("keep_infinity") - && !(lhs && !is_atomic(lhs, self)) - && !find_variable(compressor, "Infinity")) - return self; - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { - value: 1 - }), - right: make_node(AST_Number, self, { - value: 0 - }) - }); - }); - - OPT(AST_NaN, function(self, compressor) { - var lhs = is_lhs(compressor.self(), compressor.parent()); - if (lhs && !is_atomic(lhs, self) - || find_variable(compressor, "NaN")) { - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { - value: 0 - }), - right: make_node(AST_Number, self, { - value: 0 - }) - }); - } - return self; - }); - - function is_reachable(self, defs) { - var reachable = false; - var find_ref = new TreeWalker(function(node) { - if (reachable) return true; - if (node instanceof AST_SymbolRef && member(node.definition(), defs)) { - return reachable = true; - } - }); - var scan_scope = new TreeWalker(function(node) { - if (reachable) return true; - if (node instanceof AST_Scope && node !== self) { - var parent = scan_scope.parent(); - if (parent instanceof AST_Call && parent.expression === node) return; - node.walk(find_ref); - return true; - } - }); - self.walk(scan_scope); - return reachable; - } - - var ASSIGN_OPS = [ "+", "-", "/", "*", "%", ">>", "<<", ">>>", "|", "^", "&" ]; - var ASSIGN_OPS_COMMUTATIVE = [ "*", "|", "^", "&" ]; - OPT(AST_Assign, function(self, compressor) { - var def; - if (compressor.option("dead_code") - && self.left instanceof AST_SymbolRef - && (def = self.left.definition()).scope === compressor.find_parent(AST_Lambda)) { - var level = 0, node, parent = self; - do { - node = parent; - parent = compressor.parent(level++); - if (parent instanceof AST_Exit) { - if (in_try(level, parent)) break; - if (is_reachable(def.scope, [ def ])) break; - if (self.operator == "=") return self.right; - def.fixed = false; - return make_node(AST_Binary, self, { - operator: self.operator.slice(0, -1), - left: self.left, - right: self.right - }).optimize(compressor); - } - } while (parent instanceof AST_Binary && parent.right === node - || parent instanceof AST_Sequence && parent.tail_node() === node); - } - self = self.lift_sequences(compressor); - if (self.operator == "=" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary) { - // x = expr1 OP expr2 - if (self.right.left instanceof AST_SymbolRef - && self.right.left.name == self.left.name - && member(self.right.operator, ASSIGN_OPS)) { - // x = x - 2 ---> x -= 2 - self.operator = self.right.operator + "="; - self.right = self.right.right; - } else if (self.right.right instanceof AST_SymbolRef - && self.right.right.name == self.left.name - && member(self.right.operator, ASSIGN_OPS_COMMUTATIVE) - && !self.right.left.has_side_effects(compressor)) { - // x = 2 & x ---> x &= 2 - self.operator = self.right.operator + "="; - self.right = self.right.left; - } - } - return self; - - function in_try(level, node) { - var right = self.right; - self.right = make_node(AST_Null, right); - var may_throw = node.may_throw(compressor); - self.right = right; - var scope = self.left.definition().scope; - var parent; - while ((parent = compressor.parent(level++)) !== scope) { - if (parent instanceof AST_Try) { - if (parent.bfinally) return true; - if (may_throw && parent.bcatch) return true; - } - } - } - }); - - OPT(AST_DefaultAssign, function(self, compressor) { - if (!compressor.option("evaluate")) { - return self; - } - var evaluateRight = self.right.evaluate(compressor); - - // `[x = undefined] = foo` ---> `[x] = foo` - if (evaluateRight === undefined) { - self = self.left; - } else if (evaluateRight !== self.right) { - evaluateRight = make_node_from_constant(evaluateRight, self.right); - self.right = best_of_expression(evaluateRight, self.right); - } - - return self; - }); - - OPT(AST_Conditional, function(self, compressor) { - if (!compressor.option("conditionals")) return self; - // This looks like lift_sequences(), should probably be under "sequences" - if (self.condition instanceof AST_Sequence) { - var expressions = self.condition.expressions.slice(); - self.condition = expressions.pop(); - expressions.push(self); - return make_sequence(self, expressions); - } - var cond = self.condition.evaluate(compressor); - if (cond !== self.condition) { - if (cond) { - compressor.warn("Condition always true [{file}:{line},{col}]", self.start); - return maintain_this_binding(compressor.parent(), compressor.self(), self.consequent); - } else { - compressor.warn("Condition always false [{file}:{line},{col}]", self.start); - return maintain_this_binding(compressor.parent(), compressor.self(), self.alternative); - } - } - var negated = cond.negate(compressor, first_in_statement(compressor)); - if (best_of(compressor, cond, negated) === negated) { - self = make_node(AST_Conditional, self, { - condition: negated, - consequent: self.alternative, - alternative: self.consequent - }); - } - var condition = self.condition; - var consequent = self.consequent; - var alternative = self.alternative; - // x?x:y --> x||y - if (condition instanceof AST_SymbolRef - && consequent instanceof AST_SymbolRef - && condition.definition() === consequent.definition()) { - return make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative - }); - } - // if (foo) exp = something; else exp = something_else; - // | - // v - // exp = foo ? something : something_else; - if (consequent instanceof AST_Assign - && alternative instanceof AST_Assign - && consequent.operator == alternative.operator - && consequent.left.equivalent_to(alternative.left) - && (!self.condition.has_side_effects(compressor) - || consequent.operator == "=" - && !consequent.left.has_side_effects(compressor))) { - return make_node(AST_Assign, self, { - operator: consequent.operator, - left: consequent.left, - right: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.right, - alternative: alternative.right - }) - }); - } - // x ? y(a) : y(b) --> y(x ? a : b) - var arg_index; - if (consequent instanceof AST_Call - && alternative.TYPE === consequent.TYPE - && consequent.args.length > 0 - && consequent.args.length == alternative.args.length - && consequent.expression.equivalent_to(alternative.expression) - && !self.condition.has_side_effects(compressor) - && !consequent.expression.has_side_effects(compressor) - && typeof (arg_index = single_arg_diff()) == "number") { - var node = consequent.clone(); - node.args[arg_index] = make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.args[arg_index], - alternative: alternative.args[arg_index] - }); - return node; - } - // x?y?z:a:a --> x&&y?z:a - if (consequent instanceof AST_Conditional - && consequent.alternative.equivalent_to(alternative)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - left: self.condition, - operator: "&&", - right: consequent.condition - }), - consequent: consequent.consequent, - alternative: alternative - }); - } - // x ? y : y --> x, y - if (consequent.equivalent_to(alternative)) { - return make_sequence(self, [ - self.condition, - consequent - ]).optimize(compressor); - } - // x ? y || z : z --> x && y || z - if (consequent instanceof AST_Binary - && consequent.operator == "||" - && consequent.right.equivalent_to(alternative)) { - return make_node(AST_Binary, self, { - operator: "||", - left: make_node(AST_Binary, self, { - operator: "&&", - left: self.condition, - right: consequent.left - }), - right: alternative - }).optimize(compressor); - } - var in_bool = compressor.in_boolean_context(); - if (is_true(self.consequent)) { - if (is_false(self.alternative)) { - // c ? true : false ---> !!c - return booleanize(self.condition); - } - // c ? true : x ---> !!c || x - return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(self.condition), - right: self.alternative - }); - } - if (is_false(self.consequent)) { - if (is_true(self.alternative)) { - // c ? false : true ---> !c - return booleanize(self.condition.negate(compressor)); - } - // c ? false : x ---> !c && x - return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition.negate(compressor)), - right: self.alternative - }); - } - if (is_true(self.alternative)) { - // c ? x : true ---> !c || x - return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(self.condition.negate(compressor)), - right: self.consequent - }); - } - if (is_false(self.alternative)) { - // c ? x : false ---> !!c && x - return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition), - right: self.consequent - }); - } - - return self; - - function booleanize(node) { - if (node.is_boolean()) return node; - // !!expression - return make_node(AST_UnaryPrefix, node, { - operator: "!", - expression: node.negate(compressor) - }); - } - - // AST_True or !0 - function is_true(node) { - return node instanceof AST_True - || in_bool - && node instanceof AST_Constant - && node.getValue() - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && !node.expression.getValue()); - } - // AST_False or !1 - function is_false(node) { - return node instanceof AST_False - || in_bool - && node instanceof AST_Constant - && !node.getValue() - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && node.expression.getValue()); - } - - function single_arg_diff() { - var a = consequent.args; - var b = alternative.args; - for (var i = 0, len = a.length; i < len; i++) { - if (a[i] instanceof AST_Expansion) return; - if (!a[i].equivalent_to(b[i])) { - if (b[i] instanceof AST_Expansion) return; - for (var j = i + 1; j < len; j++) { - if (a[j] instanceof AST_Expansion) return; - if (!a[j].equivalent_to(b[j])) return; - } - return i; - } - } - } - }); - - OPT(AST_Boolean, function(self, compressor) { - if (compressor.in_boolean_context()) return make_node(AST_Number, self, { - value: +self.value - }); - var p = compressor.parent(); - if (compressor.option("booleans_as_integers")) { - if (p instanceof AST_Binary && (p.operator == "===" || p.operator == "!==")) { - p.operator = p.operator.replace(/=$/, ""); - } - return make_node(AST_Number, self, { - value: +self.value - }); - } - if (compressor.option("booleans")) { - if (p instanceof AST_Binary && (p.operator == "==" - || p.operator == "!=")) { - compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", { - operator : p.operator, - value : self.value, - file : p.start.file, - line : p.start.line, - col : p.start.col, - }); - return make_node(AST_Number, self, { - value: +self.value - }); - } - return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_Number, self, { - value: 1 - self.value - }) - }); - } - return self; - }); - - function safe_to_flatten(value, compressor) { - if (value instanceof AST_SymbolRef) { - value = value.fixed_value(); - } - if (!value) return false; - return !(value instanceof AST_Lambda || value instanceof AST_Class) - || compressor.parent() instanceof AST_New - || !value.contains_this(); - } - - OPT(AST_Sub, function(self, compressor) { - var expr = self.expression; - var prop = self.property; - if (compressor.option("properties")) { - var key = prop.evaluate(compressor); - if (key !== prop) { - if (typeof key == "string") { - if (key == "undefined") { - key = undefined; - } else { - var value = parseFloat(key); - if (value.toString() == key) { - key = value; - } - } - } - prop = self.property = best_of_expression(prop, make_node_from_constant(key, prop).transform(compressor)); - var property = "" + key; - if (is_identifier_string(property) - && property.length <= prop.print_to_string().length + 1) { - return make_node(AST_Dot, self, { - expression: expr, - property: property - }).optimize(compressor); - } - } - } - var fn; - OPT_ARGUMENTS: if (compressor.option("arguments") - && expr instanceof AST_SymbolRef - && expr.name == "arguments" - && expr.definition().orig.length == 1 - && (fn = expr.scope) instanceof AST_Lambda - && fn.uses_arguments - && !(fn instanceof AST_Arrow) - && prop instanceof AST_Number) { - var index = prop.getValue(); - var params = Object.create(null); - var argnames = fn.argnames; - for (var n = 0; n < argnames.length; n++) { - if (!(argnames[n] instanceof AST_SymbolFunarg)) { - break OPT_ARGUMENTS; // destructuring parameter - bail - } - var param = argnames[n].name; - if (param in params) { - break OPT_ARGUMENTS; // duplicate parameter - bail - } - params[param] = true; - } - var argname = fn.argnames[index]; - if (argname && compressor.has_directive("use strict")) { - var def = argname.definition(); - if (!compressor.option("reduce_vars") || def.assignments || def.orig.length > 1) { - argname = null; - } - } else if (!argname && !compressor.option("keep_fargs") && index < fn.argnames.length + 5) { - while (index >= fn.argnames.length) { - argname = make_node(AST_SymbolFunarg, fn, { - name: fn.make_var_name("argument_" + fn.argnames.length), - scope: fn - }); - fn.argnames.push(argname); - fn.enclosed.push(fn.def_variable(argname)); - } - } - if (argname) { - var sym = make_node(AST_SymbolRef, self, argname); - sym.reference({}); - delete argname.__unused; - return sym; - } - } - if (is_lhs(self, compressor.parent())) return self; - if (key !== prop) { - var sub = self.flatten_object(property, compressor); - if (sub) { - expr = self.expression = sub.expression; - prop = self.property = sub.property; - } - } - if (compressor.option("properties") && compressor.option("side_effects") - && prop instanceof AST_Number && expr instanceof AST_Array) { - var index = prop.getValue(); - var elements = expr.elements; - var retValue = elements[index]; - FLATTEN: if (safe_to_flatten(retValue, compressor)) { - var flatten = true; - var values = []; - for (var i = elements.length; --i > index;) { - var value = elements[i].drop_side_effect_free(compressor); - if (value) { - values.unshift(value); - if (flatten && value.has_side_effects(compressor)) flatten = false; - } - } - if (retValue instanceof AST_Expansion) break FLATTEN; - retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue; - if (!flatten) values.unshift(retValue); - while (--i >= 0) { - var value = elements[i]; - if (value instanceof AST_Expansion) break FLATTEN; - value = value.drop_side_effect_free(compressor); - if (value) values.unshift(value); - else index--; - } - if (flatten) { - values.push(retValue); - return make_sequence(self, values).optimize(compressor); - } else return make_node(AST_Sub, self, { - expression: make_node(AST_Array, expr, { - elements: values - }), - property: make_node(AST_Number, prop, { - value: index - }) - }); - } - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; - }); - - AST_Lambda.DEFMETHOD("contains_this", function() { - var result; - var self = this; - self.walk(new TreeWalker(function(node) { - if (result) return true; - if (node instanceof AST_This) return result = true; - if (node !== self && node instanceof AST_Scope && !(node instanceof AST_Arrow)) return true; - })); - return result; - }); - - AST_PropAccess.DEFMETHOD("flatten_object", function(key, compressor) { - if (!compressor.option("properties")) return; - var arrows = compressor.option("unsafe_arrows") && compressor.option("ecma") >= 6; - var expr = this.expression; - if (expr instanceof AST_Object) { - var props = expr.properties; - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - if ("" + (prop instanceof AST_ConciseMethod ? prop.key.name : prop.key) == key) { - if (!all(props, function(prop) { - return prop instanceof AST_ObjectKeyVal - || arrows && prop instanceof AST_ConciseMethod && !prop.is_generator; - })) break; - if (!safe_to_flatten(prop.value, compressor)) break; - return make_node(AST_Sub, this, { - expression: make_node(AST_Array, expr, { - elements: props.map(function(prop) { - var v = prop.value; - if (v instanceof AST_Accessor) v = make_node(AST_Function, v, v); - var k = prop.key; - if (k instanceof AST_Node && !(k instanceof AST_SymbolMethod)) { - return make_sequence(prop, [ k, v ]); - } - return v; - }) - }), - property: make_node(AST_Number, this, { - value: i - }) - }); - } - } - } - }); - - OPT(AST_Dot, function(self, compressor) { - if (self.property == "arguments" || self.property == "caller") { - compressor.warn("Function.protoype.{prop} not supported [{file}:{line},{col}]", { - prop: self.property, - file: self.start.file, - line: self.start.line, - col: self.start.col - }); - } - if (is_lhs(self, compressor.parent())) return self; - if (compressor.option("unsafe_proto") - && self.expression instanceof AST_Dot - && self.expression.property == "prototype") { - var exp = self.expression.expression; - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - self.expression = make_node(AST_Array, self.expression, { - elements: [] - }); - break; - case "Function": - self.expression = make_node(AST_Function, self.expression, { - argnames: [], - body: [] - }); - break; - case "Number": - self.expression = make_node(AST_Number, self.expression, { - value: 0 - }); - break; - case "Object": - self.expression = make_node(AST_Object, self.expression, { - properties: [] - }); - break; - case "RegExp": - self.expression = make_node(AST_RegExp, self.expression, { - value: /t/ - }); - break; - case "String": - self.expression = make_node(AST_String, self.expression, { - value: "" - }); - break; - } - } - var sub = self.flatten_object(self.property, compressor); - if (sub) return sub.optimize(compressor); - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; - }); - - function literals_in_boolean_context(self, compressor) { - if (compressor.in_boolean_context()) { - return best_of(compressor, self, make_sequence(self, [ - self, - make_node(AST_True, self) - ]).optimize(compressor)); - } - return self; - } - OPT(AST_Array, literals_in_boolean_context); - OPT(AST_Object, literals_in_boolean_context); - OPT(AST_RegExp, literals_in_boolean_context); - - OPT(AST_Return, function(self, compressor) { - if (self.value && is_undefined(self.value, compressor)) { - self.value = null; - } - return self; - }); - - OPT(AST_Arrow, function(self, compressor) { - if (!(self.body instanceof AST_Node)) { - self = opt_AST_Lambda(self, compressor); - } - if (compressor.option("arrows") - && self.body.length == 1 - && self.body[0] instanceof AST_Return) { - var value = self.body[0].value; - self.body = value ? value : []; - } - return self; - }); - - OPT(AST_Function, function(self, compressor) { - self = opt_AST_Lambda(self, compressor); - if (compressor.option("unsafe_arrows") - && compressor.option("ecma") >= 6 - && !self.name - && !self.is_generator - && !self.uses_arguments - && !self.pinned()) { - var has_special_symbol = false; - self.walk(new TreeWalker(function(node) { - if (has_special_symbol) return true; - if (node instanceof AST_This) { - has_special_symbol = true; - return true; - } - })); - if (!has_special_symbol) return make_node(AST_Arrow, self, self).optimize(compressor); - } - return self; - }); - - OPT(AST_Class, function(self, compressor) { - // HACK to avoid compress failure. - // AST_Class is not really an AST_Scope/AST_Block as it lacks a body. - return self; - }); - - OPT(AST_Yield, function(self, compressor) { - if (self.expression && !self.is_star && is_undefined(self.expression, compressor)) { - self.expression = null; - } - return self; - }); - - OPT(AST_TemplateString, function(self, compressor) { - if (!compressor.option("evaluate") - || compressor.parent() instanceof AST_PrefixedTemplateString) - return self; - - var segments = []; - for (var i = 0; i < self.segments.length; i++) { - var segment = self.segments[i]; - if (segment instanceof AST_Node) { - var result = segment.evaluate(compressor); - // Evaluate to constant value - // Constant value shorter than ${segment} - if (result !== segment && (result + "").length <= segment.print_to_string().length + "${}".length) { - // There should always be a previous and next segment if segment is a node - segments[segments.length - 1].value = segments[segments.length - 1].value + result + self.segments[++i].value; - continue; - } - } - segments.push(segment); - } - self.segments = segments; - - return segments.length == 1 ? make_node(AST_String, self, segments[0]) : self; - }); - - OPT(AST_PrefixedTemplateString, function(self, compressor) { - return self; - }); - - // ["p"]:1 ---> p:1 - // [42]:1 ---> 42:1 - function lift_key(self, compressor) { - if (!compressor.option("computed_props")) return self; - // save a comparison in the typical case - if (!(self.key instanceof AST_Constant)) return self; - // whitelist acceptable props as not all AST_Constants are true constants - if (self.key instanceof AST_String || self.key instanceof AST_Number) { - if (self.key.value === "__proto__") return self; - if (self.key.value == "constructor" - && compressor.parent() instanceof AST_Class) return self; - if (self instanceof AST_ObjectKeyVal) { - self.key = self.key.value; - } else { - self.key = make_node(AST_SymbolMethod, self.key, { - name: self.key.value - }); - } - } - return self; - } - - OPT(AST_ObjectProperty, lift_key); - - OPT(AST_ConciseMethod, function(self, compressor) { - lift_key(self, compressor); - // p(){return x;} ---> p:()=>x - if (compressor.option("arrows") - && compressor.parent() instanceof AST_Object - && !self.is_generator - && !self.value.uses_arguments - && !self.value.pinned() - && self.value.body.length == 1 - && self.value.body[0] instanceof AST_Return - && self.value.body[0].value - && !self.value.contains_this()) { - var arrow = make_node(AST_Arrow, self.value, self.value); - arrow.async = self.async; - arrow.is_generator = self.is_generator; - return make_node(AST_ObjectKeyVal, self, { - key: self.key instanceof AST_SymbolMethod ? self.key.name : self.key, - value: arrow, - quote: self.quote, - }); - } - return self; - }); - - OPT(AST_ObjectKeyVal, function(self, compressor) { - lift_key(self, compressor); - // p:function(){} ---> p(){} - // p:function*(){} ---> *p(){} - // p:async function(){} ---> async p(){} - // p:()=>{} ---> p(){} - // p:async()=>{} ---> async p(){} - var unsafe_methods = compressor.option("unsafe_methods"); - if (unsafe_methods - && compressor.option("ecma") >= 6 - && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + ""))) { - var key = self.key; - var value = self.value; - var is_arrow_with_block = value instanceof AST_Arrow - && Array.isArray(value.body) - && !value.contains_this(); - if ((is_arrow_with_block || value instanceof AST_Function) && !value.name) { - return make_node(AST_ConciseMethod, self, { - async: value.async, - is_generator: value.is_generator, - key: key instanceof AST_Node ? key : make_node(AST_SymbolMethod, self, { - name: key, - }), - value: make_node(AST_Accessor, value, value), - quote: self.quote, - }); - } - } - return self; - }); - - OPT(AST_Destructuring, function(self, compressor) { - if (compressor.option("pure_getters") == true - && compressor.option("unused") - && !self.is_array - && Array.isArray(self.names) - && !is_destructuring_export_decl(compressor)) { - var keep = []; - for (var i = 0; i < self.names.length; i++) { - var elem = self.names[i]; - if (!(elem instanceof AST_ObjectKeyVal - && typeof elem.key == "string" - && elem.value instanceof AST_SymbolDeclaration - && !should_retain(compressor, elem.value.definition()))) { - keep.push(elem); - } - } - if (keep.length != self.names.length) { - self.names = keep; - } - } - return self; - - function is_destructuring_export_decl(compressor) { - var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/]; - for (var a = 0, p = 0, len = ancestors.length; a < len; p++) { - var parent = compressor.parent(p); - if (!parent) return false; - if (a === 0 && parent.TYPE == "Destructuring") continue; - if (!ancestors[a].test(parent.TYPE)) { - return false; - } - a++; - } - return true; - } - - function should_retain(compressor, def) { - if (def.references.length) return true; - if (!def.global) return false; - if (compressor.toplevel.vars) { - if (compressor.top_retain) { - return compressor.top_retain(def); - } - return false; - } - return true; - } - }); -})(); diff --git a/tools/node_modules/terser/lib/minify.js b/tools/node_modules/terser/lib/minify.js deleted file mode 100644 index 7b016e9cff90..000000000000 --- a/tools/node_modules/terser/lib/minify.js +++ /dev/null @@ -1,260 +0,0 @@ -"use strict"; - -var to_ascii = typeof atob == "undefined" ? function(b64) { - if (Buffer.from && Buffer.from !== Uint8Array.from) { - // Node >= 4.5.0 - return Buffer.from(b64, "base64").toString(); - } else { - // Node < 4.5.0, old API, manual safeguards - if (typeof b64 !== "string") throw new Errror("\"b64\" must be a string"); - return new Buffer(b64, "base64").toString(); - } -} : atob; -var to_base64 = typeof btoa == "undefined" ? function(str) { - if (Buffer.from && Buffer.from !== Uint8Array.from) { - // Node >= 4.5.0 - return Buffer.from(str).toString("base64"); - } else { - // Node < 4.5.0, old API, manual safeguards - if (typeof str !== "string") throw new Errror("\"str\" must be a string"); - return new Buffer(str).toString("base64"); - } -} : btoa; - -function read_source_map(code) { - var match = /\n\/\/# sourceMappingURL=data:application\/json(;.*?)?;base64,(.*)/.exec(code); - if (!match) { - AST_Node.warn("inline source map not found"); - return null; - } - return to_ascii(match[2]); -} - -function set_shorthand(name, options, keys) { - if (options[name]) { - keys.forEach(function(key) { - if (options[key]) { - if (typeof options[key] != "object") options[key] = {}; - if (!(name in options[key])) options[key][name] = options[name]; - } - }); - } -} - -function init_cache(cache) { - if (!cache) return; - if (!("props" in cache)) { - cache.props = new Dictionary(); - } else if (!(cache.props instanceof Dictionary)) { - cache.props = Dictionary.fromObject(cache.props); - } -} - -function to_json(cache) { - return { - props: cache.props.toObject() - }; -} - -function minify(files, options) { - var warn_function = AST_Node.warn_function; - try { - options = defaults(options, { - compress: {}, - ecma: undefined, - enclose: false, - ie8: false, - keep_classnames: undefined, - keep_fnames: false, - mangle: {}, - module: false, - nameCache: null, - output: {}, - parse: {}, - rename: undefined, - safari10: false, - sourceMap: false, - timings: false, - toplevel: false, - warnings: false, - wrap: false, - }, true); - var timings = options.timings && { - start: Date.now() - }; - if (options.keep_classnames === undefined) { - options.keep_classnames = options.keep_fnames; - } - if (options.rename === undefined) { - options.rename = options.compress && options.mangle; - } - set_shorthand("ecma", options, [ "parse", "compress", "output" ]); - set_shorthand("ie8", options, [ "compress", "mangle", "output" ]); - set_shorthand("keep_classnames", options, [ "compress", "mangle" ]); - set_shorthand("keep_fnames", options, [ "compress", "mangle" ]); - set_shorthand("module", options, [ "parse", "compress", "mangle" ]); - set_shorthand("safari10", options, [ "mangle", "output" ]); - set_shorthand("toplevel", options, [ "compress", "mangle" ]); - set_shorthand("warnings", options, [ "compress" ]); - var quoted_props; - if (options.mangle) { - options.mangle = defaults(options.mangle, { - cache: options.nameCache && (options.nameCache.vars || {}), - eval: false, - ie8: false, - keep_classnames: false, - keep_fnames: false, - module: false, - properties: false, - reserved: [], - safari10: false, - toplevel: false, - }, true); - if (options.mangle.properties) { - if (typeof options.mangle.properties != "object") { - options.mangle.properties = {}; - } - if (options.mangle.properties.keep_quoted) { - quoted_props = options.mangle.properties.reserved; - if (!Array.isArray(quoted_props)) quoted_props = []; - options.mangle.properties.reserved = quoted_props; - } - if (options.nameCache && !("cache" in options.mangle.properties)) { - options.mangle.properties.cache = options.nameCache.props || {}; - } - } - init_cache(options.mangle.cache); - init_cache(options.mangle.properties.cache); - } - if (options.sourceMap) { - options.sourceMap = defaults(options.sourceMap, { - content: null, - filename: null, - includeSources: false, - root: null, - url: null, - }, true); - } - var warnings = []; - if (options.warnings && !AST_Node.warn_function) { - AST_Node.warn_function = function(warning) { - warnings.push(warning); - }; - } - if (timings) timings.parse = Date.now(); - var toplevel; - if (files instanceof AST_Toplevel) { - toplevel = files; - } else { - if (typeof files == "string") { - files = [ files ]; - } - options.parse = options.parse || {}; - options.parse.toplevel = null; - for (var name in files) if (HOP(files, name)) { - options.parse.filename = name; - options.parse.toplevel = parse(files[name], options.parse); - if (options.sourceMap && options.sourceMap.content == "inline") { - if (Object.keys(files).length > 1) - throw new Error("inline source map only works with singular input"); - options.sourceMap.content = read_source_map(files[name]); - } - } - toplevel = options.parse.toplevel; - } - if (quoted_props) { - reserve_quoted_keys(toplevel, quoted_props); - } - if (options.wrap) { - toplevel = toplevel.wrap_commonjs(options.wrap); - } - if (options.enclose) { - toplevel = toplevel.wrap_enclose(options.enclose); - } - if (timings) timings.rename = Date.now(); - // disable rename on harmony due to expand_names bug in for-of loops - // https://github.com/mishoo/UglifyJS2/issues/2794 - if (0 && options.rename) { - toplevel.figure_out_scope(options.mangle); - toplevel.expand_names(options.mangle); - } - if (timings) timings.compress = Date.now(); - if (options.compress) toplevel = new Compressor(options.compress).compress(toplevel); - if (timings) timings.scope = Date.now(); - if (options.mangle) toplevel.figure_out_scope(options.mangle); - if (timings) timings.mangle = Date.now(); - if (options.mangle) { - base54.reset(); - toplevel.compute_char_frequency(options.mangle); - toplevel.mangle_names(options.mangle); - } - if (timings) timings.properties = Date.now(); - if (options.mangle && options.mangle.properties) { - toplevel = mangle_properties(toplevel, options.mangle.properties); - } - if (timings) timings.output = Date.now(); - var result = {}; - if (options.output.ast) { - result.ast = toplevel; - } - if (!HOP(options.output, "code") || options.output.code) { - if (options.sourceMap) { - if (typeof options.sourceMap.content == "string") { - options.sourceMap.content = JSON.parse(options.sourceMap.content); - } - options.output.source_map = SourceMap({ - file: options.sourceMap.filename, - orig: options.sourceMap.content, - root: options.sourceMap.root - }); - if (options.sourceMap.includeSources) { - if (files instanceof AST_Toplevel) { - throw new Error("original source content unavailable"); - } else for (var name in files) if (HOP(files, name)) { - options.output.source_map.get().setSourceContent(name, files[name]); - } - } - } - delete options.output.ast; - delete options.output.code; - var stream = OutputStream(options.output); - toplevel.print(stream); - result.code = stream.get(); - if (options.sourceMap) { - result.map = options.output.source_map.toString(); - if (options.sourceMap.url == "inline") { - result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(result.map); - } else if (options.sourceMap.url) { - result.code += "\n//# sourceMappingURL=" + options.sourceMap.url; - } - } - } - if (options.nameCache && options.mangle) { - if (options.mangle.cache) options.nameCache.vars = to_json(options.mangle.cache); - if (options.mangle.properties && options.mangle.properties.cache) { - options.nameCache.props = to_json(options.mangle.properties.cache); - } - } - if (timings) { - timings.end = Date.now(); - result.timings = { - parse: 1e-3 * (timings.rename - timings.parse), - rename: 1e-3 * (timings.compress - timings.rename), - compress: 1e-3 * (timings.scope - timings.compress), - scope: 1e-3 * (timings.mangle - timings.scope), - mangle: 1e-3 * (timings.properties - timings.mangle), - properties: 1e-3 * (timings.output - timings.properties), - output: 1e-3 * (timings.end - timings.output), - total: 1e-3 * (timings.end - timings.start) - }; - } - if (warnings.length) { - result.warnings = warnings; - } - return result; - } catch (ex) { - return { error: ex }; - } finally { - AST_Node.warn_function = warn_function; - } -} diff --git a/tools/node_modules/terser/lib/mozilla-ast.js b/tools/node_modules/terser/lib/mozilla-ast.js deleted file mode 100644 index 234866dd0819..000000000000 --- a/tools/node_modules/terser/lib/mozilla-ast.js +++ /dev/null @@ -1,1093 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -(function() { - - var normalize_directives = function(body) { - var in_directive = true; - - for (var i = 0; i < body.length; i++) { - if (in_directive && body[i] instanceof AST_Statement && body[i].body instanceof AST_String) { - body[i] = new AST_Directive({ - start: body[i].start, - end: body[i].end, - value: body[i].body.value - }); - } else if (in_directive && !(body[i] instanceof AST_Statement && body[i].body instanceof AST_String)) { - in_directive = false; - } - } - - return body; - }; - - var MOZ_TO_ME = { - Program: function(M) { - return new AST_Toplevel({ - start: my_start_token(M), - end: my_end_token(M), - body: normalize_directives(M.body.map(from_moz)) - }); - }, - ArrayPattern: function(M) { - return new AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.elements.map(function(elm) { - if (elm === null) { - return new AST_Hole(); - } - return from_moz(elm); - }), - is_array: true - }); - }, - ObjectPattern: function(M) { - return new AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.properties.map(from_moz), - is_array: false - }); - }, - AssignmentPattern: function(M) { - return new AST_Binary({ - start: my_start_token(M), - end: my_end_token(M), - left: from_moz(M.left), - operator: "=", - right: from_moz(M.right) - }); - }, - SpreadElement: function(M) { - return new AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - RestElement: function(M) { - return new AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - TemplateElement: function(M) { - return new AST_TemplateSegment({ - start: my_start_token(M), - end: my_end_token(M), - value: M.value.cooked, - raw: M.value.raw - }); - }, - TemplateLiteral: function(M) { - var segments = []; - for (var i = 0; i < M.quasis.length; i++) { - segments.push(from_moz(M.quasis[i])); - if (M.expressions[i]) { - segments.push(from_moz(M.expressions[i])); - } - } - return new AST_TemplateString({ - start: my_start_token(M), - end: my_end_token(M), - segments: segments - }); - }, - TaggedTemplateExpression: function(M) { - return new AST_PrefixedTemplateString({ - start: my_start_token(M), - end: my_end_token(M), - template_string: from_moz(M.quasi), - prefix: from_moz(M.tag) - }); - }, - FunctionDeclaration: function(M) { - return new AST_Defun({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: M.params.map(from_moz), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - }, - FunctionExpression: function(M) { - return new AST_Function({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: M.params.map(from_moz), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - }, - ArrowFunctionExpression: function(M) { - return new AST_Arrow({ - start: my_start_token(M), - end: my_end_token(M), - argnames: M.params.map(from_moz), - body: from_moz(M.body), - async: M.async, - }); - }, - ExpressionStatement: function(M) { - return new AST_SimpleStatement({ - start: my_start_token(M), - end: my_end_token(M), - body: from_moz(M.expression) - }); - }, - TryStatement: function(M) { - var handlers = M.handlers || [M.handler]; - if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) { - throw new Error("Multiple catch clauses are not supported."); - } - return new AST_Try({ - start : my_start_token(M), - end : my_end_token(M), - body : from_moz(M.block).body, - bcatch : from_moz(handlers[0]), - bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null - }); - }, - Property: function(M) { - var key = M.key; - var args = { - start : my_start_token(key || M.value), - end : my_end_token(M.value), - key : key.type == "Identifier" ? key.name : key.value, - value : from_moz(M.value) - }; - if (M.computed) { - args.key = from_moz(M.key); - } - if (M.method) { - args.is_generator = M.value.generator; - args.async = M.value.async; - if (!M.computed) { - args.key = new AST_SymbolMethod({ name: args.key }); - } else { - args.key = from_moz(M.key); - } - return new AST_ConciseMethod(args); - } - if (M.kind == "init") { - if (key.type != "Identifier" && key.type != "Literal") { - args.key = from_moz(key); - } - return new AST_ObjectKeyVal(args); - } - if (typeof args.key === "string" || typeof args.key === "number") { - args.key = new AST_SymbolMethod({ - name: args.key - }); - } - args.value = new AST_Accessor(args.value); - if (M.kind == "get") return new AST_ObjectGetter(args); - if (M.kind == "set") return new AST_ObjectSetter(args); - if (M.kind == "method") { - args.async = M.value.async; - args.is_generator = M.value.generator; - args.quote = M.computed ? "\"" : null; - return new AST_ConciseMethod(args); - } - }, - MethodDefinition: function(M) { - var args = { - start : my_start_token(M), - end : my_end_token(M), - key : M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }), - value : from_moz(M.value), - static : M.static, - }; - if (M.kind == "get") { - return new AST_ObjectGetter(args); - } - if (M.kind == "set") { - return new AST_ObjectSetter(args); - } - args.is_generator = M.value.generator; - args.async = M.value.async; - return new AST_ConciseMethod(args); - }, - ArrayExpression: function(M) { - return new AST_Array({ - start : my_start_token(M), - end : my_end_token(M), - elements : M.elements.map(function(elem) { - return elem === null ? new AST_Hole() : from_moz(elem); - }) - }); - }, - ObjectExpression: function(M) { - return new AST_Object({ - start : my_start_token(M), - end : my_end_token(M), - properties : M.properties.map(function(prop) { - if (prop.type === "SpreadElement") { - return from_moz(prop); - } - prop.type = "Property"; - // XXX EMSCRIPTEN https://github.com/mishoo/UglifyJS2/pull/3323 - var ret = from_moz(prop); - if (prop.key.type === "Literal" && - (prop.key.raw[0] === '"' || prop.key.raw[0] === "'")) { - ret.quote = true; - } - return ret; - }) - }); - }, - SequenceExpression: function(M) { - return new AST_Sequence({ - start : my_start_token(M), - end : my_end_token(M), - expressions: M.expressions.map(from_moz) - }); - }, - MemberExpression: function(M) { - return new (M.computed ? AST_Sub : AST_Dot)({ - start : my_start_token(M), - end : my_end_token(M), - property : M.computed ? from_moz(M.property) : M.property.name, - expression : from_moz(M.object) - }); - }, - SwitchCase: function(M) { - return new (M.test ? AST_Case : AST_Default)({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.test), - body : M.consequent.map(from_moz) - }); - }, - VariableDeclaration: function(M) { - return new (M.kind === "const" ? AST_Const : - M.kind === "let" ? AST_Let : AST_Var)({ - start : my_start_token(M), - end : my_end_token(M), - definitions : M.declarations.map(from_moz) - }); - }, - - ImportDeclaration: function(M) { - var imported_name = null; - var imported_names = null; - M.specifiers.forEach(function (specifier) { - if (specifier.type === "ImportSpecifier") { - if (!imported_names) { imported_names = []; } - imported_names.push(new AST_NameMapping({ - start: my_start_token(specifier), - end: my_end_token(specifier), - foreign_name: from_moz(specifier.imported), - name: from_moz(specifier.local) - })); - } else if (specifier.type === "ImportDefaultSpecifier") { - imported_name = from_moz(specifier.local); - } else if (specifier.type === "ImportNamespaceSpecifier") { - if (!imported_names) { imported_names = []; } - imported_names.push(new AST_NameMapping({ - start: my_start_token(specifier), - end: my_end_token(specifier), - foreign_name: new AST_SymbolImportForeign({ name: "*" }), - name: from_moz(specifier.local) - })); - } - }); - return new AST_Import({ - start : my_start_token(M), - end : my_end_token(M), - imported_name: imported_name, - imported_names : imported_names, - module_name : from_moz(M.source) - }); - }, - ExportAllDeclaration: function(M) { - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_names: [ - new AST_NameMapping({ - name: new AST_SymbolExportForeign({ name: "*" }), - foreign_name: new AST_SymbolExportForeign({ name: "*" }) - }) - ], - module_name: from_moz(M.source) - }); - }, - ExportNamedDeclaration: function(M) { - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_definition: from_moz(M.declaration), - exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(function (specifier) { - return new AST_NameMapping({ - foreign_name: from_moz(specifier.exported), - name: from_moz(specifier.local) - }); - }) : null, - module_name: from_moz(M.source) - }); - }, - ExportDefaultDeclaration: function(M) { - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_value: from_moz(M.declaration), - is_default: true - }); - }, - Literal: function(M) { - var val = M.value, args = { - start : my_start_token(M), - end : my_end_token(M) - }; - if (val === null) return new AST_Null(args); - var rx = M.regex; - if (rx && rx.pattern) { - // RegExpLiteral as per ESTree AST spec - args.value = new RegExp(rx.pattern, rx.flags); - var raw = args.value.toString(); - args.value.raw_source = rx.flags - ? raw.substring(0, raw.length - rx.flags.length) + rx.flags - : raw; - return new AST_RegExp(args); - } else if (rx) { - // support legacy RegExp - args.value = M.regex && M.raw ? M.raw : val; - return new AST_RegExp(args); - } - switch (typeof val) { - case "string": - args.value = val; - return new AST_String(args); - case "number": - args.value = val; - return new AST_Number(args); - case "boolean": - return new (val ? AST_True : AST_False)(args); - } - }, - MetaProperty: function(M) { - if (M.meta.name === "new" && M.property.name === "target") { - return new AST_NewTarget({ - start: my_start_token(M), - end: my_end_token(M) - }); - } - }, - Identifier: function(M) { - var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; - return new ( p.type == "LabeledStatement" ? AST_Label - : p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : p.kind == "let" ? AST_SymbolLet : AST_SymbolVar) - : /Import.*Specifier/.test(p.type) ? (p.local === M ? AST_SymbolImport : AST_SymbolImportForeign) - : p.type == "ExportSpecifier" ? (p.local === M ? AST_SymbolExport : AST_SymbolExportForeign) - : p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg) - : p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg) - : p.type == "ArrowFunctionExpression" ? (p.params.indexOf(M) !== -1) ? AST_SymbolFunarg : AST_SymbolRef - : p.type == "ClassExpression" ? (p.id === M ? AST_SymbolClass : AST_SymbolRef) - : p.type == "Property" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolMethod) - : p.type == "ClassDeclaration" ? (p.id === M ? AST_SymbolDefClass : AST_SymbolRef) - : p.type == "MethodDefinition" ? (p.computed ? AST_SymbolRef : AST_SymbolMethod) - : p.type == "CatchClause" ? AST_SymbolCatch - : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef - : AST_SymbolRef)({ - start : my_start_token(M), - end : my_end_token(M), - name : M.name - }); - } - }; - - MOZ_TO_ME.UpdateExpression = - MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) { - var prefix = "prefix" in M ? M.prefix - : M.type == "UnaryExpression" ? true : false; - return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ - start : my_start_token(M), - end : my_end_token(M), - operator : M.operator, - expression : from_moz(M.argument) - }); - }; - - MOZ_TO_ME.ClassDeclaration = - MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) { - return new (M.type === "ClassDeclaration" ? AST_DefClass : AST_ClassExpression)({ - start : my_start_token(M), - end : my_end_token(M), - name : from_moz(M.id), - extends : from_moz(M.superClass), - properties: M.body.body.map(from_moz) - }); - }; - - map("EmptyStatement", AST_EmptyStatement); - map("BlockStatement", AST_BlockStatement, "body@body"); - map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative"); - map("LabeledStatement", AST_LabeledStatement, "label>label, body>body"); - map("BreakStatement", AST_Break, "label>label"); - map("ContinueStatement", AST_Continue, "label>label"); - map("WithStatement", AST_With, "object>expression, body>body"); - map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body"); - map("ReturnStatement", AST_Return, "argument>value"); - map("ThrowStatement", AST_Throw, "argument>value"); - map("WhileStatement", AST_While, "test>condition, body>body"); - map("DoWhileStatement", AST_Do, "test>condition, body>body"); - map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body"); - map("ForInStatement", AST_ForIn, "left>init, right>object, body>body"); - map("ForOfStatement", AST_ForOf, "left>init, right>object, body>body, await=await"); - map("AwaitExpression", AST_Await, "argument>expression"); - map("YieldExpression", AST_Yield, "argument>expression, delegate=is_star"); - map("DebuggerStatement", AST_Debugger); - map("VariableDeclarator", AST_VarDef, "id>name, init>value"); - map("CatchClause", AST_Catch, "param>argname, body%body"); - - map("ThisExpression", AST_This); - map("Super", AST_Super); - map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right"); - map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative"); - map("NewExpression", AST_New, "callee>expression, arguments@args"); - map("CallExpression", AST_Call, "callee>expression, arguments@args"); - - def_to_moz(AST_Toplevel, function To_Moz_Program(M) { - return to_moz_scope("Program", M); - }); - - def_to_moz(AST_Expansion, function To_Moz_Spread(M, parent) { - return { - type: to_moz_in_destructuring() ? "RestElement" : "SpreadElement", - argument: to_moz(M.expression) - }; - }); - - def_to_moz(AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) { - return { - type: "TaggedTemplateExpression", - tag: to_moz(M.prefix), - quasi: to_moz(M.template_string) - }; - }); - - def_to_moz(AST_TemplateString, function To_Moz_TemplateLiteral(M) { - var quasis = []; - var expressions = []; - for (var i = 0; i < M.segments.length; i++) { - if (i % 2 !== 0) { - expressions.push(to_moz(M.segments[i])); - } else { - quasis.push({ - type: "TemplateElement", - value: { - raw: M.segments[i].raw, - cooked: M.segments[i].value - }, - tail: i === M.segments.length - 1 - }); - } - } - return { - type: "TemplateLiteral", - quasis: quasis, - expressions: expressions - }; - }); - - def_to_moz(AST_Defun, function To_Moz_FunctionDeclaration(M) { - return { - type: "FunctionDeclaration", - id: to_moz(M.name), - params: M.argnames.map(to_moz), - generator: M.is_generator, - async: M.async, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(AST_Function, function To_Moz_FunctionExpression(M, parent) { - var is_generator = parent.is_generator !== undefined ? - parent.is_generator : M.is_generator; - return { - type: "FunctionExpression", - id: to_moz(M.name), - params: M.argnames.map(to_moz), - generator: is_generator, - async: M.async, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(AST_Arrow, function To_Moz_ArrowFunctionExpression(M) { - var body = M.body instanceof Array ? { - type: "BlockStatement", - body: M.body.map(to_moz) - } : to_moz(M.body); - return { - type: "ArrowFunctionExpression", - params: M.argnames.map(to_moz), - async: M.async, - body: body - }; - }); - - def_to_moz(AST_Destructuring, function To_Moz_ObjectPattern(M) { - if (M.is_array) { - return { - type: "ArrayPattern", - elements: M.names.map(to_moz) - }; - } - return { - type: "ObjectPattern", - properties: M.names.map(to_moz) - }; - }); - - def_to_moz(AST_Directive, function To_Moz_Directive(M) { - return { - type: "ExpressionStatement", - expression: { - type: "Literal", - value: M.value - } - }; - }); - - def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) { - return { - type: "ExpressionStatement", - expression: to_moz(M.body) - }; - }); - - def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) { - return { - type: "SwitchCase", - test: to_moz(M.expression), - consequent: M.body.map(to_moz) - }; - }); - - def_to_moz(AST_Try, function To_Moz_TryStatement(M) { - return { - type: "TryStatement", - block: to_moz_block(M), - handler: to_moz(M.bcatch), - guardedHandlers: [], - finalizer: to_moz(M.bfinally) - }; - }); - - def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { - return { - type: "CatchClause", - param: to_moz(M.argname), - guard: null, - body: to_moz_block(M) - }; - }); - - def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) { - return { - type: "VariableDeclaration", - kind: - M instanceof AST_Const ? "const" : - M instanceof AST_Let ? "let" : "var", - declarations: M.definitions.map(to_moz) - }; - }); - - def_to_moz(AST_Export, function To_Moz_ExportDeclaration(M) { - if (M.exported_names) { - if (M.exported_names[0].name.name === "*") { - return { - type: "ExportAllDeclaration", - source: to_moz(M.module_name) - }; - } - return { - type: "ExportNamedDeclaration", - specifiers: M.exported_names.map(function (name_mapping) { - return { - type: "ExportSpecifier", - exported: to_moz(name_mapping.foreign_name), - local: to_moz(name_mapping.name) - }; - }), - declaration: to_moz(M.exported_definition), - source: to_moz(M.module_name) - }; - } - return { - type: M.is_default ? "ExportDefaultDeclaration" : "ExportNamedDeclaration", - declaration: to_moz(M.exported_value || M.exported_definition) - }; - }); - - def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) { - var specifiers = []; - if (M.imported_name) { - specifiers.push({ - type: "ImportDefaultSpecifier", - local: to_moz(M.imported_name) - }); - } - if (M.imported_names && M.imported_names[0].foreign_name.name === "*") { - specifiers.push({ - type: "ImportNamespaceSpecifier", - local: to_moz(M.imported_names[0].name) - }); - } else if (M.imported_names) { - M.imported_names.forEach(function(name_mapping) { - specifiers.push({ - type: "ImportSpecifier", - local: to_moz(name_mapping.name), - imported: to_moz(name_mapping.foreign_name) - }); - }); - } - return { - type: "ImportDeclaration", - specifiers: specifiers, - source: to_moz(M.module_name) - }; - }); - - def_to_moz(AST_Sequence, function To_Moz_SequenceExpression(M) { - return { - type: "SequenceExpression", - expressions: M.expressions.map(to_moz) - }; - }); - - def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) { - var isComputed = M instanceof AST_Sub; - return { - type: "MemberExpression", - object: to_moz(M.expression), - computed: isComputed, - property: isComputed ? to_moz(M.property) : {type: "Identifier", name: M.property} - }; - }); - - def_to_moz(AST_Unary, function To_Moz_Unary(M) { - return { - type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression", - operator: M.operator, - prefix: M instanceof AST_UnaryPrefix, - argument: to_moz(M.expression) - }; - }); - - def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { - if (M.operator == "=" && to_moz_in_destructuring()) { - return { - type: "AssignmentPattern", - left: to_moz(M.left), - right: to_moz(M.right) - }; - } - return { - type: M.operator == "&&" || M.operator == "||" ? "LogicalExpression" : "BinaryExpression", - left: to_moz(M.left), - operator: M.operator, - right: to_moz(M.right) - }; - }); - - def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) { - return { - type: "ArrayExpression", - elements: M.elements.map(to_moz) - }; - }); - - def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) { - return { - type: "ObjectExpression", - properties: M.properties.map(to_moz) - }; - }); - - def_to_moz(AST_ObjectProperty, function To_Moz_Property(M, parent) { - var key = M.key instanceof AST_Node ? to_moz(M.key) : { - type: "Identifier", - value: M.key - }; - if (typeof M.key === "number") { - key = { - type: "Literal", - value: Number(M.key) - }; - } - if (typeof M.key === "string") { - key = { - type: "Identifier", - name: M.key - }; - } - var kind; - var string_or_num = typeof M.key === "string" || typeof M.key === "number"; - var computed = string_or_num ? false : !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef; - if (M instanceof AST_ObjectKeyVal) { - kind = "init"; - computed = !string_or_num; - } else - if (M instanceof AST_ObjectGetter) { - kind = "get"; - } else - if (M instanceof AST_ObjectSetter) { - kind = "set"; - } - if (parent instanceof AST_Class) { - return { - type: "MethodDefinition", - computed: computed, - kind: kind, - static: M.static, - key: to_moz(M.key), - value: to_moz(M.value) - }; - } - return { - type: "Property", - computed: computed, - kind: kind, - key: key, - value: to_moz(M.value) - }; - }); - - def_to_moz(AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) { - if (parent instanceof AST_Object) { - return { - type: "Property", - computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, - kind: "init", - method: true, - shorthand: false, - key: to_moz(M.key), - value: to_moz(M.value) - }; - } - return { - type: "MethodDefinition", - computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, - kind: M.key === "constructor" ? "constructor" : "method", - static: M.static, - key: to_moz(M.key), - value: to_moz(M.value) - }; - }); - - def_to_moz(AST_Class, function To_Moz_Class(M) { - var type = M instanceof AST_ClassExpression ? "ClassExpression" : "ClassDeclaration"; - return { - type: type, - superClass: to_moz(M.extends), - id: M.name ? to_moz(M.name) : null, - body: { - type: "ClassBody", - body: M.properties.map(to_moz) - } - }; - }); - - def_to_moz(AST_NewTarget, function To_Moz_MetaProperty(M) { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "new" - }, - property: { - type: "Identifier", - name: "target" - } - }; - }); - - def_to_moz(AST_Symbol, function To_Moz_Identifier(M, parent) { - if (M instanceof AST_SymbolMethod && parent.quote) { - return { - type: "Literal", - value: M.name - }; - } - var def = M.definition(); - return { - type: "Identifier", - name: def ? def.mangled_name || def.name : M.name - }; - }); - - def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) { - var pattern = M.value.source; - var flags = M.value.toString().match(/[gimuys]*$/)[0]; - return { - type: "Literal", - value: new RegExp(pattern, flags), - raw: M.value.raw_source, - regex: { - pattern: pattern, - flags: flags, - } - }; - }); - - def_to_moz(AST_Constant, function To_Moz_Literal(M) { - var value = M.value; - if (typeof value === "number" && (value < 0 || (value === 0 && 1 / value < 0))) { - return { - type: "UnaryExpression", - operator: "-", - prefix: true, - argument: { - type: "Literal", - value: -value, - raw: M.start.raw - } - }; - } - return { - type: "Literal", - value: value, - raw: M.start.raw - }; - }); - - def_to_moz(AST_Atom, function To_Moz_Atom(M) { - return { - type: "Identifier", - name: String(M.value) - }; - }); - - AST_Boolean.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); - AST_Null.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); - AST_Hole.DEFMETHOD("to_mozilla_ast", function To_Moz_ArrayHole() { return null; }); - - AST_Block.DEFMETHOD("to_mozilla_ast", AST_BlockStatement.prototype.to_mozilla_ast); - AST_Lambda.DEFMETHOD("to_mozilla_ast", AST_Function.prototype.to_mozilla_ast); - - /* -----[ tools ]----- */ - - function raw_token(moznode) { - if (moznode.type == "Literal") { - return moznode.raw != null ? moznode.raw : moznode.value + ""; - } - } - - function my_start_token(moznode) { - var loc = moznode.loc, start = loc && loc.start; - var range = moznode.range; - return new AST_Token({ - file : loc && loc.source, - line : start && start.line, - col : start && start.column, - pos : range ? range[0] : moznode.start, - endline : start && start.line, - endcol : start && start.column, - endpos : range ? range[0] : moznode.start, - raw : raw_token(moznode), - }); - } - - function my_end_token(moznode) { - var loc = moznode.loc, end = loc && loc.end; - var range = moznode.range; - return new AST_Token({ - file : loc && loc.source, - line : end && end.line, - col : end && end.column, - pos : range ? range[1] : moznode.end, - endline : end && end.line, - endcol : end && end.column, - endpos : range ? range[1] : moznode.end, - raw : raw_token(moznode), - }); - } - - function map(moztype, mytype, propmap) { - var moz_to_me = "function From_Moz_" + moztype + "(M){\n"; - moz_to_me += "return new U2." + mytype.name + "({\n" + - "start: my_start_token(M),\n" + - "end: my_end_token(M)"; - - var me_to_moz = "function To_Moz_" + moztype + "(M){\n"; - me_to_moz += "return {\n" + - "type: " + JSON.stringify(moztype); - - if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop) { - var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop); - if (!m) throw new Error("Can't understand property map: " + prop); - var moz = m[1], how = m[2], my = m[3]; - moz_to_me += ",\n" + my + ": "; - me_to_moz += ",\n" + moz + ": "; - switch (how) { - case "@": - moz_to_me += "M." + moz + ".map(from_moz)"; - me_to_moz += "M." + my + ".map(to_moz)"; - break; - case ">": - moz_to_me += "from_moz(M." + moz + ")"; - me_to_moz += "to_moz(M." + my + ")"; - break; - case "=": - moz_to_me += "M." + moz; - me_to_moz += "M." + my; - break; - case "%": - moz_to_me += "from_moz(M." + moz + ").body"; - me_to_moz += "to_moz_block(M)"; - break; - default: - throw new Error("Can't understand operator in propmap: " + prop); - } - }); - - moz_to_me += "\n})\n}"; - me_to_moz += "\n}\n}"; - - //moz_to_me = parse(moz_to_me).print_to_string({ beautify: true }); - //me_to_moz = parse(me_to_moz).print_to_string({ beautify: true }); - //console.log(moz_to_me); - - moz_to_me = new Function("U2", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")( - exports, my_start_token, my_end_token, from_moz - ); - me_to_moz = new Function("to_moz", "to_moz_block", "to_moz_scope", "return(" + me_to_moz + ")")( - to_moz, to_moz_block, to_moz_scope - ); - MOZ_TO_ME[moztype] = moz_to_me; - def_to_moz(mytype, me_to_moz); - } - - var FROM_MOZ_STACK = null; - - function from_moz(node) { - FROM_MOZ_STACK.push(node); - var ret = node != null ? MOZ_TO_ME[node.type](node) : null; - FROM_MOZ_STACK.pop(); - return ret; - } - - AST_Node.from_mozilla_ast = function(node) { - var save_stack = FROM_MOZ_STACK; - FROM_MOZ_STACK = []; - var ast = from_moz(node); - FROM_MOZ_STACK = save_stack; - return ast; - }; - - function set_moz_loc(mynode, moznode, myparent) { - var start = mynode.start; - var end = mynode.end; - if (start.pos != null && end.endpos != null) { - moznode.range = [start.pos, end.endpos]; - } - if (start.line) { - moznode.loc = { - start: {line: start.line, column: start.col}, - end: end.endline ? {line: end.endline, column: end.endcol} : null - }; - if (start.file) { - moznode.loc.source = start.file; - } - } - return moznode; - } - - function def_to_moz(mytype, handler) { - mytype.DEFMETHOD("to_mozilla_ast", function(parent) { - return set_moz_loc(this, handler(this, parent)); - }); - } - - var TO_MOZ_STACK = null; - - function to_moz(node) { - if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; } - TO_MOZ_STACK.push(node); - var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null; - TO_MOZ_STACK.pop(); - if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; } - return ast; - } - - function to_moz_in_destructuring() { - var i = TO_MOZ_STACK.length; - while (i--) { - if (TO_MOZ_STACK[i] instanceof AST_Destructuring) { - return true; - } - } - return false; - } - - function to_moz_block(node) { - return { - type: "BlockStatement", - body: node.body.map(to_moz) - }; - } - - function to_moz_scope(type, node) { - var body = node.body.map(to_moz); - if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) { - body.unshift(to_moz(new AST_EmptyStatement(node.body[0]))); - } - return { - type: type, - body: body - }; - } -})(); diff --git a/tools/node_modules/terser/lib/output.js b/tools/node_modules/terser/lib/output.js deleted file mode 100644 index dbc35dc1b9d1..000000000000 --- a/tools/node_modules/terser/lib/output.js +++ /dev/null @@ -1,1939 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -var EXPECT_DIRECTIVE = /^$|[;{][\s\n]*$/; - -function is_some_comments(comment) { - // multiline comment - return comment.type == "comment2" && /@preserve|@license|@cc_on/i.test(comment.value); -} - -function OutputStream(options) { - - var readonly = !options; - options = defaults(options, { - ascii_only : false, - beautify : false, - braces : false, - comments : false, - ecma : 5, - ie8 : false, - indent_level : 4, - indent_start : 0, - inline_script : true, - keep_quoted_props: false, - max_line_len : false, - preamble : null, - quote_keys : false, - quote_style : 0, - safari10 : false, - semicolons : true, - shebang : true, - shorthand : undefined, - source_map : null, - webkit : false, - width : 80, - wrap_iife : false, - }, true); - - if (options.shorthand === undefined) - options.shorthand = options.ecma > 5; - - // Convert comment option to RegExp if neccessary and set up comments filter - var comment_filter = return_false; // Default case, throw all comments away - if (options.comments) { - var comments = options.comments; - if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { - var regex_pos = options.comments.lastIndexOf("/"); - comments = new RegExp( - options.comments.substr(1, regex_pos - 1), - options.comments.substr(regex_pos + 1) - ); - } - if (comments instanceof RegExp) { - comment_filter = function(comment) { - return comment.type != "comment5" && comments.test(comment.value); - }; - } else if (typeof comments === "function") { - comment_filter = function(comment) { - return comment.type != "comment5" && comments(this, comment); - }; - } else if (comments === "some") { - comment_filter = is_some_comments; - } else { // NOTE includes "all" option - comment_filter = return_true; - } - } - - var indentation = 0; - var current_col = 0; - var current_line = 1; - var current_pos = 0; - var OUTPUT = ""; - - var to_utf8 = options.ascii_only ? function(str, identifier) { - if (options.ecma >= 6) { - str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { - var code = get_full_char_code(ch, 0).toString(16); - return "\\u{" + code + "}"; - }); - } - return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - if (code.length <= 2 && !identifier) { - while (code.length < 2) code = "0" + code; - return "\\x" + code; - } else { - while (code.length < 4) code = "0" + code; - return "\\u" + code; - } - }); - } : function(str) { - var s = ""; - for (var i = 0, len = str.length; i < len; i++) { - if (is_surrogate_pair_head(str[i]) && !is_surrogate_pair_tail(str[i + 1]) - || is_surrogate_pair_tail(str[i]) && !is_surrogate_pair_head(str[i - 1])) { - s += "\\u" + str.charCodeAt(i).toString(16); - } else { - s += str[i]; - } - } - return s; - }; - - function make_string(str, quote) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, - function(s, i) { - switch (s) { - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - case "\\": return "\\\\"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\\t"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\x0B": return options.ie8 ? "\\x0B" : "\\v"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case "\ufeff": return "\\ufeff"; - case "\0": - return /[0-9]/.test(get_full_char(str, i+1)) ? "\\x00" : "\\0"; - } - return s; - }); - function quote_single() { - return "'" + str.replace(/\x27/g, "\\'") + "'"; - } - function quote_double() { - return '"' + str.replace(/\x22/g, '\\"') + '"'; - } - function quote_template() { - return "`" + str.replace(/`/g, "\\`") + "`"; - } - str = to_utf8(str); - if (quote === "`") return quote_template(); - switch (options.quote_style) { - case 1: - return quote_single(); - case 2: - return quote_double(); - case 3: - return quote == "'" ? quote_single() : quote_double(); - default: - return dq > sq ? quote_single() : quote_double(); - } - } - - function encode_string(str, quote) { - var ret = make_string(str, quote); - if (options.inline_script) { - ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); - ret = ret.replace(/\x3c!--/g, "\\x3c!--"); - ret = ret.replace(/--\x3e/g, "--\\x3e"); - } - return ret; - } - - function make_name(name) { - name = name.toString(); - name = to_utf8(name, true); - return name; - } - - function make_indent(back) { - return repeat_string(" ", options.indent_start + indentation - back * options.indent_level); - } - - /* -----[ beautification/minification ]----- */ - - var has_parens = false; - var might_need_space = false; - var might_need_semicolon = false; - var might_add_newline = 0; - var need_newline_indented = false; - var need_space = false; - var newline_insert = -1; - var last = ""; - var mapping_token, mapping_name, mappings = options.source_map && []; - - var do_add_mapping = mappings ? function() { - mappings.forEach(function(mapping) { - try { - options.source_map.add( - mapping.token.file, - mapping.line, mapping.col, - mapping.token.line, mapping.token.col, - !mapping.name && mapping.token.type == "name" ? mapping.token.value : mapping.name - ); - } catch(ex) { - mapping.token.file != null && AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", { - file: mapping.token.file, - line: mapping.token.line, - col: mapping.token.col, - cline: mapping.line, - ccol: mapping.col, - name: mapping.name || "" - }); - } - }); - mappings = []; - } : noop; - - var ensure_line_len = options.max_line_len ? function() { - if (current_col > options.max_line_len) { - if (might_add_newline) { - var left = OUTPUT.slice(0, might_add_newline); - var right = OUTPUT.slice(might_add_newline); - if (mappings) { - var delta = right.length - current_col; - mappings.forEach(function(mapping) { - mapping.line++; - mapping.col += delta; - }); - } - OUTPUT = left + "\n" + right; - current_line++; - current_pos++; - current_col = right.length; - } - if (current_col > options.max_line_len) { - AST_Node.warn("Output exceeds {max_line_len} characters", options); - } - } - if (might_add_newline) { - might_add_newline = 0; - do_add_mapping(); - } - } : noop; - - var requireSemicolonChars = makePredicate("( [ + * / - , . `"); - - function print(str) { - str = String(str); - var ch = get_full_char(str, 0); - var prev = get_full_char(last, last.length - 1); - if (need_newline_indented && ch) { - need_newline_indented = false; - if (ch != "\n") { - print("\n"); - indent(); - } - } - if (need_space && ch) { - need_space = false; - if (!/[\s;})]/.test(ch)) { - space(); - } - } - newline_insert = -1; - var prev = last.charAt(last.length - 1); - if (might_need_semicolon) { - might_need_semicolon = false; - - if (prev == ":" && ch == "}" || (!ch || ";}".indexOf(ch) < 0) && prev != ";") { - if (options.semicolons || requireSemicolonChars(ch)) { - OUTPUT += ";"; - current_col++; - current_pos++; - } else { - ensure_line_len(); - OUTPUT += "\n"; - current_pos++; - current_line++; - current_col = 0; - - if (/^\s+$/.test(str)) { - // reset the semicolon flag, since we didn't print one - // now and might still have to later - might_need_semicolon = true; - } - } - - if (!options.beautify) - might_need_space = false; - } - } - - if (might_need_space) { - if ((is_identifier_char(prev) - && (is_identifier_char(ch) || ch == "\\")) - || (ch == "/" && ch == prev) - || ((ch == "+" || ch == "-") && ch == last) - ) { - OUTPUT += " "; - current_col++; - current_pos++; - } - might_need_space = false; - } - - if (mapping_token) { - mappings.push({ - token: mapping_token, - name: mapping_name, - line: current_line, - col: current_col - }); - mapping_token = false; - if (!might_add_newline) do_add_mapping(); - } - - OUTPUT += str; - has_parens = str[str.length - 1] == "("; - current_pos += str.length; - var a = str.split(/\r?\n/), n = a.length - 1; - current_line += n; - current_col += a[0].length; - if (n > 0) { - ensure_line_len(); - current_col = a[n].length; - } - last = str; - } - - var star = function() { - print("*"); - }; - - var space = options.beautify ? function() { - print(" "); - } : function() { - might_need_space = true; - }; - - var indent = options.beautify ? function(half) { - if (options.beautify) { - print(make_indent(half ? 0.5 : 0)); - } - } : noop; - - var with_indent = options.beautify ? function(col, cont) { - if (col === true) col = next_indent(); - var save_indentation = indentation; - indentation = col; - var ret = cont(); - indentation = save_indentation; - return ret; - } : function(col, cont) { return cont(); }; - - var newline = options.beautify ? function() { - if (newline_insert < 0) return print("\n"); - if (OUTPUT[newline_insert] != "\n") { - OUTPUT = OUTPUT.slice(0, newline_insert) + "\n" + OUTPUT.slice(newline_insert); - current_pos++; - current_line++; - } - newline_insert++; - } : options.max_line_len ? function() { - ensure_line_len(); - might_add_newline = OUTPUT.length; - } : noop; - - var semicolon = options.beautify ? function() { - print(";"); - } : function() { - might_need_semicolon = true; - }; - - function force_semicolon() { - might_need_semicolon = false; - print(";"); - } - - function next_indent() { - return indentation + options.indent_level; - } - - function with_block(cont) { - var ret; - print("{"); - newline(); - with_indent(next_indent(), function() { - ret = cont(); - }); - indent(); - print("}"); - return ret; - } - - function with_parens(cont) { - print("("); - //XXX: still nice to have that for argument lists - //var ret = with_indent(current_col, cont); - var ret = cont(); - print(")"); - return ret; - } - - function with_square(cont) { - print("["); - //var ret = with_indent(current_col, cont); - var ret = cont(); - print("]"); - return ret; - } - - function comma() { - print(","); - space(); - } - - function colon() { - print(":"); - space(); - } - - var add_mapping = mappings ? function(token, name) { - mapping_token = token; - mapping_name = name; - } : noop; - - function get() { - if (might_add_newline) { - ensure_line_len(); - } - return OUTPUT; - } - - function has_nlb() { - var index = OUTPUT.lastIndexOf("\n"); - return /^ *$/.test(OUTPUT.slice(index + 1)); - } - - function prepend_comments(node) { - var self = this; - var start = node.start; - if (!start) return; - if (start.comments_before && start.comments_before._dumped === self) return; - var comments = start.comments_before; - if (!comments) { - comments = start.comments_before = []; - } - comments._dumped = self; - - if (node instanceof AST_Exit && node.value) { - var tw = new TreeWalker(function(node) { - var parent = tw.parent(); - if (parent instanceof AST_Exit - || parent instanceof AST_Binary && parent.left === node - || parent.TYPE == "Call" && parent.expression === node - || parent instanceof AST_Conditional && parent.condition === node - || parent instanceof AST_Dot && parent.expression === node - || parent instanceof AST_Sequence && parent.expressions[0] === node - || parent instanceof AST_Sub && parent.expression === node - || parent instanceof AST_UnaryPostfix) { - if (!node.start) return; - var text = node.start.comments_before; - if (text && text._dumped !== self) { - text._dumped = self; - comments = comments.concat(text); - } - } else { - return true; - } - }); - tw.push(node); - node.value.walk(tw); - } - - if (current_pos == 0) { - if (comments.length > 0 && options.shebang && comments[0].type == "comment5") { - print("#!" + comments.shift().value + "\n"); - indent(); - } - var preamble = options.preamble; - if (preamble) { - print(preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n")); - } - } - - comments = comments.filter(comment_filter, node); - if (comments.length == 0) return; - var last_nlb = has_nlb(); - comments.forEach(function(c, i) { - if (!last_nlb) { - if (c.nlb) { - print("\n"); - indent(); - last_nlb = true; - } else if (i > 0) { - space(); - } - } - if (/comment[134]/.test(c.type)) { - print("//" + c.value.replace(/[@#]__PURE__/g, " ") + "\n"); - indent(); - last_nlb = true; - } else if (c.type == "comment2") { - print("/*" + c.value.replace(/[@#]__PURE__/g, " ") + "*/"); - last_nlb = false; - } - }); - if (!last_nlb) { - if (start.nlb) { - print("\n"); - indent(); - } else { - space(); - } - } - } - - function append_comments(node, tail) { - var self = this; - var token = node.end; - if (!token) return; - var comments = token[tail ? "comments_before" : "comments_after"]; - if (!comments || comments._dumped === self) return; - if (!(node instanceof AST_Statement || all(comments, function(c) { - return !/comment[134]/.test(c.type); - }))) return; - comments._dumped = self; - var insert = OUTPUT.length; - comments.filter(comment_filter, node).forEach(function(c, i) { - need_space = false; - if (need_newline_indented) { - print("\n"); - indent(); - need_newline_indented = false; - } else if (c.nlb && (i > 0 || !has_nlb())) { - print("\n"); - indent(); - } else if (i > 0 || !tail) { - space(); - } - if (/comment[134]/.test(c.type)) { - print("//" + c.value.replace(/[@#]__PURE__/g, " ")); - need_newline_indented = true; - } else if (c.type == "comment2") { - print("/*" + c.value.replace(/[@#]__PURE__/g, " ") + "*/"); - need_space = true; - } - }); - if (OUTPUT.length > insert) newline_insert = insert; - } - - var stack = []; - return { - get : get, - toString : get, - indent : indent, - indentation : function() { return indentation; }, - current_width : function() { return current_col - indentation; }, - should_break : function() { return options.width && this.current_width() >= options.width; }, - has_parens : function() { return has_parens; }, - newline : newline, - print : print, - star : star, - space : space, - comma : comma, - colon : colon, - last : function() { return last; }, - semicolon : semicolon, - force_semicolon : force_semicolon, - to_utf8 : to_utf8, - print_name : function(name) { print(make_name(name)); }, - print_string : function(str, quote, escape_directive) { - var encoded = encode_string(str, quote); - if (escape_directive === true && encoded.indexOf("\\") === -1) { - // Insert semicolons to break directive prologue - if (!EXPECT_DIRECTIVE.test(OUTPUT)) { - force_semicolon(); - } - force_semicolon(); - } - print(encoded); - }, - print_template_string_chars: function(str) { - var encoded = encode_string(str, "`").replace(/\${/g, "\\${"); - return print(encoded.substr(1, encoded.length - 2)); - }, - encode_string : encode_string, - next_indent : next_indent, - with_indent : with_indent, - with_block : with_block, - with_parens : with_parens, - with_square : with_square, - add_mapping : add_mapping, - option : function(opt) { return options[opt]; }, - prepend_comments: readonly ? noop : prepend_comments, - append_comments : readonly || comment_filter === return_false ? noop : append_comments, - line : function() { return current_line; }, - col : function() { return current_col; }, - pos : function() { return current_pos; }, - push_node : function(node) { stack.push(node); }, - pop_node : function() { return stack.pop(); }, - parent : function(n) { - return stack[stack.length - 2 - (n || 0)]; - } - }; - -} - -/* -----[ code generators ]----- */ - -(function() { - - /* -----[ utils ]----- */ - - function DEFPRINT(nodetype, generator) { - nodetype.DEFMETHOD("_codegen", generator); - } - - var in_directive = false; - var active_scope = null; - var use_asm = null; - - AST_Node.DEFMETHOD("print", function(stream, force_parens) { - var self = this, generator = self._codegen; - if (self instanceof AST_Scope) { - active_scope = self; - } else if (!use_asm && self instanceof AST_Directive && self.value == "use asm") { - use_asm = active_scope; - } - function doit() { - stream.prepend_comments(self); - self.add_source_map(stream); - generator(self, stream); - stream.append_comments(self); - } - stream.push_node(self); - if (force_parens || self.needs_parens(stream)) { - stream.with_parens(doit); - } else { - doit(); - } - stream.pop_node(); - if (self === use_asm) { - use_asm = null; - } - }); - AST_Node.DEFMETHOD("_print", AST_Node.prototype.print); - - AST_Node.DEFMETHOD("print_to_string", function(options) { - var s = OutputStream(options); - this.print(s); - return s.get(); - }); - - /* -----[ PARENTHESES ]----- */ - - function PARENS(nodetype, func) { - if (Array.isArray(nodetype)) { - nodetype.forEach(function(nodetype) { - PARENS(nodetype, func); - }); - } else { - nodetype.DEFMETHOD("needs_parens", func); - } - } - - PARENS(AST_Node, return_false); - - // a function expression needs parens around it when it's provably - // the first token to appear in a statement. - PARENS(AST_Function, function(output) { - if (!output.has_parens() && first_in_statement(output)) { - return true; - } - - if (output.option("webkit")) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - return true; - } - } - - if (output.option("wrap_iife")) { - var p = output.parent(); - return p instanceof AST_Call && p.expression === this; - } - - return false; - }); - - PARENS(AST_Arrow, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this; - }); - - // same goes for an object literal, because otherwise it would be - // interpreted as a block of code. - PARENS(AST_Object, function(output) { - return !output.has_parens() && first_in_statement(output); - }); - - PARENS(AST_ClassExpression, first_in_statement); - - PARENS(AST_Unary, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Call && p.expression === this - || p instanceof AST_Binary - && p.operator === "**" - && this instanceof AST_UnaryPrefix - && p.left === this - && this.operator !== "++" - && this.operator !== "--"; - }); - - PARENS(AST_Await, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Call && p.expression === this - || output.option("safari10") && p instanceof AST_UnaryPrefix; - }); - - PARENS(AST_Sequence, function(output) { - var p = output.parent(); - return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) - || p instanceof AST_Unary // !(foo, bar, baz) - || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8 - || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4 - || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2 - || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ] - || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2 - || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30) - * ==> 20 (side effect, set a := 10 and b := 20) */ - || p instanceof AST_Arrow // x => (x, x) - || p instanceof AST_DefaultAssign // x => (x = (0, function(){})) - || p instanceof AST_Expansion // [...(a, b)] - || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {} - || p instanceof AST_Yield // yield (foo, bar) - || p instanceof AST_Export // export default (foo, bar) - ; - }); - - PARENS(AST_Binary, function(output) { - var p = output.parent(); - // (foo && bar)() - if (p instanceof AST_Call && p.expression === this) - return true; - // typeof (foo && bar) - if (p instanceof AST_Unary) - return true; - // (foo && bar)["prop"], (foo && bar).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - // this deals with precedence: 3 * (2 + 1) - if (p instanceof AST_Binary) { - var po = p.operator, pp = PRECEDENCE[po]; - var so = this.operator, sp = PRECEDENCE[so]; - if (pp > sp - || (pp == sp - && (this === p.right || po == "**"))) { - return true; - } - } - }); - - PARENS(AST_Yield, function(output) { - var p = output.parent(); - // (yield 1) + (yield 2) - // a = yield 3 - if (p instanceof AST_Binary && p.operator !== "=") - return true; - // (yield 1)() - // new (yield 1)() - if (p instanceof AST_Call && p.expression === this) - return true; - // (yield 1) ? yield 2 : yield 3 - if (p instanceof AST_Conditional && p.condition === this) - return true; - // -(yield 4) - if (p instanceof AST_Unary) - return true; - // (yield x).foo - // (yield x)['foo'] - if (p instanceof AST_PropAccess && p.expression === this) - return true; - }); - - PARENS(AST_PropAccess, function(output) { - var p = output.parent(); - if (p instanceof AST_New && p.expression === this) { - // i.e. new (foo.bar().baz) - // - // if there's one call into this subtree, then we need - // parens around it too, otherwise the call will be - // interpreted as passing the arguments to the upper New - // expression. - var parens = false; - this.walk(new TreeWalker(function(node) { - if (parens || node instanceof AST_Scope) return true; - if (node instanceof AST_Call) { - parens = true; - return true; - } - })); - return parens; - } - }); - - PARENS(AST_Call, function(output) { - var p = output.parent(), p1; - if (p instanceof AST_New && p.expression === this - || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function) - return true; - - // workaround for Safari bug. - // https://bugs.webkit.org/show_bug.cgi?id=123506 - return this.expression instanceof AST_Function - && p instanceof AST_PropAccess - && p.expression === this - && (p1 = output.parent(1)) instanceof AST_Assign - && p1.left === p; - }); - - PARENS(AST_New, function(output) { - var p = output.parent(); - if (!need_constructor_parens(this, output) - && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() - || p instanceof AST_Call && p.expression === this)) // (new foo)(bar) - return true; - }); - - PARENS(AST_Number, function(output) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - var value = this.getValue(); - if (value < 0 || /^0/.test(make_num(value))) { - return true; - } - } - }); - - PARENS([ AST_Assign, AST_Conditional ], function(output) { - var p = output.parent(); - // !(a = false) → true - if (p instanceof AST_Unary) - return true; - // 1 + (a = 2) + 3 → 6, side effect setting a = 2 - if (p instanceof AST_Binary && !(p instanceof AST_Assign)) - return true; - // (a = func)() —or— new (a = Object)() - if (p instanceof AST_Call && p.expression === this) - return true; - // (a = foo) ? bar : baz - if (p instanceof AST_Conditional && p.condition === this) - return true; - // (a = foo)["prop"] —or— (a = foo).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - // ({a, b} = {a: 1, b: 2}), a destructuring assignment - if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false) - return true; - }); - - /* -----[ PRINTERS ]----- */ - - DEFPRINT(AST_Directive, function(self, output) { - output.print_string(self.value, self.quote); - output.semicolon(); - }); - - DEFPRINT(AST_Expansion, function (self, output) { - output.print("..."); - self.expression.print(output); - }); - - DEFPRINT(AST_Destructuring, function (self, output) { - output.print(self.is_array ? "[" : "{"); - var len = self.names.length; - self.names.forEach(function (name, i) { - if (i > 0) output.comma(); - name.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i == len - 1 && name instanceof AST_Hole) output.comma(); - }); - output.print(self.is_array ? "]" : "}"); - }); - - DEFPRINT(AST_Debugger, function(self, output) { - output.print("debugger"); - output.semicolon(); - }); - - /* -----[ statements ]----- */ - - function display_body(body, is_toplevel, output, allow_directives) { - var last = body.length - 1; - in_directive = allow_directives; - body.forEach(function(stmt, i) { - if (in_directive === true && !(stmt instanceof AST_Directive || - stmt instanceof AST_EmptyStatement || - (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String) - )) { - in_directive = false; - } - if (!(stmt instanceof AST_EmptyStatement)) { - output.indent(); - stmt.print(output); - if (!(i == last && is_toplevel)) { - output.newline(); - if (is_toplevel) output.newline(); - } - } - if (in_directive === true && - stmt instanceof AST_SimpleStatement && - stmt.body instanceof AST_String - ) { - in_directive = false; - } - }); - in_directive = false; - } - - AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { - force_statement(this.body, output); - }); - - DEFPRINT(AST_Statement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - DEFPRINT(AST_Toplevel, function(self, output) { - display_body(self.body, true, output, true); - output.print(""); - }); - DEFPRINT(AST_LabeledStatement, function(self, output) { - self.label.print(output); - output.colon(); - self.body.print(output); - }); - DEFPRINT(AST_SimpleStatement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - function print_braced_empty(self, output) { - output.print("{"); - output.with_indent(output.next_indent(), function() { - output.append_comments(self, true); - }); - output.print("}"); - } - function print_braced(self, output, allow_directives) { - if (self.body.length > 0) { - output.with_block(function() { - display_body(self.body, false, output, allow_directives); - }); - } else print_braced_empty(self, output); - } - DEFPRINT(AST_BlockStatement, function(self, output) { - print_braced(self, output); - }); - DEFPRINT(AST_EmptyStatement, function(self, output) { - output.semicolon(); - }); - DEFPRINT(AST_Do, function(self, output) { - output.print("do"); - output.space(); - make_block(self.body, output); - output.space(); - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.semicolon(); - }); - DEFPRINT(AST_While, function(self, output) { - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_For, function(self, output) { - output.print("for"); - output.space(); - output.with_parens(function() { - if (self.init) { - if (self.init instanceof AST_Definitions) { - self.init.print(output); - } else { - parenthesize_for_noin(self.init, output, true); - } - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.condition) { - self.condition.print(output); - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.step) { - self.step.print(output); - } - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_ForIn, function(self, output) { - output.print("for"); - if (self.await) { - output.space(); - output.print("await"); - } - output.space(); - output.with_parens(function() { - self.init.print(output); - output.space(); - output.print(self instanceof AST_ForOf ? "of" : "in"); - output.space(); - self.object.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_With, function(self, output) { - output.print("with"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - self._do_print_body(output); - }); - - /* -----[ functions ]----- */ - AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { - var self = this; - if (!nokeyword) { - if (self.async) { - output.print("async"); - output.space(); - } - output.print("function"); - if (self.is_generator) { - output.star(); - } - if (self.name) { - output.space(); - } - } - if (self.name instanceof AST_Symbol) { - self.name.print(output); - } else if (nokeyword && self.name instanceof AST_Node) { - output.with_square(function() { - self.name.print(output); // Computed method name - }); - } - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - output.space(); - print_braced(self, output, true); - }); - DEFPRINT(AST_Lambda, function(self, output) { - self._do_print(output); - }); - - DEFPRINT(AST_PrefixedTemplateString, function(self, output) { - var tag = self.prefix; - var parenthesize_tag = tag instanceof AST_Arrow - || tag instanceof AST_Binary - || tag instanceof AST_Conditional - || tag instanceof AST_Sequence - || tag instanceof AST_Unary; - if (parenthesize_tag) output.print("("); - self.prefix.print(output); - if (parenthesize_tag) output.print(")"); - self.template_string.print(output); - }); - DEFPRINT(AST_TemplateString, function(self, output) { - var is_tagged = output.parent() instanceof AST_PrefixedTemplateString; - - output.print("`"); - for (var i = 0; i < self.segments.length; i++) { - if (!(self.segments[i] instanceof AST_TemplateSegment)) { - output.print("${"); - self.segments[i].print(output); - output.print("}"); - } else if (is_tagged) { - output.print(self.segments[i].raw); - } else { - output.print_template_string_chars(self.segments[i].value); - } - } - output.print("`"); - }); - - AST_Arrow.DEFMETHOD("_do_print", function(output) { - var self = this; - var parent = output.parent(); - var needs_parens = parent instanceof AST_Binary || - parent instanceof AST_Unary || - (parent instanceof AST_Call && self === parent.expression); - if (needs_parens) { output.print("("); } - if (self.async) { - output.print("async"); - output.space(); - } - if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) { - self.argnames[0].print(output); - } else { - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - } - output.space(); - output.print("=>"); - output.space(); - if (self.body instanceof AST_Node) { - self.body.print(output); - } else { - print_braced(self, output); - } - if (needs_parens) { output.print(")"); } - }); - - /* -----[ exits ]----- */ - AST_Exit.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.value) { - output.space(); - this.value.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Return, function(self, output) { - self._do_print(output, "return"); - }); - DEFPRINT(AST_Throw, function(self, output) { - self._do_print(output, "throw"); - }); - - /* -----[ yield ]----- */ - - DEFPRINT(AST_Yield, function(self, output) { - var star = self.is_star ? "*" : ""; - output.print("yield" + star); - if (self.expression) { - output.space(); - self.expression.print(output); - } - }); - - DEFPRINT(AST_Await, function(self, output) { - output.print("await"); - output.space(); - var e = self.expression; - var parens = !( - e instanceof AST_Call - || e instanceof AST_SymbolRef - || e instanceof AST_PropAccess - || e instanceof AST_Unary - || e instanceof AST_Constant - ); - if (parens) output.print("("); - self.expression.print(output); - if (parens) output.print(")"); - }); - - /* -----[ loop control ]----- */ - AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.label) { - output.space(); - this.label.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Break, function(self, output) { - self._do_print(output, "break"); - }); - DEFPRINT(AST_Continue, function(self, output) { - self._do_print(output, "continue"); - }); - - /* -----[ if ]----- */ - function make_then(self, output) { - var b = self.body; - if (output.option("braces") - || output.option("ie8") && b instanceof AST_Do) - return make_block(b, output); - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block braces if needed. - if (!b) return output.force_semicolon(); - while (true) { - if (b instanceof AST_If) { - if (!b.alternative) { - make_block(self.body, output); - return; - } - b = b.alternative; - } else if (b instanceof AST_StatementWithBody) { - b = b.body; - } else break; - } - force_statement(self.body, output); - } - DEFPRINT(AST_If, function(self, output) { - output.print("if"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - if (self.alternative) { - make_then(self, output); - output.space(); - output.print("else"); - output.space(); - if (self.alternative instanceof AST_If) - self.alternative.print(output); - else - force_statement(self.alternative, output); - } else { - self._do_print_body(output); - } - }); - - /* -----[ switch ]----- */ - DEFPRINT(AST_Switch, function(self, output) { - output.print("switch"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - var last = self.body.length - 1; - if (last < 0) print_braced_empty(self, output); - else output.with_block(function() { - self.body.forEach(function(branch, i) { - output.indent(true); - branch.print(output); - if (i < last && branch.body.length > 0) - output.newline(); - }); - }); - }); - AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { - output.newline(); - this.body.forEach(function(stmt) { - output.indent(); - stmt.print(output); - output.newline(); - }); - }); - DEFPRINT(AST_Default, function(self, output) { - output.print("default:"); - self._do_print_body(output); - }); - DEFPRINT(AST_Case, function(self, output) { - output.print("case"); - output.space(); - self.expression.print(output); - output.print(":"); - self._do_print_body(output); - }); - - /* -----[ exceptions ]----- */ - DEFPRINT(AST_Try, function(self, output) { - output.print("try"); - output.space(); - print_braced(self, output); - if (self.bcatch) { - output.space(); - self.bcatch.print(output); - } - if (self.bfinally) { - output.space(); - self.bfinally.print(output); - } - }); - DEFPRINT(AST_Catch, function(self, output) { - output.print("catch"); - if (self.argname) { - output.space(); - output.with_parens(function() { - self.argname.print(output); - }); - } - output.space(); - print_braced(self, output); - }); - DEFPRINT(AST_Finally, function(self, output) { - output.print("finally"); - output.space(); - print_braced(self, output); - }); - - /* -----[ var/const ]----- */ - AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - output.space(); - this.definitions.forEach(function(def, i) { - if (i) output.comma(); - def.print(output); - }); - var p = output.parent(); - var in_for = p instanceof AST_For || p instanceof AST_ForIn; - var output_semicolon = !in_for || p && p.init !== this; - if (output_semicolon) - output.semicolon(); - }); - DEFPRINT(AST_Let, function(self, output) { - self._do_print(output, "let"); - }); - DEFPRINT(AST_Var, function(self, output) { - self._do_print(output, "var"); - }); - DEFPRINT(AST_Const, function(self, output) { - self._do_print(output, "const"); - }); - DEFPRINT(AST_Import, function(self, output) { - output.print("import"); - output.space(); - if (self.imported_name) { - self.imported_name.print(output); - } - if (self.imported_name && self.imported_names) { - output.print(","); - output.space(); - } - if (self.imported_names) { - if (self.imported_names.length === 1 && self.imported_names[0].foreign_name.name === "*") { - self.imported_names[0].print(output); - } else { - output.print("{"); - self.imported_names.forEach(function (name_import, i) { - output.space(); - name_import.print(output); - if (i < self.imported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } - if (self.imported_name || self.imported_names) { - output.space(); - output.print("from"); - output.space(); - } - self.module_name.print(output); - output.semicolon(); - }); - - DEFPRINT(AST_NameMapping, function(self, output) { - var is_import = output.parent() instanceof AST_Import; - var definition = self.name.definition(); - var names_are_different = - (definition && definition.mangled_name || self.name.name) !== - self.foreign_name.name; - if (names_are_different) { - if (is_import) { - output.print(self.foreign_name.name); - } else { - self.name.print(output); - } - output.space(); - output.print("as"); - output.space(); - if (is_import) { - self.name.print(output); - } else { - output.print(self.foreign_name.name); - } - } else { - self.name.print(output); - } - }); - - DEFPRINT(AST_Export, function(self, output) { - output.print("export"); - output.space(); - if (self.is_default) { - output.print("default"); - output.space(); - } - if (self.exported_names) { - if (self.exported_names.length === 1 && self.exported_names[0].name.name === "*") { - self.exported_names[0].print(output); - } else { - output.print("{"); - self.exported_names.forEach(function(name_export, i) { - output.space(); - name_export.print(output); - if (i < self.exported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } else if (self.exported_value) { - self.exported_value.print(output); - } else if (self.exported_definition) { - self.exported_definition.print(output); - if (self.exported_definition instanceof AST_Definitions) return; - } - if (self.module_name) { - output.space(); - output.print("from"); - output.space(); - self.module_name.print(output); - } - if (self.exported_value - && !(self.exported_value instanceof AST_Defun || - self.exported_value instanceof AST_Function || - self.exported_value instanceof AST_Class) - || self.module_name - || self.exported_names - ) { - output.semicolon(); - } - }); - - function parenthesize_for_noin(node, output, noin) { - var parens = false; - // need to take some precautions here: - // https://github.com/mishoo/UglifyJS2/issues/60 - if (noin) node.walk(new TreeWalker(function(node) { - if (parens || node instanceof AST_Scope) return true; - if (node instanceof AST_Binary && node.operator == "in") { - parens = true; - return true; - } - })); - node.print(output, parens); - } - - DEFPRINT(AST_VarDef, function(self, output) { - self.name.print(output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - var p = output.parent(1); - var noin = p instanceof AST_For || p instanceof AST_ForIn; - parenthesize_for_noin(self.value, output, noin); - } - }); - - /* -----[ other expressions ]----- */ - DEFPRINT(AST_Call, function(self, output) { - self.expression.print(output); - if (self instanceof AST_New && !need_constructor_parens(self, output)) - return; - if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) { - output.add_mapping(self.start); - } - output.with_parens(function() { - self.args.forEach(function(expr, i) { - if (i) output.comma(); - expr.print(output); - }); - }); - }); - DEFPRINT(AST_New, function(self, output) { - output.print("new"); - output.space(); - AST_Call.prototype._codegen(self, output); - }); - - AST_Sequence.DEFMETHOD("_do_print", function(output) { - this.expressions.forEach(function(node, index) { - if (index > 0) { - output.comma(); - if (output.should_break()) { - output.newline(); - output.indent(); - } - } - node.print(output); - }); - }); - DEFPRINT(AST_Sequence, function(self, output) { - self._do_print(output); - // var p = output.parent(); - // if (p instanceof AST_Statement) { - // output.with_indent(output.next_indent(), function(){ - // self._do_print(output); - // }); - // } else { - // self._do_print(output); - // } - }); - DEFPRINT(AST_Dot, function(self, output) { - var expr = self.expression; - expr.print(output); - var prop = self.property; - if (output.option("ie8") && RESERVED_WORDS(prop)) { - output.print("["); - output.add_mapping(self.end); - output.print_string(prop); - output.print("]"); - } else { - if (expr instanceof AST_Number && expr.getValue() >= 0) { - if (!/[xa-f.)]/i.test(output.last())) { - output.print("."); - } - } - output.print("."); - // the name after dot would be mapped about here. - output.add_mapping(self.end); - output.print_name(prop); - } - }); - DEFPRINT(AST_Sub, function(self, output) { - self.expression.print(output); - output.print("["); - self.property.print(output); - output.print("]"); - }); - DEFPRINT(AST_UnaryPrefix, function(self, output) { - var op = self.operator; - output.print(op); - if (/^[a-z]/i.test(op) - || (/[+-]$/.test(op) - && self.expression instanceof AST_UnaryPrefix - && /^[+-]/.test(self.expression.operator))) { - output.space(); - } - self.expression.print(output); - }); - DEFPRINT(AST_UnaryPostfix, function(self, output) { - self.expression.print(output); - output.print(self.operator); - }); - DEFPRINT(AST_Binary, function(self, output) { - var op = self.operator; - self.left.print(output); - if (op[0] == ">" /* ">>" ">>>" ">" ">=" */ - && self.left instanceof AST_UnaryPostfix - && self.left.operator == "--") { - // space is mandatory to avoid outputting --> - output.print(" "); - } else { - // the space is optional depending on "beautify" - output.space(); - } - output.print(op); - if ((op == "<" || op == "<<") - && self.right instanceof AST_UnaryPrefix - && self.right.operator == "!" - && self.right.expression instanceof AST_UnaryPrefix - && self.right.expression.operator == "--") { - // space is mandatory to avoid outputting ") && S.newline_before) { - forward(3); - skip_line_comment("comment4"); - continue; - } - } - var ch = peek(); - if (!ch) return token("eof"); - var code = ch.charCodeAt(0); - switch (code) { - case 34: case 39: return read_string(ch); - case 46: return handle_dot(); - case 47: { - var tok = handle_slash(); - if (tok === next_token) continue; - return tok; - } - case 61: return handle_eq_sign(); - case 96: return read_template_characters(true); - case 123: - S.brace_counter++; - break; - case 125: - S.brace_counter--; - if (S.template_braces.length > 0 - && S.template_braces[S.template_braces.length - 1] === S.brace_counter) - return read_template_characters(false); - break; - } - if (is_digit(code)) return read_num(); - if (PUNC_CHARS(ch)) return token("punc", next()); - if (OPERATOR_CHARS(ch)) return read_operator(); - if (code == 92 || is_identifier_start(ch)) return read_word(); - break; - } - parse_error("Unexpected character '" + ch + "'"); - } - - next_token.next = next; - next_token.peek = peek; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - next_token.add_directive = function(directive) { - S.directive_stack[S.directive_stack.length - 1].push(directive); - - if (S.directives[directive] === undefined) { - S.directives[directive] = 1; - } else { - S.directives[directive]++; - } - }; - - next_token.push_directives_stack = function() { - S.directive_stack.push([]); - }; - - next_token.pop_directives_stack = function() { - var directives = S.directive_stack[S.directive_stack.length - 1]; - - for (var i = 0; i < directives.length; i++) { - S.directives[directives[i]]--; - } - - S.directive_stack.pop(); - }; - - next_token.has_directive = function(directive) { - return S.directives[directive] > 0; - }; - - return next_token; - -} - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = makePredicate([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = makePredicate([ "--", "++" ]); - -var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - -var PRECEDENCE = (function(a, ret) { - for (var i = 0; i < a.length; ++i) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = i + 1; - } - } - return ret; -})( - [ - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"], - ["**"] - ], - {} -); - -var ATOMIC_START_TOKEN = makePredicate([ "atom", "num", "string", "regexp", "name" ]); - -/* -----[ Parser ]----- */ - -function parse($TEXT, options) { - - options = defaults(options, { - bare_returns : false, - ecma : 8, - expression : false, - filename : null, - html5_comments : true, - module : false, - shebang : true, - strict : false, - toplevel : null, - }, true); - - var S = { - input : (typeof $TEXT == "string" - ? tokenizer($TEXT, options.filename, - options.html5_comments, options.shebang) - : $TEXT), - token : null, - prev : null, - peeked : null, - in_function : 0, - in_async : -1, - in_generator : -1, - in_directives : true, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - } - - function peek() { return S.peeked || (S.peeked = S.input()); } - - function next() { - S.prev = S.token; - - if (!S.peeked) peek(); - S.token = S.peeked; - S.peeked = null; - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - } - - function prev() { - return S.prev; - } - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - ctx.filename, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - } - - function token_error(token, msg) { - croak(msg, token.line, token.col); - } - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - } - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); - } - - function expect(punc) { return expect_token("punc", punc); } - - function has_newline_before(token) { - return token.nlb || !all(token.comments_before, function(comment) { - return !comment.nlb; - }); - } - - function can_insert_semicolon() { - return !options.strict - && (is("eof") || is("punc", "}") || has_newline_before(S.token)); - } - - function is_in_generator() { - return S.in_generator === S.in_function; - } - - function is_in_async() { - return S.in_async === S.in_function; - } - - function semicolon(optional) { - if (is("punc", ";")) next(); - else if (!optional && !can_insert_semicolon()) unexpected(); - } - - function parenthesised() { - expect("("); - var exp = expression(true); - expect(")"); - return exp; - } - - function embed_tokens(parser) { - return function() { - var start = S.token; - var expr = parser.apply(null, arguments); - var end = prev(); - expr.start = start; - expr.end = end; - return expr; - }; - } - - function handle_regexp() { - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - } - - var statement = embed_tokens(function(is_export_default, is_for_body, is_if_body) { - handle_regexp(); - switch (S.token.type) { - case "string": - if (S.in_directives) { - var token = peek(); - if (S.token.raw.indexOf("\\") == -1 - && (is_token(token, "punc", ";") - || is_token(token, "punc", "}") - || has_newline_before(token) - || is_token(token, "eof"))) { - S.input.add_directive(S.token.value); - } else { - S.in_directives = false; - } - } - var dir = S.in_directives, stat = simple_statement(); - return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat; - case "template_head": - case "num": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - if (S.token.value == "async" && is_token(peek(), "keyword", "function")) { - next(); - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(AST_Defun, false, true, is_export_default); - } - if (S.token.value == "import" && !is_token(peek(), "punc", "(")) { - next(); - var node = import_(); - semicolon(); - return node; - } - return is_token(peek(), "punc", ":") - ? labeled_statement() - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return new AST_BlockStatement({ - start : S.token, - body : block_(), - end : prev() - }); - case "[": - case "(": - return simple_statement(); - case ";": - S.in_directives = false; - next(); - return new AST_EmptyStatement(); - default: - unexpected(); - } - - case "keyword": - switch (S.token.value) { - case "break": - next(); - return break_cont(AST_Break); - - case "continue": - next(); - return break_cont(AST_Continue); - - case "debugger": - next(); - semicolon(); - return new AST_Debugger(); - - case "do": - next(); - var body = in_loop(statement); - expect_token("keyword", "while"); - var condition = parenthesised(); - semicolon(true); - return new AST_Do({ - body : body, - condition : condition - }); - - case "while": - next(); - return new AST_While({ - condition : parenthesised(), - body : in_loop(function() { return statement(false, true); }) - }); - - case "for": - next(); - return for_(); - - case "class": - next(); - if (is_for_body) { - croak("classes are not allowed as the body of a loop"); - } - if (is_if_body) { - croak("classes are not allowed as the body of an if"); - } - return class_(AST_DefClass); - - case "function": - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(AST_Defun, false, false, is_export_default); - - case "if": - next(); - return if_(); - - case "return": - if (S.in_function == 0 && !options.bare_returns) - croak("'return' outside of function"); - next(); - var value = null; - if (is("punc", ";")) { - next(); - } else if (!can_insert_semicolon()) { - value = expression(true); - semicolon(); - } - return new AST_Return({ - value: value - }); - - case "switch": - next(); - return new AST_Switch({ - expression : parenthesised(), - body : in_loop(switch_body_) - }); - - case "throw": - next(); - if (has_newline_before(S.token)) - croak("Illegal newline after 'throw'"); - var value = expression(true); - semicolon(); - return new AST_Throw({ - value: value - }); - - case "try": - next(); - return try_(); - - case "var": - next(); - var node = var_(); - semicolon(); - return node; - - case "let": - next(); - var node = let_(); - semicolon(); - return node; - - case "const": - next(); - var node = const_(); - semicolon(); - return node; - - case "with": - if (S.input.has_directive("use strict")) { - croak("Strict mode may not include a with statement"); - } - next(); - return new AST_With({ - expression : parenthesised(), - body : statement() - }); - - case "export": - if (!is_token(peek(), "punc", "(")) { - next(); - var node = export_(); - if (is("punc", ";")) semicolon(); - return node; - } - } - } - unexpected(); - }); - - function labeled_statement() { - var label = as_symbol(AST_Label); - if (label.name === "await" && is_in_async()) { - token_error(S.prev, "await cannot be used as label inside async function"); - } - if (find_if(function(l) { return l.name == label.name; }, S.labels)) { - // ECMA-262, 12.12: An ECMAScript program is considered - // syntactically incorrect if it contains a - // LabelledStatement that is enclosed by a - // LabelledStatement with the same Identifier as label. - croak("Label " + label.name + " defined twice"); - } - expect(":"); - S.labels.push(label); - var stat = statement(); - S.labels.pop(); - if (!(stat instanceof AST_IterationStatement)) { - // check for `continue` that refers to this label. - // those should be reported as syntax errors. - // https://github.com/mishoo/UglifyJS2/issues/287 - label.references.forEach(function(ref) { - if (ref instanceof AST_Continue) { - ref = ref.label.start; - croak("Continue label `" + label.name + "` refers to non-IterationStatement.", - ref.line, ref.col, ref.pos); - } - }); - } - return new AST_LabeledStatement({ body: stat, label: label }); - } - - function simple_statement(tmp) { - return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); - } - - function break_cont(type) { - var label = null, ldef; - if (!can_insert_semicolon()) { - label = as_symbol(AST_LabelRef, true); - } - if (label != null) { - ldef = find_if(function(l) { return l.name == label.name; }, S.labels); - if (!ldef) - croak("Undefined label " + label.name); - label.thedef = ldef; - } else if (S.in_loop == 0) - croak(type.TYPE + " not inside a loop or switch"); - semicolon(); - var stat = new type({ label: label }); - if (ldef) ldef.references.push(stat); - return stat; - } - - function for_() { - var for_await_error = "`for await` invalid in this context"; - var await_tok = S.token; - if (await_tok.type == "name" && await_tok.value == "await") { - if (!is_in_async()) { - token_error(await_tok, for_await_error); - } - next(); - } else { - await_tok = false; - } - expect("("); - var init = null; - if (!is("punc", ";")) { - init = - is("keyword", "var") ? (next(), var_(true)) : - is("keyword", "let") ? (next(), let_(true)) : - is("keyword", "const") ? (next(), const_(true)) : - expression(true, true); - var is_in = is("operator", "in"); - var is_of = is("name", "of"); - if (await_tok && !is_of) { - token_error(await_tok, for_await_error); - } - if (is_in || is_of) { - if (init instanceof AST_Definitions) { - if (init.definitions.length > 1) - token_error(init.start, "Only one variable declaration allowed in for..in loop"); - } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) { - token_error(init.start, "Invalid left-hand side in for..in loop"); - } - next(); - if (is_in) { - return for_in(init); - } else { - return for_of(init, !!await_tok); - } - } - } else if (await_tok) { - token_error(await_tok, for_await_error); - } - return regular_for(init); - } - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(true); - expect(";"); - var step = is("punc", ")") ? null : expression(true); - expect(")"); - return new AST_For({ - init : init, - condition : test, - step : step, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_of(init, is_await) { - var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null; - var obj = expression(true); - expect(")"); - return new AST_ForOf({ - await : is_await, - init : init, - name : lhs, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_in(init) { - var obj = expression(true); - expect(")"); - return new AST_ForIn({ - init : init, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - var arrow_function = function(start, argnames, is_async) { - if (has_newline_before(S.token)) { - croak("Unexpected newline before arrow (=>)"); - } - - expect_token("arrow", "=>"); - - var body = _function_body(is("punc", "{"), false, is_async); - - var end = - body instanceof Array && body.length ? body[body.length - 1].end : - body instanceof Array ? start : - body.end; - - return new AST_Arrow({ - start : start, - end : end, - async : is_async, - argnames : argnames, - body : body - }); - }; - - var function_ = function(ctor, is_generator_property, is_async, is_export_default) { - var start = S.token; - - var in_statement = ctor === AST_Defun; - var is_generator = is("operator", "*"); - if (is_generator) { - next(); - } - - var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null; - if (in_statement && !name) { - if (is_export_default) { - ctor = AST_Function; - } else { - unexpected(); - } - } - - if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration)) - unexpected(prev()); - - var args = []; - var body = _function_body(true, is_generator || is_generator_property, is_async, name, args); - return new ctor({ - start : args.start, - end : body.end, - is_generator: is_generator, - async : is_async, - name : name, - argnames: args, - body : body - }); - }; - - function track_used_binding_identifiers(is_parameter, strict) { - var parameters = {}; - var duplicate = false; - var default_assignment = false; - var spread = false; - var strict_mode = !!strict; - var tracker = { - add_parameter: function(token) { - if (parameters["$" + token.value] !== undefined) { - if (duplicate === false) { - duplicate = token; - } - tracker.check_strict(); - } else { - parameters["$" + token.value] = true; - if (is_parameter) { - switch (token.value) { - case "arguments": - case "eval": - case "yield": - if (strict_mode) { - token_error(token, "Unexpected " + token.value + " identifier as parameter inside strict mode"); - } - break; - default: - if (RESERVED_WORDS(token.value)) { - unexpected(); - } - } - } - } - }, - mark_default_assignment: function(token) { - if (default_assignment === false) { - default_assignment = token; - } - }, - mark_spread: function(token) { - if (spread === false) { - spread = token; - } - }, - mark_strict_mode: function() { - strict_mode = true; - }, - is_strict: function() { - return default_assignment !== false || spread !== false || strict_mode; - }, - check_strict: function() { - if (tracker.is_strict() && duplicate !== false) { - token_error(duplicate, "Parameter " + duplicate.value + " was used already"); - } - } - }; - - return tracker; - } - - function parameters(params) { - var start = S.token; - var used_parameters = track_used_binding_identifiers(true, S.input.has_directive("use strict")); - - expect("("); - - while (!is("punc", ")")) { - var param = parameter(used_parameters); - params.push(param); - - if (!is("punc", ")")) { - expect(","); - if (is("punc", ")") && options.ecma < 8) unexpected(); - } - - if (param instanceof AST_Expansion) { - break; - } - } - - next(); - } - - function parameter(used_parameters, symbol_type) { - var param; - var expand = false; - if (used_parameters === undefined) { - used_parameters = track_used_binding_identifiers(true, S.input.has_directive("use strict")); - } - if (is("expand", "...")) { - expand = S.token; - used_parameters.mark_spread(S.token); - next(); - } - param = binding_element(used_parameters, symbol_type); - - if (is("operator", "=") && expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - param = new AST_DefaultAssign({ - start: param.start, - left: param, - operator: "=", - right: expression(false), - end: S.token - }); - } - - if (expand !== false) { - if (!is("punc", ")")) { - unexpected(); - } - param = new AST_Expansion({ - start: expand, - expression: param, - end: expand - }); - } - used_parameters.check_strict(); - - return param; - } - - function binding_element(used_parameters, symbol_type) { - var elements = []; - var first = true; - var is_expand = false; - var expand_token; - var first_token = S.token; - if (used_parameters === undefined) { - used_parameters = track_used_binding_identifiers(false, S.input.has_directive("use strict")); - } - symbol_type = symbol_type === undefined ? AST_SymbolFunarg : symbol_type; - if (is("punc", "[")) { - next(); - while (!is("punc", "]")) { - if (first) { - first = false; - } else { - expect(","); - } - - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("punc")) { - switch (S.token.value) { - case ",": - elements.push(new AST_Hole({ - start: S.token, - end: S.token - })); - continue; - case "]": // Trailing comma after last element - break; - case "[": - case "{": - elements.push(binding_element(used_parameters, symbol_type)); - break; - default: - unexpected(); - } - } else if (is("name")) { - used_parameters.add_parameter(S.token); - elements.push(as_symbol(symbol_type)); - } else { - croak("Invalid function parameter"); - } - if (is("operator", "=") && is_expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1] = new AST_DefaultAssign({ - start: elements[elements.length - 1].start, - left: elements[elements.length - 1], - operator: "=", - right: expression(false), - end: S.token - }); - } - if (is_expand) { - if (!is("punc", "]")) { - croak("Rest element must be last element"); - } - elements[elements.length - 1] = new AST_Expansion({ - start: expand_token, - expression: elements[elements.length - 1], - end: expand_token - }); - } - } - expect("]"); - used_parameters.check_strict(); - return new AST_Destructuring({ - start: first_token, - names: elements, - is_array: true, - end: prev() - }); - } else if (is("punc", "{")) { - next(); - while (!is("punc", "}")) { - if (first) { - first = false; - } else { - expect(","); - } - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("name") && (is_token(peek(), "punc") || is_token(peek(), "operator")) && [",", "}", "="].indexOf(peek().value) !== -1) { - used_parameters.add_parameter(S.token); - var start = prev(); - var value = as_symbol(symbol_type); - if (is_expand) { - elements.push(new AST_Expansion({ - start: expand_token, - expression: value, - end: value.end, - })); - } else { - elements.push(new AST_ObjectKeyVal({ - start: start, - key: value.name, - value: value, - end: value.end, - })); - } - } else if (is("punc", "}")) { - continue; // Allow trailing hole - } else { - var property_token = S.token; - var property = as_property_name(); - if (property === null) { - unexpected(prev()); - } else if (prev().type === "name" && !is("punc", ":")) { - elements.push(new AST_ObjectKeyVal({ - start: prev(), - key: property, - value: new symbol_type({ - start: prev(), - name: property, - end: prev() - }), - end: prev() - })); - } else { - expect(":"); - elements.push(new AST_ObjectKeyVal({ - start: property_token, - quote: property_token.quote, - key: property, - value: binding_element(used_parameters, symbol_type), - end: prev() - })); - } - } - if (is_expand) { - if (!is("punc", "}")) { - croak("Rest element must be last element"); - } - } else if (is("operator", "=")) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1].value = new AST_DefaultAssign({ - start: elements[elements.length - 1].value.start, - left: elements[elements.length - 1].value, - operator: "=", - right: expression(false), - end: S.token - }); - } - } - expect("}"); - used_parameters.check_strict(); - return new AST_Destructuring({ - start: first_token, - names: elements, - is_array: false, - end: prev() - }); - } else if (is("name")) { - used_parameters.add_parameter(S.token); - return as_symbol(symbol_type); - } else { - croak("Invalid function parameter"); - } - } - - function params_or_seq_(allow_arrows, maybe_sequence) { - var spread_token; - var invalid_sequence; - var trailing_comma; - var a = []; - expect("("); - while (!is("punc", ")")) { - if (spread_token) unexpected(spread_token); - if (is("expand", "...")) { - spread_token = S.token; - if (maybe_sequence) invalid_sequence = S.token; - next(); - a.push(new AST_Expansion({ - start: prev(), - expression: expression(), - end: S.token, - })); - } else { - a.push(expression()); - } - if (!is("punc", ")")) { - expect(","); - if (is("punc", ")")) { - if (options.ecma < 8) unexpected(); - trailing_comma = prev(); - if (maybe_sequence) invalid_sequence = trailing_comma; - } - } - } - expect(")"); - if (allow_arrows && is("arrow", "=>")) { - if (spread_token && trailing_comma) unexpected(trailing_comma); - } else if (invalid_sequence) { - unexpected(invalid_sequence); - } - return a; - } - - function _function_body(block, generator, is_async, name, args) { - var loop = S.in_loop; - var labels = S.labels; - var current_generator = S.in_generator; - var current_async = S.in_async; - ++S.in_function; - if (generator) - S.in_generator = S.in_function; - if (is_async) - S.in_async = S.in_function; - if (args) parameters(args); - if (block) - S.in_directives = true; - S.in_loop = 0; - S.labels = []; - if (block) { - S.input.push_directives_stack(); - var a = block_(); - if (name) _verify_symbol(name); - if (args) args.forEach(_verify_symbol); - S.input.pop_directives_stack(); - } else { - var a = expression(false); - } - --S.in_function; - S.in_loop = loop; - S.labels = labels; - S.in_generator = current_generator; - S.in_async = current_async; - return a; - } - - function _await_expression() { - // Previous token must be "await" and not be interpreted as an identifier - if (!is_in_async()) { - croak("Unexpected await expression outside async function", - S.prev.line, S.prev.col, S.prev.pos); - } - // the await expression is parsed as a unary expression in Babel - return new AST_Await({ - start: prev(), - end: S.token, - expression : maybe_unary(true), - }); - } - - function _yield_expression() { - // Previous token must be keyword yield and not be interpret as an identifier - if (!is_in_generator()) { - croak("Unexpected yield expression outside generator function", - S.prev.line, S.prev.col, S.prev.pos); - } - var start = S.token; - var star = false; - var has_expression = true; - - // Attempt to get expression or star (and then the mandatory expression) - // behind yield on the same line. - // - // If nothing follows on the same line of the yieldExpression, - // it should default to the value `undefined` for yield to return. - // In that case, the `undefined` stored as `null` in ast. - // - // Note 1: It isn't allowed for yield* to close without an expression - // Note 2: If there is a nlb between yield and star, it is interpret as - // yield * - if (can_insert_semicolon() || - (is("punc") && PUNC_AFTER_EXPRESSION(S.token.value))) { - has_expression = false; - - } else if (is("operator", "*")) { - star = true; - next(); - } - - return new AST_Yield({ - start : start, - is_star : star, - expression : has_expression ? expression() : null, - end : prev() - }); - } - - function if_() { - var cond = parenthesised(), body = statement(false, false, true), belse = null; - if (is("keyword", "else")) { - next(); - belse = statement(false, false, true); - } - return new AST_If({ - condition : cond, - body : body, - alternative : belse - }); - } - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - } - - function switch_body_() { - expect("{"); - var a = [], cur = null, branch = null, tmp; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Case({ - start : (tmp = S.token, next(), tmp), - expression : expression(true), - body : cur - }); - a.push(branch); - expect(":"); - } else if (is("keyword", "default")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Default({ - start : (tmp = S.token, next(), expect(":"), tmp), - body : cur - }); - a.push(branch); - } else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - if (branch) branch.end = prev(); - next(); - return a; - } - - function try_() { - var body = block_(), bcatch = null, bfinally = null; - if (is("keyword", "catch")) { - var start = S.token; - next(); - if (is("punc", "{")) { - var name = null; - } else { - expect("("); - var name = parameter(undefined, AST_SymbolCatch); - expect(")"); - } - bcatch = new AST_Catch({ - start : start, - argname : name, - body : block_(), - end : prev() - }); - } - if (is("keyword", "finally")) { - var start = S.token; - next(); - bfinally = new AST_Finally({ - start : start, - body : block_(), - end : prev() - }); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return new AST_Try({ - body : body, - bcatch : bcatch, - bfinally : bfinally - }); - } - - function vardefs(no_in, kind) { - var a = []; - var def; - for (;;) { - var sym_type = - kind === "var" ? AST_SymbolVar : - kind === "const" ? AST_SymbolConst : - kind === "let" ? AST_SymbolLet : null; - if (is("punc", "{") || is("punc", "[")) { - def = new AST_VarDef({ - start: S.token, - name: binding_element(undefined ,sym_type), - value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null, - end: prev() - }); - } else { - def = new AST_VarDef({ - start : S.token, - name : as_symbol(sym_type), - value : is("operator", "=") - ? (next(), expression(false, no_in)) - : !no_in && kind === "const" - ? croak("Missing initializer in const declaration") : null, - end : prev() - }); - if (def.name.name == "import") croak("Unexpected token: import"); - } - a.push(def); - if (!is("punc", ",")) - break; - next(); - } - return a; - } - - var var_ = function(no_in) { - return new AST_Var({ - start : prev(), - definitions : vardefs(no_in, "var"), - end : prev() - }); - }; - - var let_ = function(no_in) { - return new AST_Let({ - start : prev(), - definitions : vardefs(no_in, "let"), - end : prev() - }); - }; - - var const_ = function(no_in) { - return new AST_Const({ - start : prev(), - definitions : vardefs(no_in, "const"), - end : prev() - }); - }; - - var new_ = function(allow_calls) { - var start = S.token; - expect_token("operator", "new"); - if (is("punc", ".")) { - next(); - expect_token("name", "target"); - return subscripts(new AST_NewTarget({ - start : start, - end : prev() - }), allow_calls); - } - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")", options.ecma >= 8); - } else { - args = []; - } - var call = new AST_New({ - start : start, - expression : newexp, - args : args, - end : prev() - }); - mark_pure(call); - return subscripts(call, allow_calls); - }; - - function as_atom_node() { - var tok = S.token, ret; - switch (tok.type) { - case "name": - ret = _make_symbol(AST_SymbolRef); - break; - case "num": - ret = new AST_Number({ start: tok, end: tok, value: tok.value }); - break; - case "string": - ret = new AST_String({ - start : tok, - end : tok, - value : tok.value, - quote : tok.quote - }); - break; - case "regexp": - ret = new AST_RegExp({ start: tok, end: tok, value: tok.value }); - break; - case "atom": - switch (tok.value) { - case "false": - ret = new AST_False({ start: tok, end: tok }); - break; - case "true": - ret = new AST_True({ start: tok, end: tok }); - break; - case "null": - ret = new AST_Null({ start: tok, end: tok }); - break; - } - break; - } - next(); - return ret; - } - - function to_fun_args(ex, _, __, default_seen_above) { - var insert_default = function(ex, default_value) { - if (default_value) { - return new AST_DefaultAssign({ - start: ex.start, - left: ex, - operator: "=", - right: default_value, - end: default_value.end - }); - } - return ex; - }; - if (ex instanceof AST_Object) { - return insert_default(new AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: false, - names: ex.properties.map(to_fun_args) - }), default_seen_above); - } else if (ex instanceof AST_ObjectKeyVal) { - ex.value = to_fun_args(ex.value, 0, [ex.key]); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_Hole) { - return ex; - } else if (ex instanceof AST_Destructuring) { - ex.names = ex.names.map(to_fun_args); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_SymbolRef) { - return insert_default(new AST_SymbolFunarg({ - name: ex.name, - start: ex.start, - end: ex.end - }), default_seen_above); - } else if (ex instanceof AST_Expansion) { - ex.expression = to_fun_args(ex.expression); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_Array) { - return insert_default(new AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: true, - names: ex.elements.map(to_fun_args) - }), default_seen_above); - } else if (ex instanceof AST_Assign) { - return insert_default(to_fun_args(ex.left, undefined, undefined, ex.right), default_seen_above); - } else if (ex instanceof AST_DefaultAssign) { - ex.left = to_fun_args(ex.left, 0, [ex.left]); - return ex; - } else { - croak("Invalid function parameter", ex.start.line, ex.start.col); - } - } - - var expr_atom = function(allow_calls, allow_arrows) { - if (is("operator", "new")) { - return new_(allow_calls); - } - var start = S.token; - var peeked; - var async = is("name", "async") - && (peeked = peek()).value != "[" - && peeked.type != "arrow" - && as_atom_node(); - if (is("punc")) { - switch (S.token.value) { - case "(": - if (async && !allow_calls) break; - var exprs = params_or_seq_(allow_arrows, !async); - if (allow_arrows && is("arrow", "=>")) { - return arrow_function(start, exprs.map(to_fun_args), !!async); - } - var ex = async ? new AST_Call({ - expression: async, - args: exprs - }) : exprs.length == 1 ? exprs[0] : new AST_Sequence({ - expressions: exprs - }); - if (ex.start) { - var len = start.comments_before.length; - [].unshift.apply(ex.start.comments_before, start.comments_before); - start.comments_before = ex.start.comments_before; - start.comments_before_length = len; - if (len == 0 && start.comments_before.length > 0) { - var comment = start.comments_before[0]; - if (!comment.nlb) { - comment.nlb = start.nlb; - start.nlb = false; - } - } - start.comments_after = ex.start.comments_after; - } - ex.start = start; - var end = prev(); - if (ex.end) { - end.comments_before = ex.end.comments_before; - [].push.apply(ex.end.comments_after, end.comments_after); - end.comments_after = ex.end.comments_after; - } - ex.end = end; - if (ex instanceof AST_Call) mark_pure(ex); - return subscripts(ex, allow_calls); - case "[": - return subscripts(array_(), allow_calls); - case "{": - return subscripts(object_or_destructuring_(), allow_calls); - } - if (!async) unexpected(); - } - if (allow_arrows && is("name") && is_token(peek(), "arrow")) { - var param = new AST_SymbolFunarg({ - name: S.token.value, - start: start, - end: start, - }); - next(); - return arrow_function(start, [param], !!async); - } - if (is("keyword", "function")) { - next(); - var func = function_(AST_Function, false, !!async); - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (async) return subscripts(async, allow_calls); - if (is("keyword", "class")) { - next(); - var cls = class_(AST_ClassExpression); - cls.start = start; - cls.end = prev(); - return subscripts(cls, allow_calls); - } - if (is("template_head")) { - return subscripts(template_string(false), allow_calls); - } - if (ATOMIC_START_TOKEN(S.token.type)) { - return subscripts(as_atom_node(), allow_calls); - } - unexpected(); - }; - - function template_string(tagged) { - var segments = [], start = S.token; - - segments.push(new AST_TemplateSegment({ - start: S.token, - raw: S.token.raw, - value: S.token.value, - end: S.token - })); - while (S.token.end === false) { - next(); - handle_regexp(); - segments.push(expression(true)); - - if (!is_token("template_substitution")) { - unexpected(); - } - - segments.push(new AST_TemplateSegment({ - start: S.token, - raw: S.token.raw, - value: S.token.value, - end: S.token - })); - } - next(); - - return new AST_TemplateString({ - start: start, - segments: segments, - end: S.token - }); - } - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push(new AST_Hole({ start: S.token, end: S.token })); - } else if (is("expand", "...")) { - next(); - a.push(new AST_Expansion({start: prev(), expression: expression(),end: S.token})); - } else { - a.push(expression(false)); - } - } - next(); - return a; - } - - var array_ = embed_tokens(function() { - expect("["); - return new AST_Array({ - elements: expr_list("]", !options.strict, true) - }); - }); - - var create_accessor = embed_tokens(function(is_generator, is_async) { - return function_(AST_Accessor, is_generator, is_async); - }); - - var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() { - var start = S.token, first = true, a = []; - expect("{"); - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!options.strict && is("punc", "}")) - // allow trailing comma - break; - - start = S.token; - if (start.type == "expand") { - next(); - a.push(new AST_Expansion({ - start: start, - expression: expression(false), - end: prev(), - })); - continue; - } - - var name = as_property_name(); - var value; - - // Check property and fetch value - if (!is("punc", ":")) { - var concise = concise_method_or_getset(name, start); - if (concise) { - a.push(concise); - continue; - } - - value = new AST_SymbolRef({ - start: prev(), - name: name, - end: prev() - }); - } else if (name === null) { - unexpected(prev()); - } else { - next(); // `:` - see first condition - value = expression(false); - } - - // Check for default value and alter value accordingly if necessary - if (is("operator", "=")) { - next(); - value = new AST_Assign({ - start: start, - left: value, - operator: "=", - right: expression(false), - end: prev() - }); - } - - // Create property - a.push(new AST_ObjectKeyVal({ - start: start, - quote: start.quote, - key: name instanceof AST_Node ? name : "" + name, - value: value, - end: prev() - })); - } - next(); - return new AST_Object({ properties: a }); - }); - - function class_(KindOfClass) { - var start, method, class_name, extends_, a = []; - - S.input.push_directives_stack(); // Push directive stack, but not scope stack - S.input.add_directive("use strict"); - - if (S.token.type == "name" && S.token.value != "extends") { - class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass); - } - - if (KindOfClass === AST_DefClass && !class_name) { - unexpected(); - } - - if (S.token.value == "extends") { - next(); - extends_ = expression(true); - } - - expect("{"); - - if (is("punc", ";")) { next(); } // Leading semicolons are okay in class bodies. - while (!is("punc", "}")) { - start = S.token; - method = concise_method_or_getset(as_property_name(), start, true); - if (!method) { unexpected(); } - a.push(method); - if (is("punc", ";")) { next(); } - } - - S.input.pop_directives_stack(); - - next(); - - return new KindOfClass({ - start: start, - name: class_name, - extends: extends_, - properties: a, - end: prev(), - }); - } - - function concise_method_or_getset(name, start, is_class) { - var get_ast = function(name, token) { - if (typeof name === "string" || typeof name === "number") { - return new AST_SymbolMethod({ - start: token, - name: "" + name, - end: prev() - }); - } else if (name === null) { - unexpected(); - } - return name; - }; - var is_async = false; - var is_static = false; - var is_generator = false; - var property_token = start; - if (is_class && name === "static" && !is("punc", "(")) { - is_static = true; - property_token = S.token; - name = as_property_name(); - } - if (name === "async" && !is("punc", "(") && !is("punc", ",") && !is("punc", "}")) { - is_async = true; - property_token = S.token; - name = as_property_name(); - } - if (name === null) { - is_generator = true; - property_token = S.token; - name = as_property_name(); - if (name === null) { - unexpected(); - } - } - if (is("punc", "(")) { - name = get_ast(name, start); - var node = new AST_ConciseMethod({ - start : start, - static : is_static, - is_generator: is_generator, - async : is_async, - key : name, - quote : name instanceof AST_SymbolMethod ? - property_token.quote : undefined, - value : create_accessor(is_generator, is_async), - end : prev() - }); - return node; - } - property_token = S.token; - if (name == "get") { - if (!is("punc") || is("punc", "[")) { - name = get_ast(as_property_name(), start); - return new AST_ObjectGetter({ - start : start, - static: is_static, - key : name, - quote : name instanceof AST_SymbolMethod ? - property_token.quote : undefined, - value : create_accessor(), - end : prev() - }); - } - } else if (name == "set") { - if (!is("punc") || is("punc", "[")) { - name = get_ast(as_property_name(), start); - return new AST_ObjectSetter({ - start : start, - static: is_static, - key : name, - quote : name instanceof AST_SymbolMethod ? - property_token.quote : undefined, - value : create_accessor(), - end : prev() - }); - } - } - } - - function import_() { - var start = prev(); - var imported_name; - var imported_names; - if (is("name")) { - imported_name = as_symbol(AST_SymbolImport); - } - - if (is("punc", ",")) { - next(); - } - - imported_names = map_names(true); - - if (imported_names || imported_name) { - expect_token("name", "from"); - } - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - return new AST_Import({ - start: start, - imported_name: imported_name, - imported_names: imported_names, - module_name: new AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - end: S.token, - }); - } - - function map_name(is_import) { - function make_symbol(type) { - return new type({ - name: as_property_name(), - start: prev(), - end: prev() - }); - } - - var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; - var type = is_import ? AST_SymbolImport : AST_SymbolExport; - var start = S.token; - var foreign_name; - var name; - - if (is_import) { - foreign_name = make_symbol(foreign_type); - } else { - name = make_symbol(type); - } - if (is("name", "as")) { - next(); // The "as" word - if (is_import) { - name = make_symbol(type); - } else { - foreign_name = make_symbol(foreign_type); - } - } else if (is_import) { - name = new type(foreign_name); - } else { - foreign_name = new foreign_type(name); - } - - return new AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: prev(), - }); - } - - function map_nameAsterisk(is_import, name) { - var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; - var type = is_import ? AST_SymbolImport : AST_SymbolExport; - var start = S.token; - var foreign_name; - var end = prev(); - - name = name || new type({ - name: "*", - start: start, - end: end, - }); - - foreign_name = new foreign_type({ - name: "*", - start: start, - end: end, - }); - - return new AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: end, - }); - } - - function map_names(is_import) { - var names; - if (is("punc", "{")) { - next(); - names = []; - while (!is("punc", "}")) { - names.push(map_name(is_import)); - if (is("punc", ",")) { - next(); - } - } - next(); - } else if (is("operator", "*")) { - var name; - next(); - if (is_import && is("name", "as")) { - next(); // The "as" word - name = as_symbol(is_import ? AST_SymbolImport : AST_SymbolExportForeign); - } - names = [map_nameAsterisk(is_import, name)]; - } - return names; - } - - function export_() { - var start = S.token; - var is_default; - var exported_names; - - if (is("keyword", "default")) { - is_default = true; - next(); - } else if (exported_names = map_names(false)) { - if (is("name", "from")) { - next(); - - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - - return new AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - module_name: new AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - end: prev(), - }); - } else { - return new AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - end: prev(), - }); - } - } - - var node; - var exported_value; - var exported_definition; - if (is("punc", "{") - || is_default - && (is("keyword", "class") || is("keyword", "function")) - && is_token(peek(), "punc")) { - exported_value = expression(false); - semicolon(); - } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) { - unexpected(node.start); - } else if (node instanceof AST_Definitions || node instanceof AST_Lambda || node instanceof AST_DefClass) { - exported_definition = node; - } else if (node instanceof AST_SimpleStatement) { - exported_value = node.body; - } else { - unexpected(node.start); - } - - return new AST_Export({ - start: start, - is_default: is_default, - exported_value: exported_value, - exported_definition: exported_definition, - end: prev(), - }); - } - - function as_property_name() { - var tmp = S.token; - switch (tmp.type) { - case "punc": - if (tmp.value === "[") { - next(); - var ex = expression(false); - expect("]"); - return ex; - } else unexpected(tmp); - case "operator": - if (tmp.value === "*") { - next(); - return null; - } - if (["delete", "in", "instanceof", "new", "typeof", "void"].indexOf(tmp.value) === -1) { - unexpected(tmp); - } - case "name": - if (tmp.value == "yield") { - if (is_in_generator()) { - token_error(tmp, "Yield cannot be used as identifier inside generators"); - } else if (!is_token(peek(), "punc", ":") - && !is_token(peek(), "punc", "(") - && S.input.has_directive("use strict")) { - token_error(tmp, "Unexpected yield identifier inside strict mode"); - } - } - case "string": - case "num": - case "keyword": - case "atom": - next(); - return tmp.value; - default: - unexpected(tmp); - } - } - - function as_name() { - var tmp = S.token; - if (tmp.type != "name") unexpected(); - next(); - return tmp.value; - } - - function _make_symbol(type) { - var name = S.token.value; - return new (name == "this" ? AST_This : - name == "super" ? AST_Super : - type)({ - name : String(name), - start : S.token, - end : S.token - }); - } - - function _verify_symbol(sym) { - var name = sym.name; - if (is_in_generator() && name == "yield") { - token_error(sym.start, "Yield cannot be used as identifier inside generators"); - } - if (S.input.has_directive("use strict")) { - if (name == "yield") { - token_error(sym.start, "Unexpected yield identifier inside strict mode"); - } - if (sym instanceof AST_SymbolDeclaration && (name == "arguments" || name == "eval")) { - token_error(sym.start, "Unexpected " + name + " in strict mode"); - } - } - } - - function as_symbol(type, noerror) { - if (!is("name")) { - if (!noerror) croak("Name expected"); - return null; - } - var sym = _make_symbol(type); - _verify_symbol(sym); - next(); - return sym; - } - - function mark_pure(call) { - var start = call.start; - var comments = start.comments_before; - var i = HOP(start, "comments_before_length") ? start.comments_before_length : comments.length; - while (--i >= 0) { - var comment = comments[i]; - if (/[@#]__PURE__/.test(comment.value)) { - call.pure = comment; - break; - } - } - } - - var subscripts = function(expr, allow_calls) { - var start = expr.start; - if (is("punc", ".")) { - next(); - return subscripts(new AST_Dot({ - start : start, - expression : expr, - property : as_name(), - end : prev() - }), allow_calls); - } - if (is("punc", "[")) { - next(); - var prop = expression(true); - expect("]"); - return subscripts(new AST_Sub({ - start : start, - expression : expr, - property : prop, - end : prev() - }), allow_calls); - } - if (allow_calls && is("punc", "(")) { - next(); - var call = new AST_Call({ - start : start, - expression : expr, - args : call_args(), - end : prev() - }); - mark_pure(call); - return subscripts(call, true); - } - if (is("template_head")) { - return subscripts(new AST_PrefixedTemplateString({ - start: start, - prefix: expr, - template_string: template_string(true), - end: prev() - }), allow_calls); - } - return expr; - }; - - var call_args = embed_tokens(function _call_args() { - var args = []; - while (!is("punc", ")")) { - if (is("expand", "...")) { - next(); - args.push(new AST_Expansion({ - start: prev(), - expression: expression(false), - end: prev() - })); - } else { - args.push(expression(false)); - } - if (!is("punc", ")")) { - expect(","); - if (is("punc", ")") && options.ecma < 8) unexpected(); - } - } - next(); - return args; - }); - - var maybe_unary = function(allow_calls, allow_arrows) { - var start = S.token; - if (start.type == "name" && start.value == "await") { - if (is_in_async()) { - next(); - return _await_expression(); - } else if (S.input.has_directive("use strict")) { - token_error(S.token, "Unexpected await identifier inside strict mode"); - } - } - if (is("operator") && UNARY_PREFIX(start.value)) { - next(); - handle_regexp(); - var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls)); - ex.start = start; - ex.end = prev(); - return ex; - } - var val = expr_atom(allow_calls, allow_arrows); - while (is("operator") && UNARY_POSTFIX(S.token.value) && !has_newline_before(S.token)) { - if (val instanceof AST_Arrow) unexpected(); - val = make_unary(AST_UnaryPostfix, S.token, val); - val.start = start; - val.end = S.token; - next(); - } - return val; - }; - - function make_unary(ctor, token, expr) { - var op = token.value; - switch (op) { - case "++": - case "--": - if (!is_assignable(expr)) - croak("Invalid use of " + op + " operator", token.line, token.col, token.pos); - break; - case "delete": - if (expr instanceof AST_SymbolRef && S.input.has_directive("use strict")) - croak("Calling delete on expression not allowed in strict mode", expr.start.line, expr.start.col, expr.start.pos); - break; - } - return new ctor({ operator: op, expression: expr }); - } - - var expr_op = function(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op == "in" && no_in) op = null; - if (op == "**" && left instanceof AST_UnaryPrefix - /* unary token in front not allowed - parenthesis required */ - && !is_token(left.start, "punc", "(") - && left.operator !== "--" && left.operator !== "++") - unexpected(left.start); - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && (prec > min_prec || (op === "**" && min_prec === prec))) { - next(); - var right = expr_op(maybe_unary(true), prec, no_in); - return expr_op(new AST_Binary({ - start : left.start, - left : left, - operator : op, - right : right, - end : right.end - }), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(maybe_unary(true, true), 0, no_in); - } - - var maybe_conditional = function(no_in) { - var start = S.token; - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return new AST_Conditional({ - start : start, - condition : expr, - consequent : yes, - alternative : expression(false, no_in), - end : prev() - }); - } - return expr; - }; - - function is_assignable(expr) { - return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef; - } - - function to_destructuring(node) { - if (node instanceof AST_Object) { - node = new AST_Destructuring({ - start: node.start, - names: node.properties.map(to_destructuring), - is_array: false, - end: node.end - }); - } else if (node instanceof AST_Array) { - var names = []; - - for (var i = 0; i < node.elements.length; i++) { - // Only allow expansion as last element - if (node.elements[i] instanceof AST_Expansion) { - if (i + 1 !== node.elements.length) { - token_error(node.elements[i].start, "Spread must the be last element in destructuring array"); - } - node.elements[i].expression = to_destructuring(node.elements[i].expression); - } - - names.push(to_destructuring(node.elements[i])); - } - - node = new AST_Destructuring({ - start: node.start, - names: names, - is_array: true, - end: node.end - }); - } else if (node instanceof AST_ObjectProperty) { - node.value = to_destructuring(node.value); - } else if (node instanceof AST_Assign) { - node = new AST_DefaultAssign({ - start: node.start, - left: node.left, - operator: "=", - right: node.right, - end: node.end - }); - } - return node; - } - - // In ES6, AssignmentExpression can also be an ArrowFunction - var maybe_assign = function(no_in) { - handle_regexp(); - var start = S.token; - - if (start.type == "name" && start.value == "yield") { - if (is_in_generator()) { - next(); - return _yield_expression(); - } else if (S.input.has_directive("use strict")) { - token_error(S.token, "Unexpected yield identifier inside strict mode"); - } - } - - var left = maybe_conditional(no_in); - var val = S.token.value; - - if (is("operator") && ASSIGNMENT(val)) { - if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { - next(); - return new AST_Assign({ - start : start, - left : left, - operator : val, - right : maybe_assign(no_in), - end : prev() - }); - } - croak("Invalid assignment"); - } - return left; - }; - - var expression = function(commas, no_in) { - var start = S.token; - var exprs = []; - while (true) { - exprs.push(maybe_assign(no_in)); - if (!commas || !is("punc", ",")) break; - next(); - commas = true; - } - return exprs.length == 1 ? exprs[0] : new AST_Sequence({ - start : start, - expressions : exprs, - end : peek() - }); - }; - - function in_loop(cont) { - ++S.in_loop; - var ret = cont(); - --S.in_loop; - return ret; - } - - if (options.expression) { - return expression(true); - } - - return (function() { - var start = S.token; - var body = []; - S.input.push_directives_stack(); - if (options.module) S.input.add_directive("use strict"); - while (!is("eof")) - body.push(statement()); - S.input.pop_directives_stack(); - var end = prev(); - var toplevel = options.toplevel; - if (toplevel) { - toplevel.body = toplevel.body.concat(body); - toplevel.end = end; - } else { - toplevel = new AST_Toplevel({ start: start, body: body, end: end }); - } - return toplevel; - })(); - -} diff --git a/tools/node_modules/terser/lib/propmangle.js b/tools/node_modules/terser/lib/propmangle.js deleted file mode 100644 index f0c749fedcc6..000000000000 --- a/tools/node_modules/terser/lib/propmangle.js +++ /dev/null @@ -1,271 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function find_builtins(reserved) { - reserved.push.apply(reserved, domprops); - - // Compatibility fix for some standard defined globals not defined on every js environment - var new_globals = ["Symbol", "Map", "Promise", "Proxy", "Reflect", "Set", "WeakMap", "WeakSet"]; - var objects = {}; - var global_ref = typeof global === "object" ? global : self; - - new_globals.forEach(function (new_global) { - objects[new_global] = global_ref[new_global] || new Function(); - }); - - // NaN will be included due to Number.NaN - [ - "null", - "true", - "false", - "Infinity", - "-Infinity", - "undefined", - ].forEach(add); - [ Object, Array, Function, Number, - String, Boolean, Error, Math, - Date, RegExp, objects.Symbol, ArrayBuffer, - DataView, decodeURI, decodeURIComponent, - encodeURI, encodeURIComponent, eval, EvalError, - Float32Array, Float64Array, Int8Array, Int16Array, - Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat, - parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError, - objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array, - Uint8ClampedArray, Uint16Array, Uint32Array, URIError, - objects.WeakMap, objects.WeakSet - ].forEach(function(ctor) { - Object.getOwnPropertyNames(ctor).map(add); - if (ctor.prototype) { - Object.getOwnPropertyNames(ctor.prototype).map(add); - } - }); - function add(name) { - push_uniq(reserved, name); - } -} - -function reserve_quoted_keys(ast, reserved) { - function add(name) { - push_uniq(reserved, name); - } - - ast.walk(new TreeWalker(function(node) { - if (node instanceof AST_ObjectKeyVal && node.quote) { - add(node.key); - } else if (node instanceof AST_ObjectProperty && node.quote) { - add(node.key.name); - } else if (node instanceof AST_Sub) { - addStrings(node.property, add); - } - })); -} - -function addStrings(node, add) { - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_Sequence) { - addStrings(node.tail_node(), add); - } else if (node instanceof AST_String) { - add(node.value); - } else if (node instanceof AST_Conditional) { - addStrings(node.consequent, add); - addStrings(node.alternative, add); - } - return true; - })); -} - -function mangle_properties(ast, options) { - options = defaults(options, { - builtins: false, - cache: null, - debug: false, - keep_quoted: false, - only_cache: false, - regex: null, - reserved: null, - }, true); - - var reserved = options.reserved; - if (!Array.isArray(reserved)) reserved = [reserved]; - if (!options.builtins) find_builtins(reserved); - - var cname = -1; - var cache; - if (options.cache) { - cache = options.cache.props; - cache.each(function(mangled_name) { - push_uniq(reserved, mangled_name); - }); - } else { - cache = new Dictionary(); - } - - var regex = options.regex; - - // note debug is either false (disabled), or a string of the debug suffix to use (enabled). - // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true' - // the same as passing an empty string. - var debug = options.debug !== false; - var debug_name_suffix; - if (debug) { - debug_name_suffix = (options.debug === true ? "" : options.debug); - } - - var names_to_mangle = []; - var unmangleable = []; - - // step 1: find candidates to mangle - ast.walk(new TreeWalker(function(node) { - if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string") { - add(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter or getter, since KeyVal is handled above - add(node.key.name); - } else if (node instanceof AST_Dot) { - var root = node; - while (root.expression) { - root = root.expression; - } - if (!(root.thedef && root.thedef.undeclared)) add(node.property); - } else if (node instanceof AST_Sub) { - addStrings(node.property, add); - } else if (node instanceof AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - addStrings(node.args[1], add); - } - })); - - // step 2: transform the tree, renaming properties - return ast.transform(new TreeTransformer(function(node) { - if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string") { - node.key = mangle(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter or getter - node.key.name = mangle(node.key.name); - } else if (node instanceof AST_Dot) { - node.property = mangle(node.property); - } else if (!options.keep_quoted && node instanceof AST_Sub) { - node.property = mangleStrings(node.property); - } else if (node instanceof AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - node.args[1] = mangleStrings(node.args[1]); - } - })); - - // only function declarations after this line - - function can_mangle(name) { - if (unmangleable.indexOf(name) >= 0) return false; - if (reserved.indexOf(name) >= 0) return false; - if (options.only_cache) { - return cache.has(name); - } - if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false; - return true; - } - - function should_mangle(name) { - if (regex && !regex.test(name)) return false; - if (reserved.indexOf(name) >= 0) return false; - return cache.has(name) - || names_to_mangle.indexOf(name) >= 0; - } - - function add(name) { - if (can_mangle(name)) - push_uniq(names_to_mangle, name); - - if (!should_mangle(name)) { - push_uniq(unmangleable, name); - } - } - - function mangle(name) { - if (!should_mangle(name)) { - return name; - } - - var mangled = cache.get(name); - if (!mangled) { - if (debug) { - // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo -> o._$foo$NNN_. - var debug_mangled = "_$" + name + "$" + debug_name_suffix + "_"; - - if (can_mangle(debug_mangled)) { - mangled = debug_mangled; - } - } - - // either debug mode is off, or it is on and we could not use the mangled name - if (!mangled) { - do { - mangled = base54(++cname); - } while (!can_mangle(mangled)); - } - - cache.set(name, mangled); - } - return mangled; - } - - function mangleStrings(node) { - return node.transform(new TreeTransformer(function(node) { - if (node instanceof AST_Sequence) { - var last = node.expressions.length - 1; - node.expressions[last] = mangleStrings(node.expressions[last]); - } else if (node instanceof AST_String) { - node.value = mangle(node.value); - } else if (node instanceof AST_Conditional) { - node.consequent = mangleStrings(node.consequent); - node.alternative = mangleStrings(node.alternative); - } - return node; - })); - } -} diff --git a/tools/node_modules/terser/lib/scope.js b/tools/node_modules/terser/lib/scope.js deleted file mode 100644 index 744e65aa9e93..000000000000 --- a/tools/node_modules/terser/lib/scope.js +++ /dev/null @@ -1,723 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function SymbolDef(scope, orig, init) { - this.name = orig.name; - this.orig = [ orig ]; - this.init = init; - this.eliminated = 0; - this.scope = scope; - this.references = []; - this.replaced = 0; - this.global = false; - this.export = false; - this.mangled_name = null; - this.undeclared = false; - this.id = SymbolDef.next_id++; -} - -SymbolDef.next_id = 1; - -var MASK_EXPORT_DONT_MANGLE = 1 << 0; -var MASK_EXPORT_WANT_MANGLE = 1 << 1; - -SymbolDef.prototype = { - unmangleable: function(options) { - if (!options) options = {}; - - return this.global && !options.toplevel - || (this.export & MASK_EXPORT_DONT_MANGLE) - || this.undeclared - || !options.eval && this.scope.pinned() - || (this.orig[0] instanceof AST_SymbolLambda - || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name) - || this.orig[0] instanceof AST_SymbolMethod - || (this.orig[0] instanceof AST_SymbolClass - || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name); - }, - mangle: function(options) { - var cache = options.cache && options.cache.props; - if (this.global && cache && cache.has(this.name)) { - this.mangled_name = cache.get(this.name); - } else if (!this.mangled_name && !this.unmangleable(options)) { - var s = this.scope; - var sym = this.orig[0]; - if (options.ie8 && sym instanceof AST_SymbolLambda) - s = s.parent_scope; - var def; - if (def = this.redefined()) { - this.mangled_name = def.mangled_name || def.name; - } else - this.mangled_name = s.next_mangled(options, this); - if (this.global && cache) { - cache.set(this.name, this.mangled_name); - } - } - }, - redefined: function() { - return this.defun && this.defun.variables.get(this.name); - } -}; - -AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) { - options = defaults(options, { - cache: null, - ie8: false, - safari10: false, - }); - - // pass 1: setup scope chaining and handle definitions - var self = this; - var scope = self.parent_scope = null; - var labels = new Dictionary(); - var defun = null; - var in_destructuring = null; - var for_scopes = []; - var tw = new TreeWalker(function(node, descend) { - if (node.is_block_scope()) { - var save_scope = scope; - node.block_scope = scope = new AST_Scope(node); - scope.init_scope_vars(save_scope); - if (!(node instanceof AST_Scope)) { - scope.uses_with = save_scope.uses_with; - scope.uses_eval = save_scope.uses_eval; - scope.directives = save_scope.directives; - } - if (options.safari10) { - if (node instanceof AST_For || node instanceof AST_ForIn) { - for_scopes.push(scope); - } - } - descend(); - scope = save_scope; - return true; - } - if (node instanceof AST_Destructuring) { - in_destructuring = node; // These don't nest - descend(); - in_destructuring = null; - return true; - } - if (node instanceof AST_Scope) { - node.init_scope_vars(scope); - var save_scope = scope; - var save_defun = defun; - var save_labels = labels; - defun = scope = node; - labels = new Dictionary(); - descend(); - scope = save_scope; - defun = save_defun; - labels = save_labels; - return true; // don't descend again in TreeWalker - } - if (node instanceof AST_LabeledStatement) { - var l = node.label; - if (labels.has(l.name)) { - throw new Error(string_template("Label {name} defined twice", l)); - } - labels.set(l.name, l); - descend(); - labels.del(l.name); - return true; // no descend again - } - if (node instanceof AST_With) { - for (var s = scope; s; s = s.parent_scope) - s.uses_with = true; - return; - } - if (node instanceof AST_Symbol) { - node.scope = scope; - } - if (node instanceof AST_Label) { - node.thedef = node; - node.references = []; - } - if (node instanceof AST_SymbolLambda) { - defun.def_function(node, node.name == "arguments" ? undefined : defun); - } else if (node instanceof AST_SymbolDefun) { - // Careful here, the scope where this should be defined is - // the parent scope. The reason is that we enter a new - // scope when we encounter the AST_Defun node (which is - // instanceof AST_Scope) but we get to the symbol a bit - // later. - mark_export((node.scope = defun.parent_scope.get_defun_scope()).def_function(node, defun), 1); - } else if (node instanceof AST_SymbolClass) { - mark_export(defun.def_variable(node, defun), 1); - } else if (node instanceof AST_SymbolImport) { - scope.def_variable(node); - } else if (node instanceof AST_SymbolDefClass) { - // This deals with the name of the class being available - // inside the class. - mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1); - } else if (node instanceof AST_SymbolVar - || node instanceof AST_SymbolLet - || node instanceof AST_SymbolConst) { - var def; - if (node instanceof AST_SymbolBlockDeclaration) { - def = scope.def_variable(node, null); - } else { - def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : undefined); - } - if (!all(def.orig, function(sym) { - if (sym === node) return true; - if (node instanceof AST_SymbolBlockDeclaration) { - return sym instanceof AST_SymbolLambda; - } - return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst); - })) { - js_error( - node.name + " redeclared", - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2); - def.destructuring = in_destructuring; - if (defun !== scope) { - node.mark_enclosed(options); - var def = scope.find_variable(node); - if (node.thedef !== def) { - node.thedef = def; - node.reference(options); - } - } - } else if (node instanceof AST_SymbolCatch) { - scope.def_variable(node).defun = defun; - } else if (node instanceof AST_LabelRef) { - var sym = labels.get(node.name); - if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { - name: node.name, - line: node.start.line, - col: node.start.col - })); - node.thedef = sym; - } - if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) { - js_error( - node.TYPE + " statement may only appear at top level", - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - - function mark_export(def, level) { - if (in_destructuring) { - var i = 0; - do { - level++; - } while (tw.parent(i++) !== in_destructuring); - } - var node = tw.parent(level); - if (def.export = node instanceof AST_Export && MASK_EXPORT_DONT_MANGLE) { - var exported = node.exported_definition; - if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) { - def.export = MASK_EXPORT_WANT_MANGLE; - } - } - } - }); - self.walk(tw); - - // pass 2: find back references and eval - self.globals = new Dictionary(); - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_LoopControl && node.label) { - node.label.thedef.references.push(node); - return true; - } - if (node instanceof AST_SymbolRef) { - var name = node.name; - if (name == "eval" && tw.parent() instanceof AST_Call) { - for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) { - s.uses_eval = true; - } - } - var sym; - if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name - || !(sym = node.scope.find_variable(name))) { - sym = self.def_global(node); - if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE; - } else if (sym.scope instanceof AST_Lambda && name == "arguments") { - sym.scope.uses_arguments = true; - } - node.thedef = sym; - node.reference(options); - if (node.scope.is_block_scope() - && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) { - node.scope = node.scope.get_defun_scope(); - } - return true; - } - // ensure mangling works if catch reuses a scope variable - var def; - if (node instanceof AST_SymbolCatch && (def = node.definition().redefined())) { - var s = node.scope; - while (s) { - push_uniq(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } - } - }); - self.walk(tw); - - // pass 3: work around IE8 and Safari catch scope bugs - if (options.ie8 || options.safari10) { - self.walk(new TreeWalker(function(node, descend) { - if (node instanceof AST_SymbolCatch) { - var name = node.name; - var refs = node.thedef.references; - var scope = node.thedef.defun; - var def = scope.find_variable(name) || self.globals.get(name) || scope.def_variable(node); - refs.forEach(function(ref) { - ref.thedef = def; - ref.reference(options); - }); - node.thedef = def; - node.reference(options); - return true; - } - })); - } - - // pass 4: add symbol definitions to loop scopes - // Safari/Webkit bug workaround - loop init let variable shadowing argument. - // https://github.com/mishoo/UglifyJS2/issues/1753 - // https://bugs.webkit.org/show_bug.cgi?id=171041 - if (options.safari10) { - for (var i = 0; i < for_scopes.length; i++) { - var scope = for_scopes[i]; - scope.parent_scope.variables.each(function(def) { - push_uniq(scope.enclosed, def); - }); - } - } -}); - -AST_Toplevel.DEFMETHOD("def_global", function(node) { - var globals = this.globals, name = node.name; - if (globals.has(name)) { - return globals.get(name); - } else { - var g = new SymbolDef(this, node); - g.undeclared = true; - g.global = true; - globals.set(name, g); - return g; - } -}); - -AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope) { - this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) - this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope) - this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement - this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` - this.parent_scope = parent_scope; // the parent scope - this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes - this.cname = -1; // the current index for mangling functions/variables -}); - -AST_Node.DEFMETHOD("is_block_scope", return_false); -AST_Class.DEFMETHOD("is_block_scope", return_false); -AST_Lambda.DEFMETHOD("is_block_scope", return_false); -AST_Toplevel.DEFMETHOD("is_block_scope", return_false); -AST_SwitchBranch.DEFMETHOD("is_block_scope", return_false); -AST_Block.DEFMETHOD("is_block_scope", return_true); -AST_IterationStatement.DEFMETHOD("is_block_scope", return_true); - -AST_Lambda.DEFMETHOD("init_scope_vars", function() { - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; - this.def_variable(new AST_SymbolFunarg({ - name: "arguments", - start: this.start, - end: this.end - })); -}); - -AST_Arrow.DEFMETHOD("init_scope_vars", function() { - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; -}); - -AST_Symbol.DEFMETHOD("mark_enclosed", function(options) { - var def = this.definition(); - var s = this.scope; - while (s) { - push_uniq(s.enclosed, def); - if (options.keep_fnames) { - s.functions.each(function(d) { - if (keep_name(options.keep_fnames, d.name)) { - push_uniq(def.scope.enclosed, d); - } - }); - } - if (s === def.scope) break; - s = s.parent_scope; - } -}); - -AST_Symbol.DEFMETHOD("reference", function(options) { - this.definition().references.push(this); - this.mark_enclosed(options); -}); - -AST_Scope.DEFMETHOD("find_variable", function(name) { - if (name instanceof AST_Symbol) name = name.name; - return this.variables.get(name) - || (this.parent_scope && this.parent_scope.find_variable(name)); -}); - -AST_Scope.DEFMETHOD("def_function", function(symbol, init) { - var def = this.def_variable(symbol, init); - if (!def.init || def.init instanceof AST_Defun) def.init = init; - this.functions.set(symbol.name, def); - return def; -}); - -AST_Scope.DEFMETHOD("def_variable", function(symbol, init) { - var def = this.variables.get(symbol.name); - if (def) { - def.orig.push(symbol); - if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) { - def.init = init; - } - } else { - def = new SymbolDef(this, symbol, init); - this.variables.set(symbol.name, def); - def.global = !this.parent_scope; - } - return symbol.thedef = def; -}); - -function next_mangled(scope, options) { - var ext = scope.enclosed; - out: while (true) { - var m = base54(++scope.cname); - if (!is_identifier(m)) continue; // skip over "do" - - // https://github.com/mishoo/UglifyJS2/issues/242 -- do not - // shadow a name reserved from mangling. - if (member(m, options.reserved)) continue; - - // we must ensure that the mangled name does not shadow a name - // from some parent scope that is referenced in this or in - // inner scopes. - for (var i = ext.length; --i >= 0;) { - var sym = ext[i]; - var name = sym.mangled_name || (sym.unmangleable(options) && sym.name); - if (m == name) continue out; - } - return m; - } -} - -AST_Scope.DEFMETHOD("next_mangled", function(options) { - return next_mangled(this, options); -}); - -AST_Toplevel.DEFMETHOD("next_mangled", function(options) { - var name; - do { - name = next_mangled(this, options); - } while (member(name, this.mangled_names)); - return name; -}); - -AST_Function.DEFMETHOD("next_mangled", function(options, def) { - // #179, #326 - // in Safari strict mode, something like (function x(x){...}) is a syntax error; - // a function expression's argument cannot shadow the function expression's name - - var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition(); - - // the function's mangled_name is null when keep_fnames is true - var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null; - - while (true) { - var name = next_mangled(this, options); - if (!tricky_name || tricky_name != name) - return name; - } -}); - -AST_Symbol.DEFMETHOD("unmangleable", function(options) { - var def = this.definition(); - return !def || def.unmangleable(options); -}); - -// labels are always mangleable -AST_Label.DEFMETHOD("unmangleable", return_false); - -AST_Symbol.DEFMETHOD("unreferenced", function() { - return !this.definition().references.length && !this.scope.pinned(); -}); - -AST_Symbol.DEFMETHOD("definition", function() { - return this.thedef; -}); - -AST_Symbol.DEFMETHOD("global", function() { - return this.definition().global; -}); - -AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options) { - options = defaults(options, { - eval : false, - ie8 : false, - keep_classnames: false, - keep_fnames : false, - module : false, - reserved : [], - toplevel : false, - }); - if (options["module"]) { - options.toplevel = true; - } - if (!Array.isArray(options.reserved)) options.reserved = []; - // Never mangle arguments - push_uniq(options.reserved, "arguments"); - return options; -}); - -AST_Toplevel.DEFMETHOD("mangle_names", function(options) { - options = this._default_mangler_options(options); - - // We only need to mangle declaration nodes. Special logic wired - // into the code generator will display the mangled name if it's - // present (and for AST_SymbolRef-s it'll use the mangled name of - // the AST_SymbolDeclaration that it points to). - var lname = -1; - var to_mangle = []; - - var mangled_names = this.mangled_names = []; - if (options.cache) { - this.globals.each(collect); - if (options.cache.props) { - options.cache.props.each(function(mangled_name) { - push_uniq(mangled_names, mangled_name); - }); - } - } - - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_LabeledStatement) { - // lname is incremented when we get to the AST_Label - var save_nesting = lname; - descend(); - lname = save_nesting; - return true; // don't descend again in TreeWalker - } - if (node instanceof AST_Scope) { - node.variables.each(collect); - return; - } - if (node.is_block_scope()) { - node.block_scope.variables.each(collect); - return; - } - if (node instanceof AST_Label) { - var name; - do name = base54(++lname); while (!is_identifier(name)); - node.mangled_name = name; - return true; - } - if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) { - to_mangle.push(node.definition()); - return; - } - }); - this.walk(tw); - to_mangle.forEach(function(def) { def.mangle(options); }); - - function collect(symbol) { - if (!member(symbol.name, options.reserved)) { - if (!(symbol.export & MASK_EXPORT_DONT_MANGLE)) { - to_mangle.push(symbol); - } - } - } -}); - -AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { - var cache = options.cache && options.cache.props; - var avoid = Object.create(null); - options.reserved.forEach(to_avoid); - this.globals.each(add_def); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_Scope) node.variables.each(add_def); - if (node instanceof AST_SymbolCatch) add_def(node.definition()); - })); - return avoid; - - function to_avoid(name) { - avoid[name] = true; - } - - function add_def(def) { - var name = def.name; - if (def.global && cache && cache.has(name)) name = cache.get(name); - else if (!def.unmangleable(options)) return; - to_avoid(name); - } -}); - -AST_Toplevel.DEFMETHOD("expand_names", function(options) { - base54.reset(); - base54.sort(); - options = this._default_mangler_options(options); - var avoid = this.find_colliding_names(options); - var cname = 0; - this.globals.each(rename); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_Scope) node.variables.each(rename); - if (node instanceof AST_SymbolCatch) rename(node.definition()); - })); - - function next_name() { - var name; - do { - name = base54(cname++); - } while (avoid[name] || !is_identifier(name)); - return name; - } - - function rename(def) { - if (def.global && options.cache) return; - if (def.unmangleable(options)) return; - if (member(def.name, options.reserved)) return; - var d = def.redefined(); - def.name = d ? d.name : next_name(); - def.orig.forEach(function(sym) { - sym.name = def.name; - }); - def.references.forEach(function(sym) { - sym.name = def.name; - }); - } -}); - -AST_Node.DEFMETHOD("tail_node", return_this); -AST_Sequence.DEFMETHOD("tail_node", function() { - return this.expressions[this.expressions.length - 1]; -}); - -AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { - options = this._default_mangler_options(options); - try { - AST_Node.prototype.print = function(stream, force_parens) { - this._print(stream, force_parens); - if (this instanceof AST_Symbol && !this.unmangleable(options)) { - base54.consider(this.name, -1); - } else if (options.properties) { - if (this instanceof AST_Dot) { - base54.consider(this.property, -1); - } else if (this instanceof AST_Sub) { - skip_string(this.property); - } - } - }; - base54.consider(this.print_to_string(), 1); - } finally { - AST_Node.prototype.print = AST_Node.prototype._print; - } - base54.sort(); - - function skip_string(node) { - if (node instanceof AST_String) { - base54.consider(node.value, -1); - } else if (node instanceof AST_Conditional) { - skip_string(node.consequent); - skip_string(node.alternative); - } else if (node instanceof AST_Sequence) { - skip_string(node.tail_node()); - } - } -}); - -var base54 = (function() { - var leading = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""); - var digits = "0123456789".split(""); - var chars, frequency; - function reset() { - frequency = Object.create(null); - leading.forEach(function(ch) { - frequency[ch] = 0; - }); - digits.forEach(function(ch) { - frequency[ch] = 0; - }); - } - base54.consider = function(str, delta) { - for (var i = str.length; --i >= 0;) { - frequency[str[i]] += delta; - } - }; - function compare(a, b) { - return frequency[b] - frequency[a]; - } - base54.sort = function() { - chars = mergeSort(leading, compare).concat(mergeSort(digits, compare)); - }; - base54.reset = reset; - reset(); - function base54(num) { - var ret = "", base = 54; - num++; - do { - num--; - ret += chars[num % base]; - num = Math.floor(num / base); - base = 64; - } while (num > 0); - return ret; - } - return base54; -})(); diff --git a/tools/node_modules/terser/lib/sourcemap.js b/tools/node_modules/terser/lib/sourcemap.js deleted file mode 100644 index 173d9ed9fa35..000000000000 --- a/tools/node_modules/terser/lib/sourcemap.js +++ /dev/null @@ -1,97 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -// a small wrapper around fitzgen's source-map library -function SourceMap(options) { - options = defaults(options, { - file : null, - root : null, - orig : null, - - orig_line_diff : 0, - dest_line_diff : 0, - }); - var generator = new MOZ_SourceMap.SourceMapGenerator({ - file : options.file, - sourceRoot : options.root - }); - var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig); - - if (orig_map && Array.isArray(options.orig.sources)) { - orig_map._sources.toArray().forEach(function(source) { - var sourceContent = orig_map.sourceContentFor(source, true); - if (sourceContent) { - generator.setSourceContent(source, sourceContent); - } - }); - } - - function add(source, gen_line, gen_col, orig_line, orig_col, name) { - if (orig_map) { - var info = orig_map.originalPositionFor({ - line: orig_line, - column: orig_col - }); - if (info.source === null) { - return; - } - source = info.source; - orig_line = info.line; - orig_col = info.column; - name = info.name || name; - } - generator.addMapping({ - generated : { line: gen_line + options.dest_line_diff, column: gen_col }, - original : { line: orig_line + options.orig_line_diff, column: orig_col }, - source : source, - name : name - }); - } - return { - add : add, - get : function() { return generator; }, - toString : function() { return JSON.stringify(generator.toJSON()); } - }; -} diff --git a/tools/node_modules/terser/lib/transform.js b/tools/node_modules/terser/lib/transform.js deleted file mode 100644 index a760e51dc883..000000000000 --- a/tools/node_modules/terser/lib/transform.js +++ /dev/null @@ -1,275 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -// Tree transformer helpers. - -function TreeTransformer(before, after) { - TreeWalker.call(this); - this.before = before; - this.after = after; -} -TreeTransformer.prototype = new TreeWalker; - -(function(undefined) { - - function _(node, descend) { - node.DEFMETHOD("transform", function(tw, in_list) { - var x, y; - tw.push(this); - if (tw.before) x = tw.before(this, descend, in_list); - if (x === undefined) { - x = this; - descend(x, tw); - if (tw.after) { - y = tw.after(x, in_list); - if (y !== undefined) x = y; - } - } - tw.pop(); - return x; - }); - } - - function do_list(list, tw) { - return MAP(list, function(node) { - return node.transform(tw, true); - }); - } - - _(AST_Node, noop); - - _(AST_LabeledStatement, function(self, tw) { - self.label = self.label.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_SimpleStatement, function(self, tw) { - self.body = self.body.transform(tw); - }); - - _(AST_Block, function(self, tw) { - self.body = do_list(self.body, tw); - }); - - _(AST_Do, function(self, tw) { - self.body = self.body.transform(tw); - self.condition = self.condition.transform(tw); - }); - - _(AST_While, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_For, function(self, tw) { - if (self.init) self.init = self.init.transform(tw); - if (self.condition) self.condition = self.condition.transform(tw); - if (self.step) self.step = self.step.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_ForIn, function(self, tw) { - self.init = self.init.transform(tw); - self.object = self.object.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_With, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_Exit, function(self, tw) { - if (self.value) self.value = self.value.transform(tw); - }); - - _(AST_LoopControl, function(self, tw) { - if (self.label) self.label = self.label.transform(tw); - }); - - _(AST_If, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - if (self.alternative) self.alternative = self.alternative.transform(tw); - }); - - _(AST_Switch, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - - _(AST_Case, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - - _(AST_Try, function(self, tw) { - self.body = do_list(self.body, tw); - if (self.bcatch) self.bcatch = self.bcatch.transform(tw); - if (self.bfinally) self.bfinally = self.bfinally.transform(tw); - }); - - _(AST_Catch, function(self, tw) { - if (self.argname) self.argname = self.argname.transform(tw); - self.body = do_list(self.body, tw); - }); - - _(AST_Definitions, function(self, tw) { - self.definitions = do_list(self.definitions, tw); - }); - - _(AST_VarDef, function(self, tw) { - self.name = self.name.transform(tw); - if (self.value) self.value = self.value.transform(tw); - }); - - _(AST_Destructuring, function(self, tw) { - self.names = do_list(self.names, tw); - }); - - _(AST_Lambda, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - self.argnames = do_list(self.argnames, tw); - if (self.body instanceof AST_Node) { - self.body = self.body.transform(tw); - } else { - self.body = do_list(self.body, tw); - } - }); - - _(AST_Call, function(self, tw) { - self.expression = self.expression.transform(tw); - self.args = do_list(self.args, tw); - }); - - _(AST_Sequence, function(self, tw) { - self.expressions = do_list(self.expressions, tw); - }); - - _(AST_Dot, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - - _(AST_Sub, function(self, tw) { - self.expression = self.expression.transform(tw); - self.property = self.property.transform(tw); - }); - - _(AST_Yield, function(self, tw) { - if (self.expression) self.expression = self.expression.transform(tw); - }); - - _(AST_Await, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - - _(AST_Unary, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - - _(AST_Binary, function(self, tw) { - self.left = self.left.transform(tw); - self.right = self.right.transform(tw); - }); - - _(AST_Conditional, function(self, tw) { - self.condition = self.condition.transform(tw); - self.consequent = self.consequent.transform(tw); - self.alternative = self.alternative.transform(tw); - }); - - _(AST_Array, function(self, tw) { - self.elements = do_list(self.elements, tw); - }); - - _(AST_Object, function(self, tw) { - self.properties = do_list(self.properties, tw); - }); - - _(AST_ObjectProperty, function(self, tw) { - if (self.key instanceof AST_Node) { - self.key = self.key.transform(tw); - } - self.value = self.value.transform(tw); - }); - - _(AST_Class, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - if (self.extends) self.extends = self.extends.transform(tw); - self.properties = do_list(self.properties, tw); - }); - - _(AST_Expansion, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - - _(AST_NameMapping, function(self, tw) { - self.foreign_name = self.foreign_name.transform(tw); - self.name = self.name.transform(tw); - }); - - _(AST_Import, function(self, tw) { - if (self.imported_name) self.imported_name = self.imported_name.transform(tw); - if (self.imported_names) do_list(self.imported_names, tw); - self.module_name = self.module_name.transform(tw); - }); - - _(AST_Export, function(self, tw) { - if (self.exported_definition) self.exported_definition = self.exported_definition.transform(tw); - if (self.exported_value) self.exported_value = self.exported_value.transform(tw); - if (self.exported_names) do_list(self.exported_names, tw); - if (self.module_name) self.module_name = self.module_name.transform(tw); - }); - - _(AST_TemplateString, function(self, tw) { - self.segments = do_list(self.segments, tw); - }); - - _(AST_PrefixedTemplateString, function(self, tw) { - self.prefix = self.prefix.transform(tw); - self.template_string = self.template_string.transform(tw); - }); - -})(); diff --git a/tools/node_modules/terser/lib/utils.js b/tools/node_modules/terser/lib/utils.js deleted file mode 100644 index 6678c568136a..000000000000 --- a/tools/node_modules/terser/lib/utils.js +++ /dev/null @@ -1,350 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -function characters(str) { - return str.split(""); -} - -function member(name, array) { - return array.indexOf(name) >= 0; -} - -function find_if(func, array) { - for (var i = 0, n = array.length; i < n; ++i) { - if (func(array[i])) - return array[i]; - } -} - -function repeat_string(str, i) { - if (i <= 0) return ""; - if (i == 1) return str; - var d = repeat_string(str, i >> 1); - d += d; - if (i & 1) d += str; - return d; -} - -function configure_error_stack(fn) { - Object.defineProperty(fn.prototype, "stack", { - get: function() { - var err = new Error(this.message); - err.name = this.name; - try { - throw err; - } catch(e) { - return e.stack; - } - } - }); -} - -function DefaultsError(msg, defs) { - this.message = msg; - this.defs = defs; -} -DefaultsError.prototype = Object.create(Error.prototype); -DefaultsError.prototype.constructor = DefaultsError; -DefaultsError.prototype.name = "DefaultsError"; -configure_error_stack(DefaultsError); - -DefaultsError.croak = function(msg, defs) { - throw new DefaultsError(msg, defs); -}; - -function defaults(args, defs, croak) { - if (args === true) - args = {}; - var ret = args || {}; - if (croak) for (var i in ret) if (HOP(ret, i) && !HOP(defs, i)) - DefaultsError.croak("`" + i + "` is not a supported option", defs); - for (var i in defs) if (HOP(defs, i)) { - ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; - } - return ret; -} - -function merge(obj, ext) { - var count = 0; - for (var i in ext) if (HOP(ext, i)) { - obj[i] = ext[i]; - count++; - } - return count; -} - -function noop() {} -function return_false() { return false; } -function return_true() { return true; } -function return_this() { return this; } -function return_null() { return null; } - -var MAP = (function() { - function MAP(a, f, backwards) { - var ret = [], top = [], i; - function doit() { - var val = f(a[i], i); - var is_last = val instanceof Last; - if (is_last) val = val.v; - if (val instanceof AtTop) { - val = val.v; - if (val instanceof Splice) { - top.push.apply(top, backwards ? val.v.slice().reverse() : val.v); - } else { - top.push(val); - } - } else if (val !== skip) { - if (val instanceof Splice) { - ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v); - } else { - ret.push(val); - } - } - return is_last; - } - if (a instanceof Array) { - if (backwards) { - for (i = a.length; --i >= 0;) if (doit()) break; - ret.reverse(); - top.reverse(); - } else { - for (i = 0; i < a.length; ++i) if (doit()) break; - } - } else { - for (i in a) if (HOP(a, i)) if (doit()) break; - } - return top.concat(ret); - } - MAP.at_top = function(val) { return new AtTop(val); }; - MAP.splice = function(val) { return new Splice(val); }; - MAP.last = function(val) { return new Last(val); }; - var skip = MAP.skip = {}; - function AtTop(val) { this.v = val; } - function Splice(val) { this.v = val; } - function Last(val) { this.v = val; } - return MAP; -})(); - -function push_uniq(array, el) { - if (array.indexOf(el) < 0) - array.push(el); -} - -function string_template(text, props) { - return text.replace(/\{(.+?)\}/g, function(str, p) { - return props && props[p]; - }); -} - -function remove(array, el) { - for (var i = array.length; --i >= 0;) { - if (array[i] === el) array.splice(i, 1); - } -} - -function mergeSort(array, cmp) { - if (array.length < 2) return array.slice(); - function merge(a, b) { - var r = [], ai = 0, bi = 0, i = 0; - while (ai < a.length && bi < b.length) { - cmp(a[ai], b[bi]) <= 0 - ? r[i++] = a[ai++] - : r[i++] = b[bi++]; - } - if (ai < a.length) r.push.apply(r, a.slice(ai)); - if (bi < b.length) r.push.apply(r, b.slice(bi)); - return r; - } - function _ms(a) { - if (a.length <= 1) - return a; - var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); - left = _ms(left); - right = _ms(right); - return merge(left, right); - } - return _ms(array); -} - -// this function is taken from Acorn [1], written by Marijn Haverbeke -// [1] https://github.com/marijnh/acorn -function makePredicate(words) { - if (!(words instanceof Array)) words = words.split(" "); - var f = "", cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) - if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - cats.push([words[i]]); - } - function quote(word) { - return JSON.stringify(word).replace(/[\u2028\u2029]/g, function(s) { - switch (s) { - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - } - return s; - }); - } - function compareTo(arr) { - if (arr.length == 1) return f += "return str === " + quote(arr[0]) + ";"; - f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) f += "case " + quote(arr[i]) + ":"; - f += "return true}return false;"; - } - // When there are more than three length categories, an outer - // switch first dispatches on the lengths, to save on comparisons. - if (cats.length > 3) { - cats.sort(function(a, b) {return b.length - a.length;}); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}"; - // Otherwise, simply generate a flat `switch` statement. - } else { - compareTo(words); - } - return new Function("str", f); -} - -function all(array, predicate) { - for (var i = array.length; --i >= 0;) - if (!predicate(array[i])) - return false; - return true; -} - -function Dictionary() { - this._values = Object.create(null); - this._size = 0; -} -Dictionary.prototype = { - set: function(key, val) { - if (!this.has(key)) ++this._size; - this._values["$" + key] = val; - return this; - }, - add: function(key, val) { - if (this.has(key)) { - this.get(key).push(val); - } else { - this.set(key, [ val ]); - } - return this; - }, - get: function(key) { return this._values["$" + key]; }, - del: function(key) { - if (this.has(key)) { - --this._size; - delete this._values["$" + key]; - } - return this; - }, - has: function(key) { return ("$" + key) in this._values; }, - each: function(f) { - for (var i in this._values) - f(this._values[i], i.substr(1)); - }, - size: function() { - return this._size; - }, - map: function(f) { - var ret = []; - for (var i in this._values) - ret.push(f(this._values[i], i.substr(1))); - return ret; - }, - clone: function() { - var ret = new Dictionary(); - for (var i in this._values) - ret._values[i] = this._values[i]; - ret._size = this._size; - return ret; - }, - toObject: function() { return this._values; } -}; -Dictionary.fromObject = function(obj) { - var dict = new Dictionary(); - dict._size = merge(dict._values, obj); - return dict; -}; -exports.Dictionary = Dictionary; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -// return true if the node at the top of the stack (that means the -// innermost node in the current output) is lexically the first in -// a statement. -function first_in_statement(stack) { - var node = stack.parent(-1); - for (var i = 0, p; p = stack.parent(i); i++) { - if (p instanceof AST_Statement && p.body === node) - return true; - if ((p instanceof AST_Sequence && p.expressions[0] === node) || - (p.TYPE == "Call" && p.expression === node ) || - (p instanceof AST_Dot && p.expression === node ) || - (p instanceof AST_Sub && p.expression === node ) || - (p instanceof AST_Conditional && p.condition === node ) || - (p instanceof AST_Binary && p.left === node ) || - (p instanceof AST_UnaryPostfix && p.expression === node ) - ) { - node = p; - } else { - return false; - } - } -} - -function keep_name(keep_setting, name) { - return keep_setting === true - || (keep_setting instanceof RegExp && keep_setting.test(name)); -} From 29afbfd938ef4f61d0129b8801fd3f315f983f64 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:35:51 -0800 Subject: [PATCH 69/82] revert --- src/library.js | 96 ------------------------------------------------- src/preamble.js | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ src/settings.js | 6 ++-- 3 files changed, 97 insertions(+), 99 deletions(-) diff --git a/src/library.js b/src/library.js index 3475f77614f6..5d3f0d2e6cd2 100644 --- a/src/library.js +++ b/src/library.js @@ -4631,102 +4631,6 @@ LibraryManager.library = { out('AD:' + [line, value]); }, - // ccall/cwrap - - // Returns the C function with a specified identifier (for C++, you need to do manual name mangling) - $getCFunc: function(ident) { - var func = Module['_' + ident]; // closure exported function - assert(func, 'Cannot call unknown function ' + ident + ', make sure it is exported'); - return func; - }, - - // C calling interface. - $ccall__deps: ['$getCFunc'], - $ccall: function(ident, returnType, argTypes, args, opts) { - // For fast lookup of conversion functions - var toC = { - 'array': function(arr) { - var ret = stackAlloc(arr.length); - writeArrayToMemory(arr, ret); - return ret; - }, - 'string': function(str) { - var ret = 0; - if (str !== null && str !== undefined && str !== 0) { // null string - // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0' - var len = (str.length << 2) + 1; - ret = stackAlloc(len); - stringToUTF8(str, ret, len); - } - return ret; - } - }; - - function convertReturnValue(ret) { - if (returnType === 'string') return UTF8ToString(ret); - if (returnType === 'boolean') return Boolean(ret); - return ret; - } - - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; -#if ASSERTIONS - assert(returnType !== 'array', 'Return type should not be "array".'); -#endif - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); -#if EMTERPRETIFY_ASYNC - if (typeof EmterpreterAsync === 'object' && EmterpreterAsync.state) { -#if ASSERTIONS - assert(opts && opts.async, 'The call to ' + ident + ' is running asynchronously. If this was intended, add the async option to the ccall/cwrap call.'); - assert(!EmterpreterAsync.restartFunc, 'Cannot have multiple async ccalls in flight at once'); -#endif - return new Promise(function(resolve) { - EmterpreterAsync.restartFunc = func; - EmterpreterAsync.asyncFinalizers.push(function(ret) { - if (stack !== 0) stackRestore(stack); - resolve(convertReturnValue(ret)); - }); - }); - } -#endif - ret = convertReturnValue(ret); - if (stack !== 0) stackRestore(stack); -#if EMTERPRETIFY_ASYNC - // If this is an async ccall, ensure we return a promise - if (opts && opts.async) return Promise.resolve(ret); -#endif - return ret; - }, - - $cwrap__deps: ['$ccall'], - $cwrap: function(ident, returnType, argTypes, opts) { -#if !ASSERTIONS - argTypes = argTypes || []; - // When the function takes numbers and returns a number, we can just return - // the original function - var numericArgs = argTypes.every(function(type){ return type === 'number'}); - var numericRet = returnType !== 'string'; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } -#endif - return function() { - return ccall(ident, returnType, argTypes, arguments, opts); - } - }, - // misc definitions to avoid unnecessary unresolved symbols from fastcomp emscripten_prep_setjmp: true, emscripten_cleanup_setjmp: true, diff --git a/src/preamble.js b/src/preamble.js index d4965181e9d9..de0b9e81b843 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -57,6 +57,100 @@ function assert(condition, text) { } } +var globalScope = this; + +// Returns the C function with a specified identifier (for C++, you need to do manual name mangling) +function getCFunc(ident) { + var func = Module['_' + ident]; // closure exported function + assert(func, 'Cannot call unknown function ' + ident + ', make sure it is exported'); + return func; +} + +// C calling interface. +function ccall(ident, returnType, argTypes, args, opts) { + // For fast lookup of conversion functions + var toC = { + 'string': function(str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { // null string + // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0' + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len); + } + return ret; + }, + 'array': function(arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret; + } + }; + + function convertReturnValue(ret) { + if (returnType === 'string') return UTF8ToString(ret); + if (returnType === 'boolean') return Boolean(ret); + return ret; + } + + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; +#if ASSERTIONS + assert(returnType !== 'array', 'Return type should not be "array".'); +#endif + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]); + } else { + cArgs[i] = args[i]; + } + } + } + var ret = func.apply(null, cArgs); +#if EMTERPRETIFY_ASYNC + if (typeof EmterpreterAsync === 'object' && EmterpreterAsync.state) { +#if ASSERTIONS + assert(opts && opts.async, 'The call to ' + ident + ' is running asynchronously. If this was intended, add the async option to the ccall/cwrap call.'); + assert(!EmterpreterAsync.restartFunc, 'Cannot have multiple async ccalls in flight at once'); +#endif + return new Promise(function(resolve) { + EmterpreterAsync.restartFunc = func; + EmterpreterAsync.asyncFinalizers.push(function(ret) { + if (stack !== 0) stackRestore(stack); + resolve(convertReturnValue(ret)); + }); + }); + } +#endif + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); +#if EMTERPRETIFY_ASYNC + // If this is an async ccall, ensure we return a promise + if (opts && opts.async) return Promise.resolve(ret); +#endif + return ret; +} + +function cwrap(ident, returnType, argTypes, opts) { +#if !ASSERTIONS + argTypes = argTypes || []; + // When the function takes numbers and returns a number, we can just return + // the original function + var numericArgs = argTypes.every(function(type){ return type === 'number'}); + var numericRet = returnType !== 'string'; + if (numericRet && numericArgs && !opts) { + return getCFunc(ident); + } +#endif + return function() { + return ccall(ident, returnType, argTypes, arguments, opts); + } +} + /** @type {function(number, number, string, boolean=)} */ function setValue(ptr, value, type, noSafe) { type = type || 'i8'; diff --git a/src/settings.js b/src/settings.js index 316c257d1802..d75e8da86a72 100644 --- a/src/settings.js +++ b/src/settings.js @@ -583,9 +583,9 @@ var ASYNCIFY_WHITELIST = ['qsort', // given that EXTRA_EXPORTED_RUNTIME_METHODS exists, and so this option exists // only for backwards compatibility. You should use // EXTRA_EXPORTED_RUNTIME_METHODS for things you want to export from the -// runtime. -// Methods on this list are automatically included from JS libraries, if they -// are library methods. +// runtime. Note that methods on this list are only exported if they are +// included (either automatically from linking, or due to being in +// DEFAULT_LIBRARY_FUNCS_TO_INCLUDE). // Note that the name may be slightly misleading, as this is for any JS library // element, and not just methods. For example, we export the Runtime object by // having "Runtime" in this list. From 1dc3b7df6d0061187f92335c04ea4b0b19898967 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:36:28 -0800 Subject: [PATCH 70/82] revert --- src/jsifier.js | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/jsifier.js b/src/jsifier.js index 950ad5506653..95c9430d5017 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -110,20 +110,6 @@ function JSify(data, functionsOnly) { ident: '_' + ident }); }); - // Exports from the JS runtime may be JS library functions - EXPORTED_RUNTIME_METHODS.forEach(function(ident) { - // No _ prefix for JS runtime methods, so must be marked with $ in the library. - // The first character is ignored by the functionStubs handler, so as a workaround - // we can put anything there. - ident = '*$' + ident; - data.functionStubs.push({ - intertype: 'functionStub', - finalName: ident, - ident: ident, - ignoreIfMissing: true, - exported: true - }); - }); } function processLibraryFunction(snippet, ident, finalName) { @@ -158,7 +144,7 @@ function JSify(data, functionsOnly) { functionStubSigs[item.ident] = Functions.getSignature(item.returnType.text, item.params.map(function(arg) { return arg.type }), false); } - function addFromLibrary(ident, firstCall) { + function addFromLibrary(ident) { if (ident in addedLibraryItems) return ''; addedLibraryItems[ident] = true; @@ -191,10 +177,6 @@ function JSify(data, functionsOnly) { var noExport = false; if ((!LibraryManager.library.hasOwnProperty(ident) && !LibraryManager.library.hasOwnProperty(ident + '__inline')) || SIDE_MODULE) { - if (firstCall && item.ignoreIfMissing) { - // it's ignore to ignore this item (but wouldn't be ok to ignore a dependency) - return ''; - } if (!(finalName in IMPLEMENTED_FUNCTIONS)) { if (VERBOSE || ident.substr(0, 11) !== 'emscripten_') { // avoid warning on emscripten_* functions which are for internal usage anyhow if (!LINKABLE) { @@ -321,8 +303,7 @@ function JSify(data, functionsOnly) { } // asm module exports are done in emscripten.py, after the asm module is ready. Here // we also export library methods as necessary. - if (((EXPORT_ALL || (finalName in EXPORTED_FUNCTIONS)) && !noExport) || - (item.exported && firstCall)) { + if ((EXPORT_ALL || (finalName in EXPORTED_FUNCTIONS)) && !noExport) { contentText += '\nModule["' + finalName + '"] = ' + finalName + ';'; } if (!LibraryManager.library[ident + '__asm']) { @@ -350,7 +331,7 @@ function JSify(data, functionsOnly) { delete LibraryManager.library[shortident + '__deps']; } } - item.JS = addFromLibrary(shortident, true /* firstCall */); + item.JS = addFromLibrary(shortident); } // Final combiner From f7cdc6c6cac369cc249301bd1f7824816425fcaa Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:37:06 -0800 Subject: [PATCH 71/82] revert --- tests/runner.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/runner.py b/tests/runner.py index ac1bcef57e26..39dc61de16dd 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -336,15 +336,13 @@ def setUp(self): if temp_file.endswith('.ll'): self.has_prev_ll = True - self.used_canonical_temp_dir = False - def tearDown(self): if not self.save_dir: # rmtree() fails on Windows if the current working directory is inside the tree. os.chdir(os.path.dirname(self.get_dir())) try_delete(self.get_dir()) - if EMTEST_DETECT_TEMPFILE_LEAKS and not os.environ.get('EMCC_DEBUG') and not self.used_canonical_temp_dir: + if EMTEST_DETECT_TEMPFILE_LEAKS and not os.environ.get('EMCC_DEBUG'): temp_files_after_run = [] for root, dirnames, filenames in os.walk(self.temp_dir): for dirname in dirnames: From a616dc6d088ebfbfc8f7820c02cf7ab4ae2f9a9d Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:37:34 -0800 Subject: [PATCH 72/82] revert --- tests/test_browser.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/tests/test_browser.py b/tests/test_browser.py index 429c2fc991dd..82c33e600ab7 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -1296,11 +1296,10 @@ def test_file_db(self): shutil.move('test.html', 'third.html') def test_fs_idbfs_sync(self): - args = ['-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]'] for extra in [[], ['-DEXTRA_WORK']]: secret = str(time.time()) - self.btest(path_from_root('tests', 'fs', 'test_idbfs_sync.c'), '1', force_c=True, args=args + ['-lidbfs.js', '-DFIRST', '-DSECRET=\"' + secret + '\"', '-s', '''EXPORTED_FUNCTIONS=['_main', '_test', '_success']''']) - self.btest(path_from_root('tests', 'fs', 'test_idbfs_sync.c'), '1', force_c=True, args=args + ['-lidbfs.js', '-DSECRET=\"' + secret + '\"', '-s', '''EXPORTED_FUNCTIONS=['_main', '_test', '_success']'''] + extra) + self.btest(path_from_root('tests', 'fs', 'test_idbfs_sync.c'), '1', force_c=True, args=['-lidbfs.js', '-DFIRST', '-DSECRET=\"' + secret + '\"', '-s', '''EXPORTED_FUNCTIONS=['_main', '_test', '_success']''']) + self.btest(path_from_root('tests', 'fs', 'test_idbfs_sync.c'), '1', force_c=True, args=['-lidbfs.js', '-DSECRET=\"' + secret + '\"', '-s', '''EXPORTED_FUNCTIONS=['_main', '_test', '_success']'''] + extra) @no_wasm_backend('emterpretify') def test_fs_idbfs_fsync(self): @@ -1318,7 +1317,7 @@ def test_fs_idbfs_fsync(self): }; ''') - args = ['--pre-js', 'pre.js', '-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1', '-lidbfs.js', '-s', 'EXIT_RUNTIME=1', '-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]'] + args = ['--pre-js', 'pre.js', '-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1', '-lidbfs.js', '-s', 'EXIT_RUNTIME=1'] secret = str(time.time()) self.btest(path_from_root('tests', 'fs', 'test_idbfs_fsync.c'), '1', force_c=True, args=args + ['-DFIRST', '-DSECRET=\"' + secret + '\"', '-s', '''EXPORTED_FUNCTIONS=['_main', '_success']''']) self.btest(path_from_root('tests', 'fs', 'test_idbfs_fsync.c'), '1', force_c=True, args=args + ['-DSECRET=\"' + secret + '\"', '-s', '''EXPORTED_FUNCTIONS=['_main', '_success']''']) @@ -1352,7 +1351,7 @@ def test_fs_workerfs_package(self): os.makedirs('sub') open(os.path.join('sub', 'file2.txt'), 'w').write('second') run_process([PYTHON, FILE_PACKAGER, 'files.data', '--preload', 'file1.txt', os.path.join('sub', 'file2.txt'), '--separate-metadata', '--js-output=files.js']) - self.btest(os.path.join('fs', 'test_workerfs_package.cpp'), '1', args=['-lworkerfs.js', '--proxy-to-worker', '-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]']) + self.btest(os.path.join('fs', 'test_workerfs_package.cpp'), '1', args=['-lworkerfs.js', '--proxy-to-worker']) def test_fs_lz4fs_package(self): # generate data @@ -1364,32 +1363,30 @@ def test_fs_lz4fs_package(self): random_data[17] = ord('X') open('file3.txt', 'wb').write(random_data) - args = ['-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]'] - # compress in emcc, -s LZ4=1 tells it to tell the file packager print('emcc-normal') - self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=args + ['-s', 'LZ4=1', '--preload-file', 'file1.txt', '--preload-file', 'subdir/file2.txt', '--preload-file', 'file3.txt'], timeout=60) + self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=['-s', 'LZ4=1', '--preload-file', 'file1.txt', '--preload-file', 'subdir/file2.txt', '--preload-file', 'file3.txt'], timeout=60) assert os.path.getsize('file1.txt') + os.path.getsize(os.path.join('subdir', 'file2.txt')) + os.path.getsize('file3.txt') == 3 * 1024 * 128 * 10 + 1 assert os.path.getsize('test.data') < (3 * 1024 * 128 * 10) / 2 # over half is gone print(' emcc-opts') - self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=args + ['-s', 'LZ4=1', '--preload-file', 'file1.txt', '--preload-file', 'subdir/file2.txt', '--preload-file', 'file3.txt', '-O2'], timeout=60) + self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=['-s', 'LZ4=1', '--preload-file', 'file1.txt', '--preload-file', 'subdir/file2.txt', '--preload-file', 'file3.txt', '-O2'], timeout=60) # compress in the file packager, on the server. the client receives compressed data and can just use it. this is typical usage print('normal') out = subprocess.check_output([PYTHON, FILE_PACKAGER, 'files.data', '--preload', 'file1.txt', 'subdir/file2.txt', 'file3.txt', '--lz4']) open('files.js', 'wb').write(out) - self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=args + ['--pre-js', 'files.js', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1'], timeout=60) + self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=['--pre-js', 'files.js', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1'], timeout=60) print(' opts') - self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=args + ['--pre-js', 'files.js', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1', '-O2'], timeout=60) + self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '2', args=['--pre-js', 'files.js', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1', '-O2'], timeout=60) # load the data into LZ4FS manually at runtime. This means we compress on the client. This is generally not recommended print('manual') subprocess.check_output([PYTHON, FILE_PACKAGER, 'files.data', '--preload', 'file1.txt', 'subdir/file2.txt', 'file3.txt', '--separate-metadata', '--js-output=files.js']) - self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '1', args=args + ['-DLOAD_MANUALLY', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1'], timeout=60) + self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '1', args=['-DLOAD_MANUALLY', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1'], timeout=60) print(' opts') - self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '1', args=args + ['-DLOAD_MANUALLY', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1', '-O2'], timeout=60) + self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '1', args=['-DLOAD_MANUALLY', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1', '-O2'], timeout=60) print(' opts+closure') - self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '1', args=args + ['-DLOAD_MANUALLY', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1', '-O2', '--closure', '1', '-g1'], timeout=60) + self.btest(os.path.join('fs', 'test_lz4fs.cpp'), '1', args=['-DLOAD_MANUALLY', '-s', 'LZ4=1', '-s', 'FORCE_FILESYSTEM=1', '-O2', '--closure', '1', '-g1'], timeout=60) '''# non-lz4 for comparison try: @@ -2316,8 +2313,6 @@ def test_runtime_misuse(self): }; ''') - args = ['-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]'] - for filename, extra_args, second_code in [ ('runtime_misuse.cpp', [], 600), ('runtime_misuse_2.cpp', ['--pre-js', 'pre_runtime.js'], 601) # 601, because no main means we *do* run another call after exit() @@ -2328,13 +2323,13 @@ def test_runtime_misuse(self): print('\n', filename, extra_args, mode) print('mem init, so async, call too early') create_test_file('post.js', post_prep + post_test + post_hook) - self.btest(filename, expected='600', args=args + ['--post-js', 'post.js', '--memory-init-file', '1', '-s', 'EXIT_RUNTIME=1'] + extra_args + mode) + self.btest(filename, expected='600', args=['--post-js', 'post.js', '--memory-init-file', '1', '-s', 'EXIT_RUNTIME=1'] + extra_args + mode) print('sync startup, call too late') create_test_file('post.js', post_prep + 'Module.postRun.push(function() { ' + post_test + ' });' + post_hook) - self.btest(filename, expected=str(second_code), args=args + ['--post-js', 'post.js', '--memory-init-file', '0', '-s', 'EXIT_RUNTIME=1'] + extra_args + mode) + self.btest(filename, expected=str(second_code), args=['--post-js', 'post.js', '--memory-init-file', '0', '-s', 'EXIT_RUNTIME=1'] + extra_args + mode) print('sync, runtime still alive, so all good') create_test_file('post.js', post_prep + 'expected_ok = true; Module.postRun.push(function() { ' + post_test + ' });' + post_hook) - self.btest(filename, expected='606', args=args + ['--post-js', 'post.js', '--memory-init-file', '0'] + extra_args + mode) + self.btest(filename, expected='606', args=['--post-js', 'post.js', '--memory-init-file', '0'] + extra_args + mode) def test_cwrap_early(self): self.btest(os.path.join('browser', 'cwrap_early.cpp'), args=['-O2', '-s', 'ASSERTIONS=1', '--pre-js', path_from_root('tests', 'browser', 'cwrap_early.js'), '-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["cwrap"]'], expected='0') From b9e35c1db98fa326d6dd92f21b728eeae8d22011 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:37:59 -0800 Subject: [PATCH 73/82] revert --- tests/test_core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_core.py b/tests/test_core.py index e5b223fa6457..0746c6b105eb 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -7217,7 +7217,6 @@ def test_async(self, emterpretify=False): if emterpretify: print('check bad ccall use') - self.set_setting('EXTRA_EXPORTED_RUNTIME_METHODS', ["ccall"]) src = r''' #include #include From 1e170ee54a9288f73d5f9bdb39288e473cdb2915 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:39:24 -0800 Subject: [PATCH 74/82] revert --- tests/test_other.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_other.py b/tests/test_other.py index f16af4ae002d..abcca639071e 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -73,7 +73,6 @@ def decorated(self): # canonical_tmp self.assertTrue(os.path.exists(self.canonical_temp_dir)) shutil.rmtree(self.canonical_temp_dir) - self.used_canonical_temp_dir = True return decorated From abf052972c9e236a28d6ea8a54f2277021531612 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:43:15 -0800 Subject: [PATCH 75/82] revert --- tests/test_other.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_other.py b/tests/test_other.py index abcca639071e..b47d5f4147bb 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -3558,11 +3558,11 @@ def test_fs_after_main(self): def test_os_oz(self): with env_modify({'EMCC_DEBUG': '1'}): for args, expect in [ - (['-O1'], '-O1'), - (['-O2'], '-O3'), - (['-Os'], '-Os'), - (['-Oz'], '-Oz'), - (['-O3'], '-O3'), + (['-O1'], 'LLVM opts: -O1'), + (['-O2'], 'LLVM opts: -O3'), + (['-Os'], 'LLVM opts: -Os'), + (['-Oz'], 'LLVM opts: -Oz'), + (['-O3'], 'LLVM opts: -O3'), ]: print(args, expect) err = run_process([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp')] + args, stdout=PIPE, stderr=PIPE).stderr @@ -5878,6 +5878,7 @@ def test(args, llvm_opts=None): if args: assert err.count(VECTORIZE) == 2, err # specified twice, once per file + assert err.count('emcc: LLVM opts: ' + llvm_opts) == 2, err # corresponding to exactly once per invocation of optimizer else: assert err.count(VECTORIZE) == 0, err # no optimizations @@ -7072,7 +7073,7 @@ def test_link_response_file_does_not_force_absolute_paths(self): with chdir(with_space): link_args = Building.link(['main.cpp.o'], 'all.bc', just_calculate=True) - time.sleep(0.2) # Wait for Windows FS to retest_js_optimizerlease access to the directory + time.sleep(0.2) # Wait for Windows FS to release access to the directory shutil.rmtree(with_space) # We want only the relative path to be in the linker args, it should not be converted to an absolute path. From 82e86fc52fc81a6e436aa010136f9c462c71ed45 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 06:44:44 -0800 Subject: [PATCH 76/82] fix --- tools/shared.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/shared.py b/tools/shared.py index 9209712a6f1b..82253fd25ff0 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -2127,6 +2127,7 @@ def llvm_opt(filename, opts, out=None): else: opts += ['-force-vector-width=4'] + logger.debug('emcc: LLVM opts: ' + ' '.join(opts) + ' [num inputs: ' + str(len(inputs)) + ']') target = out or (filename + '.opt.bc') try: run_process([LLVM_OPT] + inputs + opts + ['-o', target], stdout=PIPE) From 017fd7a31d522bc36b2c0fcf9451b51c18deb09e Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 07:12:12 -0800 Subject: [PATCH 77/82] links to prs --- tools/node_modules/acorn/README.md | 2 +- tools/node_modules/acorn/dist/acorn.js | 1 + tools/node_modules/terser/README.md | 2 ++ tools/node_modules/terser/terser.js | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/node_modules/acorn/README.md b/tools/node_modules/acorn/README.md index d2c73a475064..a30b20f9c427 100644 --- a/tools/node_modules/acorn/README.md +++ b/tools/node_modules/acorn/README.md @@ -270,5 +270,5 @@ Plugins for ECMAScript proposals: # @LOCALMOD XXX EMSCRIPTEN -Add a quote of the erroring text on parse errors, and point to where it is (search for `XXX EMSCRIPTEN` in `acorn.js`). +Add a quote of the erroring text on parse errors, and point to where it is, search for `XXX EMSCRIPTEN` in `acorn.js`, https://github.com/acornjs/acorn/pull/793 diff --git a/tools/node_modules/acorn/dist/acorn.js b/tools/node_modules/acorn/dist/acorn.js index c42dbe4e37ad..fc3a2405267f 100644 --- a/tools/node_modules/acorn/dist/acorn.js +++ b/tools/node_modules/acorn/dist/acorn.js @@ -2768,6 +2768,7 @@ pp$4.raise = function(pos, message) { var loc = getLineInfo(this.input, pos); message += " (" + loc.line + ":" + loc.column + ")"; // XXX EMSCRIPTEN: add a quote of the error text, point to where + // https://github.com/acornjs/acorn/pull/793 var lines = this.input.split('\n'); message = message + '\n' + lines[loc.line - 1] + '\n'; for (var i = 0; i < loc.column; i++) { diff --git a/tools/node_modules/terser/README.md b/tools/node_modules/terser/README.md index 2437f86db60c..f06c941e61aa 100644 --- a/tools/node_modules/terser/README.md +++ b/tools/node_modules/terser/README.md @@ -1277,3 +1277,5 @@ It was created with basically cat lib/utils.js lib/ast.js lib/parse.js lib/scope.js lib/output.js lib/mozilla-ast.js > terser.js ``` +Also fixed a bug with preserving quoted properties in estree-to-uglify, search for ` XXX EMSCRIPTEN` in `terser.js`, https://github.com/mishoo/UglifyJS2/pull/3323 + diff --git a/tools/node_modules/terser/terser.js b/tools/node_modules/terser/terser.js index 5f029d5526b8..6190b9f00cb8 100644 --- a/tools/node_modules/terser/terser.js +++ b/tools/node_modules/terser/terser.js @@ -7533,6 +7533,7 @@ function OutputStream(options) { } prop.type = "Property"; // XXX EMSCRIPTEN preserve quoted properties + // https://github.com/mishoo/UglifyJS2/pull/3323 var ret = from_moz(prop); if (prop.key.type === "Literal" && (prop.key.raw[0] === '"' || prop.key.raw[0] === "'")) { From 36dc024ded3a1deb80fdb104765093399c84269e Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Fri, 1 Feb 2019 07:14:34 -0800 Subject: [PATCH 78/82] test fix --- tests/test_other.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_other.py b/tests/test_other.py index b47d5f4147bb..c27bf3803d7a 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -7882,7 +7882,7 @@ def test(filename, expectations, size_slack): 0, [], [], 8, 0, 0, 0), # noqa; totally empty! # we don't metadce with linkable code! other modules may want stuff (['-O3', '-s', 'MAIN_MODULE=1'], - 1560, [], [], 226057, 28, 75, None), # noqa; don't compare the # of functions in a main module, which changes a lot + 1557, [], [], 226057, 28, 75, None), # noqa; don't compare the # of functions in a main module, which changes a lot ], size_slack) # noqa print('test on a minimal pure computational thing') From fe8db9be0ceeac0ad84a001c019ddf71d5b15252 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 5 Feb 2019 12:40:53 -0800 Subject: [PATCH 79/82] fix --- tests/test_other.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_other.py b/tests/test_other.py index 0d9b17e284c9..eb5f147eb1ad 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2351,7 +2351,6 @@ def test_debuginfo(self): else: self.assertNotIn(' -g ', finalize) else: - opts = '\n'.join([l for l in lines if os.path.sep + 'opt' in l]) if expect_debug: self.assertNotIn('strip-debug', err) else: From a559a99078db8c144a961468ab9a3fbaebd50126 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 5 Feb 2019 13:29:22 -0800 Subject: [PATCH 80/82] update after Module.asmLibraryArg => var asmLibraryArg change --- tools/acorn-optimizer.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tools/acorn-optimizer.js b/tools/acorn-optimizer.js index aebc7a7d3668..c14bc1b1de0e 100644 --- a/tools/acorn-optimizer.js +++ b/tools/acorn-optimizer.js @@ -379,14 +379,16 @@ function AJSDCE(ast) { JSDCE(ast, /* multipleIterations= */ true); } -function isAsmLibraryArgAssign(node) { // Module.asmLibraryArg = .. - return node.type === 'AssignmentExpression' && - node.operator === '=' && - node.left.type === 'MemberExpression' && - node.left.object.type === 'Identifier' && - node.left.object.name === 'Module' && - node.left.property.type === 'Identifier' && - node.left.property.name === 'asmLibraryArg'; +function isAsmLibraryArgAssign(node) { // var asmLibraryArg = .. + return node.type === 'VariableDeclaration' && + node.declarations.length === 1 && + node.declarations[0].id.name === 'asmLibraryArg' && + node.declarations[0].init && + node.declarations[0].init.type === 'ObjectExpression'; +} + +function getAsmLibraryArgValue(node) { + return node.declarations[0].init; } function isAsmUse(node) { @@ -428,7 +430,7 @@ function applyImportAndExportNameChanges(ast) { var mapping = extraInfo.mapping; fullWalk(ast, function(node) { if (isAsmLibraryArgAssign(node)) { - var assignedObject = node.right; + var assignedObject = getAsmLibraryArgValue(node); assignedObject.properties.forEach(function(item) { if (mapping[item.key.value]) { setLiteralValue(item.key, mapping[item.key.value]); @@ -552,7 +554,7 @@ function emitDCEGraph(ast) { var graph = []; fullWalk(ast, function(node) { if (isAsmLibraryArgAssign(node)) { - var assignedObject = node.right; + var assignedObject = getAsmLibraryArgValue(node); assignedObject.properties.forEach(function(item) { var value = item.value; assert(value.type === 'Identifier'); @@ -711,7 +713,7 @@ function applyDCEGraphRemovals(ast) { fullWalk(ast, function(node) { if (isAsmLibraryArgAssign(node)) { - var assignedObject = node.right; + var assignedObject = getAsmLibraryArgValue(node); assignedObject.properties = assignedObject.properties.filter(function(item) { var name = item.key.value; var value = item.value; From ca4f365f855f9e3096b0544f3393caf15dc9800b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 6 Feb 2019 21:08:20 +0200 Subject: [PATCH 81/82] Add test case for full MINIMAL_RUNTIME JS optimizer applyImportAndExportNameChanges pass. --- ...applyImportAndExportNameChanges2-output.js | 237 ++++++++++++++++ .../applyImportAndExportNameChanges2.js | 267 ++++++++++++++++++ tests/test_other.py | 2 + 3 files changed, 506 insertions(+) create mode 100644 tests/optimizer/applyImportAndExportNameChanges2-output.js create mode 100644 tests/optimizer/applyImportAndExportNameChanges2.js diff --git a/tests/optimizer/applyImportAndExportNameChanges2-output.js b/tests/optimizer/applyImportAndExportNameChanges2-output.js new file mode 100644 index 000000000000..b3113e1b32e9 --- /dev/null +++ b/tests/optimizer/applyImportAndExportNameChanges2-output.js @@ -0,0 +1,237 @@ +var Module; +if (!Module) Module = "__EMSCRIPTEN_PRIVATE_MODULE_EXPORT_NAME_SUBSTITUTION__"; +var ENVIRONMENT_IS_NODE = typeof process === "object"; +if (ENVIRONMENT_IS_NODE) { + var fs = require("fs"); + Module["wasm"] = fs.readFileSync(__dirname + "/a.wasm"); +} +function out(text) { + console.log(text); +} +function err(text) { + console.error(text); +} +function ready() { + run(); +} +function abort(what) { + throw what; +} +var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined; +function UTF8ArrayToString(u8Array, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + while (u8Array[endPtr] && !(endPtr >= endIdx)) ++endPtr; + if (endPtr - idx > 16 && u8Array.subarray && UTF8Decoder) { + return UTF8Decoder.decode(u8Array.subarray(idx, endPtr)); + } else { + var str = ""; + while (idx < endPtr) { + var u0 = u8Array[idx++]; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue; + } + var u1 = u8Array[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue; + } + var u2 = u8Array[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2; + } else { + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | u8Array[idx++] & 63; + } + if (u0 < 65536) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); + } + } + } + return str; +} +function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; +} +var TOTAL_MEMORY = 16777216, STATIC_BASE = 1024, DYNAMICTOP_PTR = 6016; +var wasmMaximumMemory = TOTAL_MEMORY; +var wasmMemory = new WebAssembly.Memory({ + "initial": TOTAL_MEMORY >> 16, + "maximum": wasmMaximumMemory >> 16 +}); +var buffer = wasmMemory.buffer; +var HEAP8 = new Int8Array(buffer); +var HEAP16 = new Int16Array(buffer); +var HEAP32 = new Int32Array(buffer); +var HEAPU8 = new Uint8Array(buffer); +var HEAPU16 = new Uint16Array(buffer); +var HEAPU32 = new Uint32Array(buffer); +var HEAPF32 = new Float32Array(buffer); +var HEAPF64 = new Float64Array(buffer); +HEAP32[DYNAMICTOP_PTR >> 2] = 5249152; +var SYSCALLS = { + buffers: [ null, [], [] ], + printChar: (function(stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0; + } else { + buffer.push(curr); + } + }), + varargs: 0, + get: (function(varargs) { + SYSCALLS.varargs += 4; + var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; + return ret; + }), + getStr: (function() { + var ret = UTF8ToString(SYSCALLS.get()); + return ret; + }), + get64: (function() { + var low = SYSCALLS.get(), high = SYSCALLS.get(); + return low; + }), + getZero: (function() { + SYSCALLS.get(); + }) +}; +function ___syscall140(which, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(), offset_high = SYSCALLS.get(), offset_low = SYSCALLS.get(), result = SYSCALLS.get(), whence = SYSCALLS.get(); + var offset = offset_low; + FS.llseek(stream, offset, whence); + HEAP32[result >> 2] = stream.position; + if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___syscall146(which, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.get(), iov = SYSCALLS.get(), iovcnt = SYSCALLS.get(); + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[iov + i * 8 >> 2]; + var len = HEAP32[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(stream, HEAPU8[ptr + j]); + } + ret += len; + } + return ret; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___syscall54(which, varargs) { + SYSCALLS.varargs = varargs; + try { + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___syscall6(which, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(); + FS.close(stream); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function _emscripten_get_now() { + abort(); +} +function _emscripten_random() { + return Math.random(); +} +function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.set(HEAPU8.subarray(src, src + num), dest); +} +if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function _emscripten_get_now_actual() { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6; + }; +} else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow; +} else if (typeof self === "object" && self["performance"] && typeof self["performance"]["now"] === "function") { + _emscripten_get_now = (function() { + return self["performance"]["now"](); + }); +} else if (typeof performance === "object" && typeof performance["now"] === "function") { + _emscripten_get_now = (function() { + return performance["now"](); + }); +} else { + _emscripten_get_now = Date.now; +} +var asmLibraryArg = { + "b": abort, + "h": ___syscall140, + "a": ___syscall146, + "g": ___syscall54, + "f": ___syscall6, + "e": _emscripten_get_now, + "d": _emscripten_memcpy_big, + "c": _emscripten_random +}; +function run() { + var ret = _main(); +} +function initRuntime(asm) { + asm["i"](); +} +var env = asmLibraryArg; +env["memory"] = wasmMemory; +env["table"] = new WebAssembly.Table({ + "initial": 6, + "maximum": 6, + "element": "anyfunc" +}); +env["__memory_base"] = STATIC_BASE; +env["__table_base"] = 0; +var imports = { + "env": env, + "global": { + "NaN": NaN, + "Infinity": Infinity + }, + "global.Math": Math, + "asm2wasm": { + "f64-rem": (function(x, y) { + return x % y; + }), + "debugger": (function() { + debugger; + }) + } +}; +var ___errno_location, _llvm_bswap_i32, _main, _memcpy, _memset, dynCall_ii, dynCall_iiii; +WebAssembly.instantiate(Module["wasm"], imports).then((function(output) { + var asm = output.instance.exports; + ___errno_location = asm["j"]; + _llvm_bswap_i32 = asm["k"]; + _main = asm["l"]; + _memcpy = asm["m"]; + _memset = asm["n"]; + dynCall_ii = asm["o"]; + dynCall_iiii = asm["p"]; + initRuntime(asm); + ready(); +})); diff --git a/tests/optimizer/applyImportAndExportNameChanges2.js b/tests/optimizer/applyImportAndExportNameChanges2.js new file mode 100644 index 000000000000..9c1f3ac01603 --- /dev/null +++ b/tests/optimizer/applyImportAndExportNameChanges2.js @@ -0,0 +1,267 @@ +var Module; +if (!Module) Module = "__EMSCRIPTEN_PRIVATE_MODULE_EXPORT_NAME_SUBSTITUTION__"; +var ENVIRONMENT_IS_NODE = typeof process === "object"; +if (ENVIRONMENT_IS_NODE) { + var fs = require("fs"); + Module["wasm"] = fs.readFileSync(__dirname + "/a.wasm") +} + +function out(text) { + console.log(text) +} + +function err(text) { + console.error(text) +} + +function ready() { + run() +} + +function abort(what) { + throw what +} +var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined; + +function UTF8ArrayToString(u8Array, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + while (u8Array[endPtr] && !(endPtr >= endIdx)) ++endPtr; + if (endPtr - idx > 16 && u8Array.subarray && UTF8Decoder) { + return UTF8Decoder.decode(u8Array.subarray(idx, endPtr)) + } else { + var str = ""; + while (idx < endPtr) { + var u0 = u8Array[idx++]; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue + } + var u1 = u8Array[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue + } + var u2 = u8Array[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2 + } else { + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | u8Array[idx++] & 63 + } + if (u0 < 65536) { + str += String.fromCharCode(u0) + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) + } + } + } + return str +} + +function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" +} +var TOTAL_MEMORY = 16777216, + STATIC_BASE = 1024, + DYNAMICTOP_PTR = 6016; +var wasmMaximumMemory = TOTAL_MEMORY; +var wasmMemory = new WebAssembly.Memory({ + "initial": TOTAL_MEMORY >> 16, + "maximum": wasmMaximumMemory >> 16 +}); +var buffer = wasmMemory.buffer; +var HEAP8 = new Int8Array(buffer); +var HEAP16 = new Int16Array(buffer); +var HEAP32 = new Int32Array(buffer); +var HEAPU8 = new Uint8Array(buffer); +var HEAPU16 = new Uint16Array(buffer); +var HEAPU32 = new Uint32Array(buffer); +var HEAPF32 = new Float32Array(buffer); +var HEAPF64 = new Float64Array(buffer); +HEAP32[DYNAMICTOP_PTR >> 2] = 5249152; +var SYSCALLS = { + buffers: [null, [], + [] + ], + printChar: (function(stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0 + } else { + buffer.push(curr) + } + }), + varargs: 0, + get: (function(varargs) { + SYSCALLS.varargs += 4; + var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; + return ret + }), + getStr: (function() { + var ret = UTF8ToString(SYSCALLS.get()); + return ret + }), + get64: (function() { + var low = SYSCALLS.get(), + high = SYSCALLS.get(); + return low + }), + getZero: (function() { + SYSCALLS.get() + }) +}; + +function ___syscall140(which, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(), + offset_high = SYSCALLS.get(), + offset_low = SYSCALLS.get(), + result = SYSCALLS.get(), + whence = SYSCALLS.get(); + var offset = offset_low; + FS.llseek(stream, offset, whence); + HEAP32[result >> 2] = stream.position; + if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; + return 0 + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno + } +} + +function ___syscall146(which, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.get(), + iov = SYSCALLS.get(), + iovcnt = SYSCALLS.get(); + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[iov + i * 8 >> 2]; + var len = HEAP32[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(stream, HEAPU8[ptr + j]) + } + ret += len + } + return ret + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno + } +} + +function ___syscall54(which, varargs) { + SYSCALLS.varargs = varargs; + try { + return 0 + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno + } +} + +function ___syscall6(which, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(); + FS.close(stream); + return 0 + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno + } +} + +function _emscripten_get_now() { + abort() +} + +function _emscripten_random() { + return Math.random() +} + +function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.set(HEAPU8.subarray(src, src + num), dest) +} +if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function _emscripten_get_now_actual() { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6 + } +} else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow +} else if (typeof self === "object" && self["performance"] && typeof self["performance"]["now"] === "function") { + _emscripten_get_now = (function() { + return self["performance"]["now"]() + }) +} else if (typeof performance === "object" && typeof performance["now"] === "function") { + _emscripten_get_now = (function() { + return performance["now"]() + }) +} else { + _emscripten_get_now = Date.now +} +var asmLibraryArg = { + "abort": abort, + "___syscall140": ___syscall140, + "___syscall146": ___syscall146, + "___syscall54": ___syscall54, + "___syscall6": ___syscall6, + "_emscripten_get_now": _emscripten_get_now, + "_emscripten_memcpy_big": _emscripten_memcpy_big, + "_emscripten_random": _emscripten_random +}; + +function run() { + var ret = _main() +} + +function initRuntime(asm) { + asm["__GLOBAL__sub_I_test_global_initializer_cpp"]() +} +var env = asmLibraryArg; +env["memory"] = wasmMemory; +env["table"] = new WebAssembly.Table({ + "initial": 6, + "maximum": 6, + "element": "anyfunc" +}); +env["__memory_base"] = STATIC_BASE; +env["__table_base"] = 0; +var imports = { + "env": env, + "global": { + "NaN": NaN, + "Infinity": Infinity + }, + "global.Math": Math, + "asm2wasm": { + "f64-rem": (function(x, y) { + return x % y + }), + "debugger": (function() { + debugger + }) + } +}; +var ___errno_location, _llvm_bswap_i32, _main, _memcpy, _memset, dynCall_ii, dynCall_iiii; +WebAssembly.instantiate(Module["wasm"], imports).then((function(output) { + var asm = output.instance.exports; + ___errno_location = asm["___errno_location"]; + _llvm_bswap_i32 = asm["_llvm_bswap_i32"]; + _main = asm["_main"]; + _memcpy = asm["_memcpy"]; + _memset = asm["_memset"]; + dynCall_ii = asm["dynCall_ii"]; + dynCall_iiii = asm["dynCall_iiii"]; + initRuntime(asm); + ready() +})) + + + +// EXTRA_INFO: {"mapping": {"_llvm_bswap_i32": "k", "_emscripten_random": "c", "dynCall_ii": "o", "__GLOBAL__sub_I_test_global_initializer_cpp": "i", "___errno_location": "j", "dynCall_iiii": "p", "___syscall6": "f", "_memset": "n", "_memcpy": "m", "abort": "b", "___syscall146": "a", "_emscripten_memcpy_big": "d", "___syscall54": "g", "___syscall140": "h", "_emscripten_get_now": "e", "_main": "l"}} diff --git a/tests/test_other.py b/tests/test_other.py index ea8850d19a87..444e86303214 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2201,6 +2201,8 @@ def test_js_optimizer(self): ['applyDCEGraphRemovals']), (path_from_root('tests', 'optimizer', 'applyImportAndExportNameChanges.js'), open(path_from_root('tests', 'optimizer', 'applyImportAndExportNameChanges-output.js')).read(), ['applyImportAndExportNameChanges']), + (path_from_root('tests', 'optimizer', 'applyImportAndExportNameChanges2.js'), open(path_from_root('tests', 'optimizer', 'applyImportAndExportNameChanges2-output.js')).read(), + ['applyImportAndExportNameChanges']), (path_from_root('tests', 'optimizer', 'detectSign-modulus-emterpretify.js'), open(path_from_root('tests', 'optimizer', 'detectSign-modulus-emterpretify-output.js')).read(), ['noPrintMetadata', 'emterpretify', 'noEmitAst']), (path_from_root('tests', 'optimizer', 'minimal-runtime-emitDCEGraph.js'), open(path_from_root('tests', 'optimizer', 'minimal-runtime-emitDCEGraph-output.js')).read(), From 33af0db855467b06ba4d7eb38de87470acabaa62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 6 Feb 2019 21:13:04 +0200 Subject: [PATCH 82/82] Fix acorn optimizer to run on MINIMAL_RUNTIME global initializer case --- ...applyImportAndExportNameChanges2-output.js | 42 +++++++++---------- tools/acorn-optimizer.js | 6 +++ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/tests/optimizer/applyImportAndExportNameChanges2-output.js b/tests/optimizer/applyImportAndExportNameChanges2-output.js index b3113e1b32e9..57eeca8ea480 100644 --- a/tests/optimizer/applyImportAndExportNameChanges2-output.js +++ b/tests/optimizer/applyImportAndExportNameChanges2-output.js @@ -74,7 +74,7 @@ var HEAPF64 = new Float64Array(buffer); HEAP32[DYNAMICTOP_PTR >> 2] = 5249152; var SYSCALLS = { buffers: [ null, [], [] ], - printChar: (function(stream, curr) { + printChar: function(stream, curr) { var buffer = SYSCALLS.buffers[stream]; if (curr === 0 || curr === 10) { (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); @@ -82,24 +82,24 @@ var SYSCALLS = { } else { buffer.push(curr); } - }), + }, varargs: 0, - get: (function(varargs) { + get: function(varargs) { SYSCALLS.varargs += 4; var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; return ret; - }), - getStr: (function() { + }, + getStr: function() { var ret = UTF8ToString(SYSCALLS.get()); return ret; - }), - get64: (function() { + }, + get64: function() { var low = SYSCALLS.get(), high = SYSCALLS.get(); return low; - }), - getZero: (function() { + }, + getZero: function() { SYSCALLS.get(); - }) + } }; function ___syscall140(which, varargs) { SYSCALLS.varargs = varargs; @@ -171,13 +171,13 @@ if (ENVIRONMENT_IS_NODE) { } else if (typeof dateNow !== "undefined") { _emscripten_get_now = dateNow; } else if (typeof self === "object" && self["performance"] && typeof self["performance"]["now"] === "function") { - _emscripten_get_now = (function() { + _emscripten_get_now = function() { return self["performance"]["now"](); - }); + }; } else if (typeof performance === "object" && typeof performance["now"] === "function") { - _emscripten_get_now = (function() { + _emscripten_get_now = function() { return performance["now"](); - }); + }; } else { _emscripten_get_now = Date.now; } @@ -210,20 +210,20 @@ var imports = { "env": env, "global": { "NaN": NaN, - "Infinity": Infinity + Infinity: Infinity }, "global.Math": Math, "asm2wasm": { - "f64-rem": (function(x, y) { + "f64-rem": function(x, y) { return x % y; - }), - "debugger": (function() { + }, + "debugger": function() { debugger; - }) + } } }; var ___errno_location, _llvm_bswap_i32, _main, _memcpy, _memset, dynCall_ii, dynCall_iiii; -WebAssembly.instantiate(Module["wasm"], imports).then((function(output) { +WebAssembly.instantiate(Module["wasm"], imports).then(function(output) { var asm = output.instance.exports; ___errno_location = asm["j"]; _llvm_bswap_i32 = asm["k"]; @@ -234,4 +234,4 @@ WebAssembly.instantiate(Module["wasm"], imports).then((function(output) { dynCall_iiii = asm["p"]; initRuntime(asm); ready(); -})); +}); diff --git a/tools/acorn-optimizer.js b/tools/acorn-optimizer.js index 80b12d83f6b5..4890f0e9a5ee 100644 --- a/tools/acorn-optimizer.js +++ b/tools/acorn-optimizer.js @@ -451,6 +451,12 @@ function applyImportAndExportNameChanges(ast) { if (mapping[name]) { setLiteralValue(prop, mapping[name]); } + } else if (isAsmUse(node)) { + var prop = node.property; + var name = prop.value; + if (mapping[name]) { + setLiteralValue(prop, mapping[name]); + } } }); }