refactor(Cypress): add nodemodules

This commit is contained in:
2021-09-02 17:18:41 +02:00
parent 1aa57bbd0a
commit bc6e1bc12e
4238 changed files with 340975 additions and 8 deletions

21
node_modules/regenerator-transform/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2014-present, Facebook, Inc.
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.

46
node_modules/regenerator-transform/README.md generated vendored Normal file
View File

@@ -0,0 +1,46 @@
# regenerator-transform
Transform async/generator functions with [regenerator](https://github.com/facebook/regenerator)
## Installation
```sh
$ npm install regenerator-transform
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```js
// without options
{
"plugins": ["regenerator-transform"]
}
// with options
{
"plugins": [
["regenerator-transform", {
asyncGenerators: false, // true by default
generators: false, // true by default
async: false // true by default
}]
]
}
```
### Via CLI
```sh
$ babel --plugins regenerator-transform script.js
```
### Via Node API
```javascript
require("@babel/core").transformSync("code", {
plugins: ["regenerator-transform"]
});
```

959
node_modules/regenerator-transform/lib/emit.js generated vendored Normal file
View File

@@ -0,0 +1,959 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _assert = _interopRequireDefault(require("assert"));
var leap = _interopRequireWildcard(require("./leap"));
var meta = _interopRequireWildcard(require("./meta"));
var util = _interopRequireWildcard(require("./util"));
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasOwn = Object.prototype.hasOwnProperty;
function Emitter(contextId) {
_assert["default"].ok(this instanceof Emitter);
util.getTypes().assertIdentifier(contextId); // Used to generate unique temporary names.
this.nextTempId = 0; // In order to make sure the context object does not collide with
// anything in the local scope, we might have to rename it, so we
// refer to it symbolically instead of just assuming that it will be
// called "context".
this.contextId = contextId; // An append-only list of Statements that grows each time this.emit is
// called.
this.listing = []; // A sparse array whose keys correspond to locations in this.listing
// that have been marked as branch/jump targets.
this.marked = [true];
this.insertedLocs = new Set(); // The last location will be marked when this.getDispatchLoop is
// called.
this.finalLoc = this.loc(); // A list of all leap.TryEntry statements emitted.
this.tryEntries = []; // Each time we evaluate the body of a loop, we tell this.leapManager
// to enter a nested loop context that determines the meaning of break
// and continue statements therein.
this.leapManager = new leap.LeapManager(this);
}
var Ep = Emitter.prototype;
exports.Emitter = Emitter; // Offsets into this.listing that could be used as targets for branches or
// jumps are represented as numeric Literal nodes. This representation has
// the amazingly convenient benefit of allowing the exact value of the
// location to be determined at any time, even after generating code that
// refers to the location.
Ep.loc = function () {
var l = util.getTypes().numericLiteral(-1);
this.insertedLocs.add(l);
return l;
};
Ep.getInsertedLocs = function () {
return this.insertedLocs;
};
Ep.getContextId = function () {
return util.getTypes().clone(this.contextId);
}; // Sets the exact value of the given location to the offset of the next
// Statement emitted.
Ep.mark = function (loc) {
util.getTypes().assertLiteral(loc);
var index = this.listing.length;
if (loc.value === -1) {
loc.value = index;
} else {
// Locations can be marked redundantly, but their values cannot change
// once set the first time.
_assert["default"].strictEqual(loc.value, index);
}
this.marked[index] = true;
return loc;
};
Ep.emit = function (node) {
var t = util.getTypes();
if (t.isExpression(node)) {
node = t.expressionStatement(node);
}
t.assertStatement(node);
this.listing.push(node);
}; // Shorthand for emitting assignment statements. This will come in handy
// for assignments to temporary variables.
Ep.emitAssign = function (lhs, rhs) {
this.emit(this.assign(lhs, rhs));
return lhs;
}; // Shorthand for an assignment statement.
Ep.assign = function (lhs, rhs) {
var t = util.getTypes();
return t.expressionStatement(t.assignmentExpression("=", t.cloneDeep(lhs), rhs));
}; // Convenience function for generating expressions like context.next,
// context.sent, and context.rval.
Ep.contextProperty = function (name, computed) {
var t = util.getTypes();
return t.memberExpression(this.getContextId(), computed ? t.stringLiteral(name) : t.identifier(name), !!computed);
}; // Shorthand for setting context.rval and jumping to `context.stop()`.
Ep.stop = function (rval) {
if (rval) {
this.setReturnValue(rval);
}
this.jump(this.finalLoc);
};
Ep.setReturnValue = function (valuePath) {
util.getTypes().assertExpression(valuePath.value);
this.emitAssign(this.contextProperty("rval"), this.explodeExpression(valuePath));
};
Ep.clearPendingException = function (tryLoc, assignee) {
var t = util.getTypes();
t.assertLiteral(tryLoc);
var catchCall = t.callExpression(this.contextProperty("catch", true), [t.clone(tryLoc)]);
if (assignee) {
this.emitAssign(assignee, catchCall);
} else {
this.emit(catchCall);
}
}; // Emits code for an unconditional jump to the given location, even if the
// exact value of the location is not yet known.
Ep.jump = function (toLoc) {
this.emitAssign(this.contextProperty("next"), toLoc);
this.emit(util.getTypes().breakStatement());
}; // Conditional jump.
Ep.jumpIf = function (test, toLoc) {
var t = util.getTypes();
t.assertExpression(test);
t.assertLiteral(toLoc);
this.emit(t.ifStatement(test, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()])));
}; // Conditional jump, with the condition negated.
Ep.jumpIfNot = function (test, toLoc) {
var t = util.getTypes();
t.assertExpression(test);
t.assertLiteral(toLoc);
var negatedTest;
if (t.isUnaryExpression(test) && test.operator === "!") {
// Avoid double negation.
negatedTest = test.argument;
} else {
negatedTest = t.unaryExpression("!", test);
}
this.emit(t.ifStatement(negatedTest, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()])));
}; // Returns a unique MemberExpression that can be used to store and
// retrieve temporary values. Since the object of the member expression is
// the context object, which is presumed to coexist peacefully with all
// other local variables, and since we just increment `nextTempId`
// monotonically, uniqueness is assured.
Ep.makeTempVar = function () {
return this.contextProperty("t" + this.nextTempId++);
};
Ep.getContextFunction = function (id) {
var t = util.getTypes();
return t.functionExpression(id || null
/*Anonymous*/
, [this.getContextId()], t.blockStatement([this.getDispatchLoop()]), false, // Not a generator anymore!
false // Nor an expression.
);
}; // Turns this.listing into a loop of the form
//
// while (1) switch (context.next) {
// case 0:
// ...
// case n:
// return context.stop();
// }
//
// Each marked location in this.listing will correspond to one generated
// case statement.
Ep.getDispatchLoop = function () {
var self = this;
var t = util.getTypes();
var cases = [];
var current; // If we encounter a break, continue, or return statement in a switch
// case, we can skip the rest of the statements until the next case.
var alreadyEnded = false;
self.listing.forEach(function (stmt, i) {
if (self.marked.hasOwnProperty(i)) {
cases.push(t.switchCase(t.numericLiteral(i), current = []));
alreadyEnded = false;
}
if (!alreadyEnded) {
current.push(stmt);
if (t.isCompletionStatement(stmt)) alreadyEnded = true;
}
}); // Now that we know how many statements there will be in this.listing,
// we can finally resolve this.finalLoc.value.
this.finalLoc.value = this.listing.length;
cases.push(t.switchCase(this.finalLoc, [// Intentionally fall through to the "end" case...
]), // So that the runtime can jump to the final location without having
// to know its offset, we provide the "end" case as a synonym.
t.switchCase(t.stringLiteral("end"), [// This will check/clear both context.thrown and context.rval.
t.returnStatement(t.callExpression(this.contextProperty("stop"), []))]));
return t.whileStatement(t.numericLiteral(1), t.switchStatement(t.assignmentExpression("=", this.contextProperty("prev"), this.contextProperty("next")), cases));
};
Ep.getTryLocsList = function () {
if (this.tryEntries.length === 0) {
// To avoid adding a needless [] to the majority of runtime.wrap
// argument lists, force the caller to handle this case specially.
return null;
}
var t = util.getTypes();
var lastLocValue = 0;
return t.arrayExpression(this.tryEntries.map(function (tryEntry) {
var thisLocValue = tryEntry.firstLoc.value;
_assert["default"].ok(thisLocValue >= lastLocValue, "try entries out of order");
lastLocValue = thisLocValue;
var ce = tryEntry.catchEntry;
var fe = tryEntry.finallyEntry;
var locs = [tryEntry.firstLoc, // The null here makes a hole in the array.
ce ? ce.firstLoc : null];
if (fe) {
locs[2] = fe.firstLoc;
locs[3] = fe.afterLoc;
}
return t.arrayExpression(locs.map(function (loc) {
return loc && t.clone(loc);
}));
}));
}; // All side effects must be realized in order.
// If any subexpression harbors a leap, all subexpressions must be
// neutered of side effects.
// No destructive modification of AST nodes.
Ep.explode = function (path, ignoreResult) {
var t = util.getTypes();
var node = path.node;
var self = this;
t.assertNode(node);
if (t.isDeclaration(node)) throw getDeclError(node);
if (t.isStatement(node)) return self.explodeStatement(path);
if (t.isExpression(node)) return self.explodeExpression(path, ignoreResult);
switch (node.type) {
case "Program":
return path.get("body").map(self.explodeStatement, self);
case "VariableDeclarator":
throw getDeclError(node);
// These node types should be handled by their parent nodes
// (ObjectExpression, SwitchStatement, and TryStatement, respectively).
case "Property":
case "SwitchCase":
case "CatchClause":
throw new Error(node.type + " nodes should be handled by their parents");
default:
throw new Error("unknown Node of type " + JSON.stringify(node.type));
}
};
function getDeclError(node) {
return new Error("all declarations should have been transformed into " + "assignments before the Exploder began its work: " + JSON.stringify(node));
}
Ep.explodeStatement = function (path, labelId) {
var t = util.getTypes();
var stmt = path.node;
var self = this;
var before, after, head;
t.assertStatement(stmt);
if (labelId) {
t.assertIdentifier(labelId);
} else {
labelId = null;
} // Explode BlockStatement nodes even if they do not contain a yield,
// because we don't want or need the curly braces.
if (t.isBlockStatement(stmt)) {
path.get("body").forEach(function (path) {
self.explodeStatement(path);
});
return;
}
if (!meta.containsLeap(stmt)) {
// Technically we should be able to avoid emitting the statement
// altogether if !meta.hasSideEffects(stmt), but that leads to
// confusing generated code (for instance, `while (true) {}` just
// disappears) and is probably a more appropriate job for a dedicated
// dead code elimination pass.
self.emit(stmt);
return;
}
switch (stmt.type) {
case "ExpressionStatement":
self.explodeExpression(path.get("expression"), true);
break;
case "LabeledStatement":
after = this.loc(); // Did you know you can break from any labeled block statement or
// control structure? Well, you can! Note: when a labeled loop is
// encountered, the leap.LabeledEntry created here will immediately
// enclose a leap.LoopEntry on the leap manager's stack, and both
// entries will have the same label. Though this works just fine, it
// may seem a bit redundant. In theory, we could check here to
// determine if stmt knows how to handle its own label; for example,
// stmt happens to be a WhileStatement and so we know it's going to
// establish its own LoopEntry when we explode it (below). Then this
// LabeledEntry would be unnecessary. Alternatively, we might be
// tempted not to pass stmt.label down into self.explodeStatement,
// because we've handled the label here, but that's a mistake because
// labeled loops may contain labeled continue statements, which is not
// something we can handle in this generic case. All in all, I think a
// little redundancy greatly simplifies the logic of this case, since
// it's clear that we handle all possible LabeledStatements correctly
// here, regardless of whether they interact with the leap manager
// themselves. Also remember that labels and break/continue-to-label
// statements are rare, and all of this logic happens at transform
// time, so it has no additional runtime cost.
self.leapManager.withEntry(new leap.LabeledEntry(after, stmt.label), function () {
self.explodeStatement(path.get("body"), stmt.label);
});
self.mark(after);
break;
case "WhileStatement":
before = this.loc();
after = this.loc();
self.mark(before);
self.jumpIfNot(self.explodeExpression(path.get("test")), after);
self.leapManager.withEntry(new leap.LoopEntry(after, before, labelId), function () {
self.explodeStatement(path.get("body"));
});
self.jump(before);
self.mark(after);
break;
case "DoWhileStatement":
var first = this.loc();
var test = this.loc();
after = this.loc();
self.mark(first);
self.leapManager.withEntry(new leap.LoopEntry(after, test, labelId), function () {
self.explode(path.get("body"));
});
self.mark(test);
self.jumpIf(self.explodeExpression(path.get("test")), first);
self.mark(after);
break;
case "ForStatement":
head = this.loc();
var update = this.loc();
after = this.loc();
if (stmt.init) {
// We pass true here to indicate that if stmt.init is an expression
// then we do not care about its result.
self.explode(path.get("init"), true);
}
self.mark(head);
if (stmt.test) {
self.jumpIfNot(self.explodeExpression(path.get("test")), after);
} else {// No test means continue unconditionally.
}
self.leapManager.withEntry(new leap.LoopEntry(after, update, labelId), function () {
self.explodeStatement(path.get("body"));
});
self.mark(update);
if (stmt.update) {
// We pass true here to indicate that if stmt.update is an
// expression then we do not care about its result.
self.explode(path.get("update"), true);
}
self.jump(head);
self.mark(after);
break;
case "TypeCastExpression":
return self.explodeExpression(path.get("expression"));
case "ForInStatement":
head = this.loc();
after = this.loc();
var keyIterNextFn = self.makeTempVar();
self.emitAssign(keyIterNextFn, t.callExpression(util.runtimeProperty("keys"), [self.explodeExpression(path.get("right"))]));
self.mark(head);
var keyInfoTmpVar = self.makeTempVar();
self.jumpIf(t.memberExpression(t.assignmentExpression("=", keyInfoTmpVar, t.callExpression(t.cloneDeep(keyIterNextFn), [])), t.identifier("done"), false), after);
self.emitAssign(stmt.left, t.memberExpression(t.cloneDeep(keyInfoTmpVar), t.identifier("value"), false));
self.leapManager.withEntry(new leap.LoopEntry(after, head, labelId), function () {
self.explodeStatement(path.get("body"));
});
self.jump(head);
self.mark(after);
break;
case "BreakStatement":
self.emitAbruptCompletion({
type: "break",
target: self.leapManager.getBreakLoc(stmt.label)
});
break;
case "ContinueStatement":
self.emitAbruptCompletion({
type: "continue",
target: self.leapManager.getContinueLoc(stmt.label)
});
break;
case "SwitchStatement":
// Always save the discriminant into a temporary variable in case the
// test expressions overwrite values like context.sent.
var disc = self.emitAssign(self.makeTempVar(), self.explodeExpression(path.get("discriminant")));
after = this.loc();
var defaultLoc = this.loc();
var condition = defaultLoc;
var caseLocs = []; // If there are no cases, .cases might be undefined.
var cases = stmt.cases || [];
for (var i = cases.length - 1; i >= 0; --i) {
var c = cases[i];
t.assertSwitchCase(c);
if (c.test) {
condition = t.conditionalExpression(t.binaryExpression("===", t.cloneDeep(disc), c.test), caseLocs[i] = this.loc(), condition);
} else {
caseLocs[i] = defaultLoc;
}
}
var discriminant = path.get("discriminant");
util.replaceWithOrRemove(discriminant, condition);
self.jump(self.explodeExpression(discriminant));
self.leapManager.withEntry(new leap.SwitchEntry(after), function () {
path.get("cases").forEach(function (casePath) {
var i = casePath.key;
self.mark(caseLocs[i]);
casePath.get("consequent").forEach(function (path) {
self.explodeStatement(path);
});
});
});
self.mark(after);
if (defaultLoc.value === -1) {
self.mark(defaultLoc);
_assert["default"].strictEqual(after.value, defaultLoc.value);
}
break;
case "IfStatement":
var elseLoc = stmt.alternate && this.loc();
after = this.loc();
self.jumpIfNot(self.explodeExpression(path.get("test")), elseLoc || after);
self.explodeStatement(path.get("consequent"));
if (elseLoc) {
self.jump(after);
self.mark(elseLoc);
self.explodeStatement(path.get("alternate"));
}
self.mark(after);
break;
case "ReturnStatement":
self.emitAbruptCompletion({
type: "return",
value: self.explodeExpression(path.get("argument"))
});
break;
case "WithStatement":
throw new Error("WithStatement not supported in generator functions.");
case "TryStatement":
after = this.loc();
var handler = stmt.handler;
var catchLoc = handler && this.loc();
var catchEntry = catchLoc && new leap.CatchEntry(catchLoc, handler.param);
var finallyLoc = stmt.finalizer && this.loc();
var finallyEntry = finallyLoc && new leap.FinallyEntry(finallyLoc, after);
var tryEntry = new leap.TryEntry(self.getUnmarkedCurrentLoc(), catchEntry, finallyEntry);
self.tryEntries.push(tryEntry);
self.updateContextPrevLoc(tryEntry.firstLoc);
self.leapManager.withEntry(tryEntry, function () {
self.explodeStatement(path.get("block"));
if (catchLoc) {
if (finallyLoc) {
// If we have both a catch block and a finally block, then
// because we emit the catch block first, we need to jump over
// it to the finally block.
self.jump(finallyLoc);
} else {
// If there is no finally block, then we need to jump over the
// catch block to the fall-through location.
self.jump(after);
}
self.updateContextPrevLoc(self.mark(catchLoc));
var bodyPath = path.get("handler.body");
var safeParam = self.makeTempVar();
self.clearPendingException(tryEntry.firstLoc, safeParam);
bodyPath.traverse(catchParamVisitor, {
getSafeParam: function getSafeParam() {
return t.cloneDeep(safeParam);
},
catchParamName: handler.param.name
});
self.leapManager.withEntry(catchEntry, function () {
self.explodeStatement(bodyPath);
});
}
if (finallyLoc) {
self.updateContextPrevLoc(self.mark(finallyLoc));
self.leapManager.withEntry(finallyEntry, function () {
self.explodeStatement(path.get("finalizer"));
});
self.emit(t.returnStatement(t.callExpression(self.contextProperty("finish"), [finallyEntry.firstLoc])));
}
});
self.mark(after);
break;
case "ThrowStatement":
self.emit(t.throwStatement(self.explodeExpression(path.get("argument"))));
break;
default:
throw new Error("unknown Statement of type " + JSON.stringify(stmt.type));
}
};
var catchParamVisitor = {
Identifier: function Identifier(path, state) {
if (path.node.name === state.catchParamName && util.isReference(path)) {
util.replaceWithOrRemove(path, state.getSafeParam());
}
},
Scope: function Scope(path, state) {
if (path.scope.hasOwnBinding(state.catchParamName)) {
// Don't descend into nested scopes that shadow the catch
// parameter with their own declarations.
path.skip();
}
}
};
Ep.emitAbruptCompletion = function (record) {
if (!isValidCompletion(record)) {
_assert["default"].ok(false, "invalid completion record: " + JSON.stringify(record));
}
_assert["default"].notStrictEqual(record.type, "normal", "normal completions are not abrupt");
var t = util.getTypes();
var abruptArgs = [t.stringLiteral(record.type)];
if (record.type === "break" || record.type === "continue") {
t.assertLiteral(record.target);
abruptArgs[1] = this.insertedLocs.has(record.target) ? record.target : t.cloneDeep(record.target);
} else if (record.type === "return" || record.type === "throw") {
if (record.value) {
t.assertExpression(record.value);
abruptArgs[1] = this.insertedLocs.has(record.value) ? record.value : t.cloneDeep(record.value);
}
}
this.emit(t.returnStatement(t.callExpression(this.contextProperty("abrupt"), abruptArgs)));
};
function isValidCompletion(record) {
var type = record.type;
if (type === "normal") {
return !hasOwn.call(record, "target");
}
if (type === "break" || type === "continue") {
return !hasOwn.call(record, "value") && util.getTypes().isLiteral(record.target);
}
if (type === "return" || type === "throw") {
return hasOwn.call(record, "value") && !hasOwn.call(record, "target");
}
return false;
} // Not all offsets into emitter.listing are potential jump targets. For
// example, execution typically falls into the beginning of a try block
// without jumping directly there. This method returns the current offset
// without marking it, so that a switch case will not necessarily be
// generated for this offset (I say "not necessarily" because the same
// location might end up being marked in the process of emitting other
// statements). There's no logical harm in marking such locations as jump
// targets, but minimizing the number of switch cases keeps the generated
// code shorter.
Ep.getUnmarkedCurrentLoc = function () {
return util.getTypes().numericLiteral(this.listing.length);
}; // The context.prev property takes the value of context.next whenever we
// evaluate the switch statement discriminant, which is generally good
// enough for tracking the last location we jumped to, but sometimes
// context.prev needs to be more precise, such as when we fall
// successfully out of a try block and into a finally block without
// jumping. This method exists to update context.prev to the freshest
// available location. If we were implementing a full interpreter, we
// would know the location of the current instruction with complete
// precision at all times, but we don't have that luxury here, as it would
// be costly and verbose to set context.prev before every statement.
Ep.updateContextPrevLoc = function (loc) {
var t = util.getTypes();
if (loc) {
t.assertLiteral(loc);
if (loc.value === -1) {
// If an uninitialized location literal was passed in, set its value
// to the current this.listing.length.
loc.value = this.listing.length;
} else {
// Otherwise assert that the location matches the current offset.
_assert["default"].strictEqual(loc.value, this.listing.length);
}
} else {
loc = this.getUnmarkedCurrentLoc();
} // Make sure context.prev is up to date in case we fell into this try
// statement without jumping to it. TODO Consider avoiding this
// assignment when we know control must have jumped here.
this.emitAssign(this.contextProperty("prev"), loc);
};
Ep.explodeExpression = function (path, ignoreResult) {
var t = util.getTypes();
var expr = path.node;
if (expr) {
t.assertExpression(expr);
} else {
return expr;
}
var self = this;
var result; // Used optionally by several cases below.
var after;
function finish(expr) {
t.assertExpression(expr);
if (ignoreResult) {
self.emit(expr);
} else {
return expr;
}
} // If the expression does not contain a leap, then we either emit the
// expression as a standalone statement or return it whole.
if (!meta.containsLeap(expr)) {
return finish(expr);
} // If any child contains a leap (such as a yield or labeled continue or
// break statement), then any sibling subexpressions will almost
// certainly have to be exploded in order to maintain the order of their
// side effects relative to the leaping child(ren).
var hasLeapingChildren = meta.containsLeap.onlyChildren(expr); // In order to save the rest of explodeExpression from a combinatorial
// trainwreck of special cases, explodeViaTempVar is responsible for
// deciding when a subexpression needs to be "exploded," which is my
// very technical term for emitting the subexpression as an assignment
// to a temporary variable and the substituting the temporary variable
// for the original subexpression. Think of exploded view diagrams, not
// Michael Bay movies. The point of exploding subexpressions is to
// control the precise order in which the generated code realizes the
// side effects of those subexpressions.
function explodeViaTempVar(tempVar, childPath, ignoreChildResult) {
_assert["default"].ok(!ignoreChildResult || !tempVar, "Ignoring the result of a child expression but forcing it to " + "be assigned to a temporary variable?");
var result = self.explodeExpression(childPath, ignoreChildResult);
if (ignoreChildResult) {// Side effects already emitted above.
} else if (tempVar || hasLeapingChildren && !t.isLiteral(result)) {
// If tempVar was provided, then the result will always be assigned
// to it, even if the result does not otherwise need to be assigned
// to a temporary variable. When no tempVar is provided, we have
// the flexibility to decide whether a temporary variable is really
// necessary. Unfortunately, in general, a temporary variable is
// required whenever any child contains a yield expression, since it
// is difficult to prove (at all, let alone efficiently) whether
// this result would evaluate to the same value before and after the
// yield (see #206). One narrow case where we can prove it doesn't
// matter (and thus we do not need a temporary variable) is when the
// result in question is a Literal value.
result = self.emitAssign(tempVar || self.makeTempVar(), result);
}
return result;
} // If ignoreResult is true, then we must take full responsibility for
// emitting the expression with all its side effects, and we should not
// return a result.
switch (expr.type) {
case "MemberExpression":
return finish(t.memberExpression(self.explodeExpression(path.get("object")), expr.computed ? explodeViaTempVar(null, path.get("property")) : expr.property, expr.computed));
case "CallExpression":
var calleePath = path.get("callee");
var argsPath = path.get("arguments");
var newCallee;
var newArgs;
var hasLeapingArgs = argsPath.some(function (argPath) {
return meta.containsLeap(argPath.node);
});
var injectFirstArg = null;
if (t.isMemberExpression(calleePath.node)) {
if (hasLeapingArgs) {
// If the arguments of the CallExpression contained any yield
// expressions, then we need to be sure to evaluate the callee
// before evaluating the arguments, but if the callee was a member
// expression, then we must be careful that the object of the
// member expression still gets bound to `this` for the call.
var newObject = explodeViaTempVar( // Assign the exploded callee.object expression to a temporary
// variable so that we can use it twice without reevaluating it.
self.makeTempVar(), calleePath.get("object"));
var newProperty = calleePath.node.computed ? explodeViaTempVar(null, calleePath.get("property")) : calleePath.node.property;
injectFirstArg = newObject;
newCallee = t.memberExpression(t.memberExpression(t.cloneDeep(newObject), newProperty, calleePath.node.computed), t.identifier("call"), false);
} else {
newCallee = self.explodeExpression(calleePath);
}
} else {
newCallee = explodeViaTempVar(null, calleePath);
if (t.isMemberExpression(newCallee)) {
// If the callee was not previously a MemberExpression, then the
// CallExpression was "unqualified," meaning its `this` object
// should be the global object. If the exploded expression has
// become a MemberExpression (e.g. a context property, probably a
// temporary variable), then we need to force it to be unqualified
// by using the (0, object.property)(...) trick; otherwise, it
// will receive the object of the MemberExpression as its `this`
// object.
newCallee = t.sequenceExpression([t.numericLiteral(0), t.cloneDeep(newCallee)]);
}
}
if (hasLeapingArgs) {
newArgs = argsPath.map(function (argPath) {
return explodeViaTempVar(null, argPath);
});
if (injectFirstArg) newArgs.unshift(injectFirstArg);
newArgs = newArgs.map(function (arg) {
return t.cloneDeep(arg);
});
} else {
newArgs = path.node.arguments;
}
return finish(t.callExpression(newCallee, newArgs));
case "NewExpression":
return finish(t.newExpression(explodeViaTempVar(null, path.get("callee")), path.get("arguments").map(function (argPath) {
return explodeViaTempVar(null, argPath);
})));
case "ObjectExpression":
return finish(t.objectExpression(path.get("properties").map(function (propPath) {
if (propPath.isObjectProperty()) {
return t.objectProperty(propPath.node.key, explodeViaTempVar(null, propPath.get("value")), propPath.node.computed);
} else {
return propPath.node;
}
})));
case "ArrayExpression":
return finish(t.arrayExpression(path.get("elements").map(function (elemPath) {
if (elemPath.isSpreadElement()) {
return t.spreadElement(explodeViaTempVar(null, elemPath.get("argument")));
} else {
return explodeViaTempVar(null, elemPath);
}
})));
case "SequenceExpression":
var lastIndex = expr.expressions.length - 1;
path.get("expressions").forEach(function (exprPath) {
if (exprPath.key === lastIndex) {
result = self.explodeExpression(exprPath, ignoreResult);
} else {
self.explodeExpression(exprPath, true);
}
});
return result;
case "LogicalExpression":
after = this.loc();
if (!ignoreResult) {
result = self.makeTempVar();
}
var left = explodeViaTempVar(result, path.get("left"));
if (expr.operator === "&&") {
self.jumpIfNot(left, after);
} else {
_assert["default"].strictEqual(expr.operator, "||");
self.jumpIf(left, after);
}
explodeViaTempVar(result, path.get("right"), ignoreResult);
self.mark(after);
return result;
case "ConditionalExpression":
var elseLoc = this.loc();
after = this.loc();
var test = self.explodeExpression(path.get("test"));
self.jumpIfNot(test, elseLoc);
if (!ignoreResult) {
result = self.makeTempVar();
}
explodeViaTempVar(result, path.get("consequent"), ignoreResult);
self.jump(after);
self.mark(elseLoc);
explodeViaTempVar(result, path.get("alternate"), ignoreResult);
self.mark(after);
return result;
case "UnaryExpression":
return finish(t.unaryExpression(expr.operator, // Can't (and don't need to) break up the syntax of the argument.
// Think about delete a[b].
self.explodeExpression(path.get("argument")), !!expr.prefix));
case "BinaryExpression":
return finish(t.binaryExpression(expr.operator, explodeViaTempVar(null, path.get("left")), explodeViaTempVar(null, path.get("right"))));
case "AssignmentExpression":
if (expr.operator === "=") {
// If this is a simple assignment, the left hand side does not need
// to be read before the right hand side is evaluated, so we can
// avoid the more complicated logic below.
return finish(t.assignmentExpression(expr.operator, self.explodeExpression(path.get("left")), self.explodeExpression(path.get("right"))));
}
var lhs = self.explodeExpression(path.get("left"));
var temp = self.emitAssign(self.makeTempVar(), lhs); // For example,
//
// x += yield y
//
// becomes
//
// context.t0 = x
// x = context.t0 += yield y
//
// so that the left-hand side expression is read before the yield.
// Fixes https://github.com/facebook/regenerator/issues/345.
return finish(t.assignmentExpression("=", t.cloneDeep(lhs), t.assignmentExpression(expr.operator, t.cloneDeep(temp), self.explodeExpression(path.get("right")))));
case "UpdateExpression":
return finish(t.updateExpression(expr.operator, self.explodeExpression(path.get("argument")), expr.prefix));
case "YieldExpression":
after = this.loc();
var arg = expr.argument && self.explodeExpression(path.get("argument"));
if (arg && expr.delegate) {
var _result = self.makeTempVar();
var _ret = t.returnStatement(t.callExpression(self.contextProperty("delegateYield"), [arg, t.stringLiteral(_result.property.name), after]));
_ret.loc = expr.loc;
self.emit(_ret);
self.mark(after);
return _result;
}
self.emitAssign(self.contextProperty("next"), after);
var ret = t.returnStatement(t.cloneDeep(arg) || null); // Preserve the `yield` location so that source mappings for the statements
// link back to the yield properly.
ret.loc = expr.loc;
self.emit(ret);
self.mark(after);
return self.contextProperty("sent");
default:
throw new Error("unknown Expression of type " + JSON.stringify(expr.type));
}
};

136
node_modules/regenerator-transform/lib/hoist.js generated vendored Normal file
View File

@@ -0,0 +1,136 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var util = _interopRequireWildcard(require("./util"));
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasOwn = Object.prototype.hasOwnProperty; // The hoist function takes a FunctionExpression or FunctionDeclaration
// and replaces any Declaration nodes in its body with assignments, then
// returns a VariableDeclaration containing just the names of the removed
// declarations.
exports.hoist = function (funPath) {
var t = util.getTypes();
t.assertFunction(funPath.node);
var vars = {};
function varDeclToExpr(_ref, includeIdentifiers) {
var vdec = _ref.node,
scope = _ref.scope;
t.assertVariableDeclaration(vdec); // TODO assert.equal(vdec.kind, "var");
var exprs = [];
vdec.declarations.forEach(function (dec) {
// Note: We duplicate 'dec.id' here to ensure that the variable declaration IDs don't
// have the same 'loc' value, since that can make sourcemaps and retainLines behave poorly.
vars[dec.id.name] = t.identifier(dec.id.name); // Remove the binding, to avoid "duplicate declaration" errors when it will
// be injected again.
scope.removeBinding(dec.id.name);
if (dec.init) {
exprs.push(t.assignmentExpression("=", dec.id, dec.init));
} else if (includeIdentifiers) {
exprs.push(dec.id);
}
});
if (exprs.length === 0) return null;
if (exprs.length === 1) return exprs[0];
return t.sequenceExpression(exprs);
}
funPath.get("body").traverse({
VariableDeclaration: {
exit: function exit(path) {
var expr = varDeclToExpr(path, false);
if (expr === null) {
path.remove();
} else {
// We don't need to traverse this expression any further because
// there can't be any new declarations inside an expression.
util.replaceWithOrRemove(path, t.expressionStatement(expr));
} // Since the original node has been either removed or replaced,
// avoid traversing it any further.
path.skip();
}
},
ForStatement: function ForStatement(path) {
var init = path.get("init");
if (init.isVariableDeclaration()) {
util.replaceWithOrRemove(init, varDeclToExpr(init, false));
}
},
ForXStatement: function ForXStatement(path) {
var left = path.get("left");
if (left.isVariableDeclaration()) {
util.replaceWithOrRemove(left, varDeclToExpr(left, true));
}
},
FunctionDeclaration: function FunctionDeclaration(path) {
var node = path.node;
vars[node.id.name] = node.id;
var assignment = t.expressionStatement(t.assignmentExpression("=", t.clone(node.id), t.functionExpression(path.scope.generateUidIdentifierBasedOnNode(node), node.params, node.body, node.generator, node.expression)));
if (path.parentPath.isBlockStatement()) {
// Insert the assignment form before the first statement in the
// enclosing block.
path.parentPath.unshiftContainer("body", assignment); // Remove the function declaration now that we've inserted the
// equivalent assignment form at the beginning of the block.
path.remove();
} else {
// If the parent node is not a block statement, then we can just
// replace the declaration with the equivalent assignment form
// without worrying about hoisting it.
util.replaceWithOrRemove(path, assignment);
} // Remove the binding, to avoid "duplicate declaration" errors when it will
// be injected again.
path.scope.removeBinding(node.id.name); // Don't hoist variables out of inner functions.
path.skip();
},
FunctionExpression: function FunctionExpression(path) {
// Don't descend into nested function expressions.
path.skip();
},
ArrowFunctionExpression: function ArrowFunctionExpression(path) {
// Don't descend into nested function expressions.
path.skip();
}
});
var paramNames = {};
funPath.get("params").forEach(function (paramPath) {
var param = paramPath.node;
if (t.isIdentifier(param)) {
paramNames[param.name] = param;
} else {// Variables declared by destructuring parameter patterns will be
// harmlessly re-declared.
}
});
var declarations = [];
Object.keys(vars).forEach(function (name) {
if (!hasOwn.call(paramNames, name)) {
declarations.push(t.variableDeclarator(vars[name], null));
}
});
if (declarations.length === 0) {
return null; // Be sure to handle this case!
}
return t.variableDeclaration("var", declarations);
};

29
node_modules/regenerator-transform/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
exports.__esModule = true;
exports["default"] = _default;
var _visit = require("./visit");
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function _default(context) {
var plugin = {
visitor: (0, _visit.getVisitor)(context)
}; // Some presets manually call child presets, but fail to pass along the
// context object. Out of an abundance of caution, we verify that it
// exists first to avoid causing unnecessary breaking changes.
var version = context && context.version; // The "name" property is not allowed in older versions of Babel (6.x)
// and will cause the plugin validator to throw an exception.
if (version && parseInt(version, 10) >= 7) {
plugin.name = "regenerator-transform";
}
return plugin;
}

178
node_modules/regenerator-transform/lib/leap.js generated vendored Normal file
View File

@@ -0,0 +1,178 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _assert = _interopRequireDefault(require("assert"));
var _emit = require("./emit");
var _util = require("util");
var _util2 = require("./util");
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function Entry() {
_assert["default"].ok(this instanceof Entry);
}
function FunctionEntry(returnLoc) {
Entry.call(this);
(0, _util2.getTypes)().assertLiteral(returnLoc);
this.returnLoc = returnLoc;
}
(0, _util.inherits)(FunctionEntry, Entry);
exports.FunctionEntry = FunctionEntry;
function LoopEntry(breakLoc, continueLoc, label) {
Entry.call(this);
var t = (0, _util2.getTypes)();
t.assertLiteral(breakLoc);
t.assertLiteral(continueLoc);
if (label) {
t.assertIdentifier(label);
} else {
label = null;
}
this.breakLoc = breakLoc;
this.continueLoc = continueLoc;
this.label = label;
}
(0, _util.inherits)(LoopEntry, Entry);
exports.LoopEntry = LoopEntry;
function SwitchEntry(breakLoc) {
Entry.call(this);
(0, _util2.getTypes)().assertLiteral(breakLoc);
this.breakLoc = breakLoc;
}
(0, _util.inherits)(SwitchEntry, Entry);
exports.SwitchEntry = SwitchEntry;
function TryEntry(firstLoc, catchEntry, finallyEntry) {
Entry.call(this);
var t = (0, _util2.getTypes)();
t.assertLiteral(firstLoc);
if (catchEntry) {
_assert["default"].ok(catchEntry instanceof CatchEntry);
} else {
catchEntry = null;
}
if (finallyEntry) {
_assert["default"].ok(finallyEntry instanceof FinallyEntry);
} else {
finallyEntry = null;
} // Have to have one or the other (or both).
_assert["default"].ok(catchEntry || finallyEntry);
this.firstLoc = firstLoc;
this.catchEntry = catchEntry;
this.finallyEntry = finallyEntry;
}
(0, _util.inherits)(TryEntry, Entry);
exports.TryEntry = TryEntry;
function CatchEntry(firstLoc, paramId) {
Entry.call(this);
var t = (0, _util2.getTypes)();
t.assertLiteral(firstLoc);
t.assertIdentifier(paramId);
this.firstLoc = firstLoc;
this.paramId = paramId;
}
(0, _util.inherits)(CatchEntry, Entry);
exports.CatchEntry = CatchEntry;
function FinallyEntry(firstLoc, afterLoc) {
Entry.call(this);
var t = (0, _util2.getTypes)();
t.assertLiteral(firstLoc);
t.assertLiteral(afterLoc);
this.firstLoc = firstLoc;
this.afterLoc = afterLoc;
}
(0, _util.inherits)(FinallyEntry, Entry);
exports.FinallyEntry = FinallyEntry;
function LabeledEntry(breakLoc, label) {
Entry.call(this);
var t = (0, _util2.getTypes)();
t.assertLiteral(breakLoc);
t.assertIdentifier(label);
this.breakLoc = breakLoc;
this.label = label;
}
(0, _util.inherits)(LabeledEntry, Entry);
exports.LabeledEntry = LabeledEntry;
function LeapManager(emitter) {
_assert["default"].ok(this instanceof LeapManager);
_assert["default"].ok(emitter instanceof _emit.Emitter);
this.emitter = emitter;
this.entryStack = [new FunctionEntry(emitter.finalLoc)];
}
var LMp = LeapManager.prototype;
exports.LeapManager = LeapManager;
LMp.withEntry = function (entry, callback) {
_assert["default"].ok(entry instanceof Entry);
this.entryStack.push(entry);
try {
callback.call(this.emitter);
} finally {
var popped = this.entryStack.pop();
_assert["default"].strictEqual(popped, entry);
}
};
LMp._findLeapLocation = function (property, label) {
for (var i = this.entryStack.length - 1; i >= 0; --i) {
var entry = this.entryStack[i];
var loc = entry[property];
if (loc) {
if (label) {
if (entry.label && entry.label.name === label.name) {
return loc;
}
} else if (entry instanceof LabeledEntry) {// Ignore LabeledEntry entries unless we are actually breaking to
// a label.
} else {
return loc;
}
}
}
return null;
};
LMp.getBreakLoc = function (label) {
return this._findLeapLocation("breakLoc", label);
};
LMp.getContinueLoc = function (label) {
return this._findLeapLocation("continueLoc", label);
};

113
node_modules/regenerator-transform/lib/meta.js generated vendored Normal file
View File

@@ -0,0 +1,113 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _assert = _interopRequireDefault(require("assert"));
var _util = require("./util.js");
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var mMap = new WeakMap();
function m(node) {
if (!mMap.has(node)) {
mMap.set(node, {});
}
return mMap.get(node);
}
var hasOwn = Object.prototype.hasOwnProperty;
function makePredicate(propertyName, knownTypes) {
function onlyChildren(node) {
var t = (0, _util.getTypes)();
t.assertNode(node); // Assume no side effects until we find out otherwise.
var result = false;
function check(child) {
if (result) {// Do nothing.
} else if (Array.isArray(child)) {
child.some(check);
} else if (t.isNode(child)) {
_assert["default"].strictEqual(result, false);
result = predicate(child);
}
return result;
}
var keys = t.VISITOR_KEYS[node.type];
if (keys) {
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var child = node[key];
check(child);
}
}
return result;
}
function predicate(node) {
(0, _util.getTypes)().assertNode(node);
var meta = m(node);
if (hasOwn.call(meta, propertyName)) return meta[propertyName]; // Certain types are "opaque," which means they have no side
// effects or leaps and we don't care about their subexpressions.
if (hasOwn.call(opaqueTypes, node.type)) return meta[propertyName] = false;
if (hasOwn.call(knownTypes, node.type)) return meta[propertyName] = true;
return meta[propertyName] = onlyChildren(node);
}
predicate.onlyChildren = onlyChildren;
return predicate;
}
var opaqueTypes = {
FunctionExpression: true,
ArrowFunctionExpression: true
}; // These types potentially have side effects regardless of what side
// effects their subexpressions have.
var sideEffectTypes = {
CallExpression: true,
// Anything could happen!
ForInStatement: true,
// Modifies the key variable.
UnaryExpression: true,
// Think delete.
BinaryExpression: true,
// Might invoke .toString() or .valueOf().
AssignmentExpression: true,
// Side-effecting by definition.
UpdateExpression: true,
// Updates are essentially assignments.
NewExpression: true // Similar to CallExpression.
}; // These types are the direct cause of all leaps in control flow.
var leapTypes = {
YieldExpression: true,
BreakStatement: true,
ContinueStatement: true,
ReturnStatement: true,
ThrowStatement: true
}; // All leap types are also side effect types.
for (var type in leapTypes) {
if (hasOwn.call(leapTypes, type)) {
sideEffectTypes[type] = leapTypes[type];
}
}
exports.hasSideEffects = makePredicate("hasSideEffects", sideEffectTypes);
exports.containsLeap = makePredicate("containsLeap", leapTypes);

View File

@@ -0,0 +1,79 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
exports.__esModule = true;
exports["default"] = replaceShorthandObjectMethod;
var util = _interopRequireWildcard(require("./util"));
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// this function converts a shorthand object generator method into a normal
// (non-shorthand) object property which is a generator function expression. for
// example, this:
//
// var foo = {
// *bar(baz) { return 5; }
// }
//
// should be replaced with:
//
// var foo = {
// bar: function*(baz) { return 5; }
// }
//
// to do this, it clones the parameter array and the body of the object generator
// method into a new FunctionExpression.
//
// this method can be passed any Function AST node path, and it will return
// either:
// a) the path that was passed in (iff the path did not need to be replaced) or
// b) the path of the new FunctionExpression that was created as a replacement
// (iff the path did need to be replaced)
//
// In either case, though, the caller can count on the fact that the return value
// is a Function AST node path.
//
// If this function is called with an AST node path that is not a Function (or with an
// argument that isn't an AST node path), it will throw an error.
function replaceShorthandObjectMethod(path) {
var t = util.getTypes();
if (!path.node || !t.isFunction(path.node)) {
throw new Error("replaceShorthandObjectMethod can only be called on Function AST node paths.");
} // this function only replaces shorthand object methods (called ObjectMethod
// in Babel-speak).
if (!t.isObjectMethod(path.node)) {
return path;
} // this function only replaces generators.
if (!path.node.generator) {
return path;
}
var parameters = path.node.params.map(function (param) {
return t.cloneDeep(param);
});
var functionExpression = t.functionExpression(null, // id
parameters, // params
t.cloneDeep(path.node.body), // body
path.node.generator, path.node.async);
util.replaceWithOrRemove(path, t.objectProperty(t.cloneDeep(path.node.key), // key
functionExpression, //value
path.node.computed, // computed
false // shorthand
)); // path now refers to the ObjectProperty AST node path, but we want to return a
// Function AST node path for the function expression we created. we know that
// the FunctionExpression we just created is the value of the ObjectProperty,
// so return the "value" path off of this path.
return path.get("value");
}

56
node_modules/regenerator-transform/lib/util.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
"use strict";
exports.__esModule = true;
exports.wrapWithTypes = wrapWithTypes;
exports.getTypes = getTypes;
exports.runtimeProperty = runtimeProperty;
exports.isReference = isReference;
exports.replaceWithOrRemove = replaceWithOrRemove;
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var currentTypes = null;
function wrapWithTypes(types, fn) {
return function () {
var oldTypes = currentTypes;
currentTypes = types;
try {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return fn.apply(this, args);
} finally {
currentTypes = oldTypes;
}
};
}
function getTypes() {
return currentTypes;
}
function runtimeProperty(name) {
var t = getTypes();
return t.memberExpression(t.identifier("regeneratorRuntime"), t.identifier(name), false);
}
function isReference(path) {
return path.isReferenced() || path.parentPath.isAssignmentExpression({
left: path.node
});
}
function replaceWithOrRemove(path, replacement) {
if (replacement) {
path.replaceWith(replacement);
} else {
path.remove();
}
}

326
node_modules/regenerator-transform/lib/visit.js generated vendored Normal file
View File

@@ -0,0 +1,326 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _assert = _interopRequireDefault(require("assert"));
var _hoist = require("./hoist");
var _emit = require("./emit");
var _replaceShorthandObjectMethod = _interopRequireDefault(require("./replaceShorthandObjectMethod"));
var util = _interopRequireWildcard(require("./util"));
exports.getVisitor = function (_ref) {
var t = _ref.types;
return {
Method: function Method(path, state) {
var node = path.node;
if (!shouldRegenerate(node, state)) return;
var container = t.functionExpression(null, [], t.cloneNode(node.body, false), node.generator, node.async);
path.get("body").set("body", [t.returnStatement(t.callExpression(container, []))]); // Regardless of whether or not the wrapped function is a an async method
// or generator the outer function should not be
node.async = false;
node.generator = false; // Unwrap the wrapper IIFE's environment so super and this and such still work.
path.get("body.body.0.argument.callee").unwrapFunctionEnvironment();
},
Function: {
exit: util.wrapWithTypes(t, function (path, state) {
var node = path.node;
if (!shouldRegenerate(node, state)) return; // if this is an ObjectMethod, we need to convert it to an ObjectProperty
path = (0, _replaceShorthandObjectMethod["default"])(path);
node = path.node;
var contextId = path.scope.generateUidIdentifier("context");
var argsId = path.scope.generateUidIdentifier("args");
path.ensureBlock();
var bodyBlockPath = path.get("body");
if (node.async) {
bodyBlockPath.traverse(awaitVisitor);
}
bodyBlockPath.traverse(functionSentVisitor, {
context: contextId
});
var outerBody = [];
var innerBody = [];
bodyBlockPath.get("body").forEach(function (childPath) {
var node = childPath.node;
if (t.isExpressionStatement(node) && t.isStringLiteral(node.expression)) {
// Babylon represents directives like "use strict" as elements
// of a bodyBlockPath.node.directives array, but they could just
// as easily be represented (by other parsers) as traditional
// string-literal-valued expression statements, so we need to
// handle that here. (#248)
outerBody.push(node);
} else if (node && node._blockHoist != null) {
outerBody.push(node);
} else {
innerBody.push(node);
}
});
if (outerBody.length > 0) {
// Only replace the inner body if we actually hoisted any statements
// to the outer body.
bodyBlockPath.node.body = innerBody;
}
var outerFnExpr = getOuterFnExpr(path); // Note that getOuterFnExpr has the side-effect of ensuring that the
// function has a name (so node.id will always be an Identifier), even
// if a temporary name has to be synthesized.
t.assertIdentifier(node.id);
var innerFnId = t.identifier(node.id.name + "$"); // Turn all declarations into vars, and replace the original
// declarations with equivalent assignment expressions.
var vars = (0, _hoist.hoist)(path);
var context = {
usesThis: false,
usesArguments: false,
getArgsId: function getArgsId() {
return t.clone(argsId);
}
};
path.traverse(argumentsThisVisitor, context);
if (context.usesArguments) {
vars = vars || t.variableDeclaration("var", []);
vars.declarations.push(t.variableDeclarator(t.clone(argsId), t.identifier("arguments")));
}
var emitter = new _emit.Emitter(contextId);
emitter.explode(path.get("body"));
if (vars && vars.declarations.length > 0) {
outerBody.push(vars);
}
var wrapArgs = [emitter.getContextFunction(innerFnId)];
var tryLocsList = emitter.getTryLocsList();
if (node.generator) {
wrapArgs.push(outerFnExpr);
} else if (context.usesThis || tryLocsList || node.async) {
// Async functions that are not generators don't care about the
// outer function because they don't need it to be marked and don't
// inherit from its .prototype.
wrapArgs.push(t.nullLiteral());
}
if (context.usesThis) {
wrapArgs.push(t.thisExpression());
} else if (tryLocsList || node.async) {
wrapArgs.push(t.nullLiteral());
}
if (tryLocsList) {
wrapArgs.push(tryLocsList);
} else if (node.async) {
wrapArgs.push(t.nullLiteral());
}
if (node.async) {
// Rename any locally declared "Promise" variable,
// to use the global one.
var currentScope = path.scope;
do {
if (currentScope.hasOwnBinding("Promise")) currentScope.rename("Promise");
} while (currentScope = currentScope.parent);
wrapArgs.push(t.identifier("Promise"));
}
var wrapCall = t.callExpression(util.runtimeProperty(node.async ? "async" : "wrap"), wrapArgs);
outerBody.push(t.returnStatement(wrapCall));
node.body = t.blockStatement(outerBody); // We injected a few new variable declarations (for every hoisted var),
// so we need to add them to the scope.
path.get("body.body").forEach(function (p) {
return p.scope.registerDeclaration(p);
});
var oldDirectives = bodyBlockPath.node.directives;
if (oldDirectives) {
// Babylon represents directives like "use strict" as elements of
// a bodyBlockPath.node.directives array. (#248)
node.body.directives = oldDirectives;
}
var wasGeneratorFunction = node.generator;
if (wasGeneratorFunction) {
node.generator = false;
}
if (node.async) {
node.async = false;
}
if (wasGeneratorFunction && t.isExpression(node)) {
util.replaceWithOrRemove(path, t.callExpression(util.runtimeProperty("mark"), [node]));
path.addComment("leading", "#__PURE__");
}
var insertedLocs = emitter.getInsertedLocs();
path.traverse({
NumericLiteral: function NumericLiteral(path) {
if (!insertedLocs.has(path.node)) {
return;
}
path.replaceWith(t.numericLiteral(path.node.value));
}
}); // Generators are processed in 'exit' handlers so that regenerator only has to run on
// an ES5 AST, but that means traversal will not pick up newly inserted references
// to things like 'regeneratorRuntime'. To avoid this, we explicitly requeue.
path.requeue();
})
}
};
}; // Check if a node should be transformed by regenerator
function shouldRegenerate(node, state) {
if (node.generator) {
if (node.async) {
// Async generator
return state.opts.asyncGenerators !== false;
} else {
// Plain generator
return state.opts.generators !== false;
}
} else if (node.async) {
// Async function
return state.opts.async !== false;
} else {
// Not a generator or async function.
return false;
}
} // Given a NodePath for a Function, return an Expression node that can be
// used to refer reliably to the function object from inside the function.
// This expression is essentially a replacement for arguments.callee, with
// the key advantage that it works in strict mode.
function getOuterFnExpr(funPath) {
var t = util.getTypes();
var node = funPath.node;
t.assertFunction(node);
if (!node.id) {
// Default-exported function declarations, and function expressions may not
// have a name to reference, so we explicitly add one.
node.id = funPath.scope.parent.generateUidIdentifier("callee");
}
if (node.generator && // Non-generator functions don't need to be marked.
t.isFunctionDeclaration(node)) {
// Return the identifier returned by runtime.mark(<node.id>).
return getMarkedFunctionId(funPath);
}
return t.clone(node.id);
}
var markInfo = new WeakMap();
function getMarkInfo(node) {
if (!markInfo.has(node)) {
markInfo.set(node, {});
}
return markInfo.get(node);
}
function getMarkedFunctionId(funPath) {
var t = util.getTypes();
var node = funPath.node;
t.assertIdentifier(node.id);
var blockPath = funPath.findParent(function (path) {
return path.isProgram() || path.isBlockStatement();
});
if (!blockPath) {
return node.id;
}
var block = blockPath.node;
_assert["default"].ok(Array.isArray(block.body));
var info = getMarkInfo(block);
if (!info.decl) {
info.decl = t.variableDeclaration("var", []);
blockPath.unshiftContainer("body", info.decl);
info.declPath = blockPath.get("body.0");
}
_assert["default"].strictEqual(info.declPath.node, info.decl); // Get a new unique identifier for our marked variable.
var markedId = blockPath.scope.generateUidIdentifier("marked");
var markCallExp = t.callExpression(util.runtimeProperty("mark"), [t.clone(node.id)]);
var index = info.decl.declarations.push(t.variableDeclarator(markedId, markCallExp)) - 1;
var markCallExpPath = info.declPath.get("declarations." + index + ".init");
_assert["default"].strictEqual(markCallExpPath.node, markCallExp);
markCallExpPath.addComment("leading", "#__PURE__");
return t.clone(markedId);
}
var argumentsThisVisitor = {
"FunctionExpression|FunctionDeclaration|Method": function FunctionExpressionFunctionDeclarationMethod(path) {
path.skip();
},
Identifier: function Identifier(path, state) {
if (path.node.name === "arguments" && util.isReference(path)) {
util.replaceWithOrRemove(path, state.getArgsId());
state.usesArguments = true;
}
},
ThisExpression: function ThisExpression(path, state) {
state.usesThis = true;
}
};
var functionSentVisitor = {
MetaProperty: function MetaProperty(path) {
var node = path.node;
if (node.meta.name === "function" && node.property.name === "sent") {
var t = util.getTypes();
util.replaceWithOrRemove(path, t.memberExpression(t.clone(this.context), t.identifier("_sent")));
}
}
};
var awaitVisitor = {
Function: function Function(path) {
path.skip(); // Don't descend into nested function scopes.
},
AwaitExpression: function AwaitExpression(path) {
var t = util.getTypes(); // Convert await expressions to yield expressions.
var argument = path.node.argument; // Transforming `await x` to `yield regeneratorRuntime.awrap(x)`
// causes the argument to be wrapped in such a way that the runtime
// can distinguish between awaited and merely yielded values.
util.replaceWithOrRemove(path, t.yieldExpression(t.callExpression(util.runtimeProperty("awrap"), [argument]), false));
}
};

View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
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.

View File

@@ -0,0 +1,19 @@
# @babel/runtime
> babel's modular runtime helpers
See our website [@babel/runtime](https://babeljs.io/docs/en/babel-runtime) for more information.
## Install
Using npm:
```sh
npm install --save @babel/runtime
```
or using yarn:
```sh
yarn add @babel/runtime
```

View File

@@ -0,0 +1,99 @@
var AwaitValue = require("./AwaitValue.js");
function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
var wrappedAwait = value instanceof AwaitValue;
Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) {
if (wrappedAwait) {
resume(key === "return" ? "return" : "next", arg);
return;
}
settle(result.done ? "return" : "normal", arg);
}, function (err) {
resume("throw", err);
});
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen["return"] !== "function") {
this["return"] = undefined;
}
}
AsyncGenerator.prototype[typeof Symbol === "function" && Symbol.asyncIterator || "@@asyncIterator"] = function () {
return this;
};
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype["throw"] = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype["return"] = function (arg) {
return this._invoke("return", arg);
};
module.exports = AsyncGenerator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,6 @@
function _AwaitValue(value) {
this.wrapped = value;
}
module.exports = _AwaitValue;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,31 @@
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
var desc = {};
Object.keys(descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ('value' in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object.defineProperty(target, property, desc);
desc = null;
}
return desc;
}
module.exports = _applyDecoratedDescriptor;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,12 @@
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
module.exports = _arrayLikeToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,6 @@
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
module.exports = _arrayWithHoles;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,8 @@
var arrayLikeToArray = require("./arrayLikeToArray.js");
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}
module.exports = _arrayWithoutHoles;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,10 @@
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,57 @@
function _asyncGeneratorDelegate(inner, awaitWrap) {
var iter = {},
waiting = false;
function pump(key, value) {
waiting = true;
value = new Promise(function (resolve) {
resolve(inner[key](value));
});
return {
done: false,
value: awaitWrap(value)
};
}
;
iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () {
return this;
};
iter.next = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("next", value);
};
if (typeof inner["throw"] === "function") {
iter["throw"] = function (value) {
if (waiting) {
waiting = false;
throw value;
}
return pump("throw", value);
};
}
if (typeof inner["return"] === "function") {
iter["return"] = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("return", value);
};
}
return iter;
}
module.exports = _asyncGeneratorDelegate;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,16 @@
function _asyncIterator(iterable) {
var method;
if (typeof Symbol !== "undefined") {
if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];
if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];
}
if (method == null) method = iterable["@@asyncIterator"];
if (method == null) method = iterable["@@iterator"];
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
}
module.exports = _asyncIterator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,38 @@
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
module.exports = _asyncToGenerator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,8 @@
var AwaitValue = require("./AwaitValue.js");
function _awaitAsyncGenerator(value) {
return new AwaitValue(value);
}
module.exports = _awaitAsyncGenerator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,23 @@
function _classApplyDescriptorDestructureSet(receiver, descriptor) {
if (descriptor.set) {
if (!("__destrObj" in descriptor)) {
descriptor.__destrObj = {
set value(v) {
descriptor.set.call(receiver, v);
}
};
}
return descriptor.__destrObj;
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}
module.exports = _classApplyDescriptorDestructureSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,10 @@
function _classApplyDescriptorGet(receiver, descriptor) {
if (descriptor.get) {
return descriptor.get.call(receiver);
}
return descriptor.value;
}
module.exports = _classApplyDescriptorGet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,14 @@
function _classApplyDescriptorSet(receiver, descriptor, value) {
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
}
module.exports = _classApplyDescriptorSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,8 @@
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
module.exports = _classCallCheck;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,8 @@
function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance");
}
}
module.exports = _classCheckPrivateStaticAccess;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,8 @@
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}
module.exports = _classCheckPrivateStaticFieldDescriptor;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,10 @@
function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}
module.exports = _classExtractFieldDescriptor;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,6 @@
function _classNameTDZError(name) {
throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys.");
}
module.exports = _classNameTDZError;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,11 @@
var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js");
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
function _classPrivateFieldDestructureSet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
return classApplyDescriptorDestructureSet(receiver, descriptor);
}
module.exports = _classPrivateFieldDestructureSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,11 @@
var classApplyDescriptorGet = require("./classApplyDescriptorGet.js");
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get");
return classApplyDescriptorGet(receiver, descriptor);
}
module.exports = _classPrivateFieldGet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,10 @@
function _classPrivateFieldBase(receiver, privateKey) {
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
throw new TypeError("attempted to use private field on non-instance");
}
return receiver;
}
module.exports = _classPrivateFieldBase;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,8 @@
var id = 0;
function _classPrivateFieldKey(name) {
return "__private_" + id++ + "_" + name;
}
module.exports = _classPrivateFieldKey;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,12 @@
var classApplyDescriptorSet = require("./classApplyDescriptorSet.js");
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
classApplyDescriptorSet(receiver, descriptor, value);
return value;
}
module.exports = _classPrivateFieldSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,10 @@
function _classPrivateMethodGet(receiver, privateSet, fn) {
if (!privateSet.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return fn;
}
module.exports = _classPrivateMethodGet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,6 @@
function _classPrivateMethodSet() {
throw new TypeError("attempted to reassign private method");
}
module.exports = _classPrivateMethodSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,14 @@
var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js");
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js");
function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
return classApplyDescriptorDestructureSet(receiver, descriptor);
}
module.exports = _classStaticPrivateFieldDestructureSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,14 @@
var classApplyDescriptorGet = require("./classApplyDescriptorGet.js");
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js");
function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "get");
return classApplyDescriptorGet(receiver, descriptor);
}
module.exports = _classStaticPrivateFieldSpecGet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,15 @@
var classApplyDescriptorSet = require("./classApplyDescriptorSet.js");
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js");
function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
classApplyDescriptorSet(receiver, descriptor, value);
return value;
}
module.exports = _classStaticPrivateFieldSpecSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,9 @@
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
classCheckPrivateStaticAccess(receiver, classConstructor);
return method;
}
module.exports = _classStaticPrivateMethodGet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,6 @@
function _classStaticPrivateMethodSet() {
throw new TypeError("attempted to set read only static private field");
}
module.exports = _classStaticPrivateMethodSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,26 @@
var setPrototypeOf = require("./setPrototypeOf.js");
var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
function _construct(Parent, args, Class) {
if (isNativeReflectConstruct()) {
module.exports = _construct = Reflect.construct;
module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _construct = function _construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) setPrototypeOf(instance, Class.prototype);
return instance;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
}
return _construct.apply(null, arguments);
}
module.exports = _construct;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,18 @@
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
module.exports = _createClass;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,61 @@
var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
function _createForOfIteratorHelper(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (!it) {
if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
var F = function F() {};
return {
s: F,
n: function n() {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
},
e: function e(_e) {
throw _e;
},
f: F
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var normalCompletion = true,
didErr = false,
err;
return {
s: function s() {
it = it.call(o);
},
n: function n() {
var step = it.next();
normalCompletion = step.done;
return step;
},
e: function e(_e2) {
didErr = true;
err = _e2;
},
f: function f() {
try {
if (!normalCompletion && it["return"] != null) it["return"]();
} finally {
if (didErr) throw err;
}
}
};
}
module.exports = _createForOfIteratorHelper;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,25 @@
var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (it) return (it = it.call(o)).next.bind(it);
if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
return function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _createForOfIteratorHelperLoose;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,25 @@
var getPrototypeOf = require("./getPrototypeOf.js");
var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
var possibleConstructorReturn = require("./possibleConstructorReturn.js");
function _createSuper(Derived) {
var hasNativeReflectConstruct = isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return possibleConstructorReturn(this, result);
};
}
module.exports = _createSuper;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,401 @@
var toArray = require("./toArray.js");
var toPropertyKey = require("./toPropertyKey.js");
function _decorate(decorators, factory, superClass, mixins) {
var api = _getDecoratorsApi();
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
api = mixins[i](api);
}
}
var r = factory(function initialize(O) {
api.initializeInstanceElements(O, decorated.elements);
}, superClass);
var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators);
api.initializeClassElements(r.F, decorated.elements);
return api.runClassFinishers(r.F, decorated.finishers);
}
function _getDecoratorsApi() {
_getDecoratorsApi = function _getDecoratorsApi() {
return api;
};
var api = {
elementsDefinitionOrder: [["method"], ["field"]],
initializeInstanceElements: function initializeInstanceElements(O, elements) {
["method", "field"].forEach(function (kind) {
elements.forEach(function (element) {
if (element.kind === kind && element.placement === "own") {
this.defineClassElement(O, element);
}
}, this);
}, this);
},
initializeClassElements: function initializeClassElements(F, elements) {
var proto = F.prototype;
["method", "field"].forEach(function (kind) {
elements.forEach(function (element) {
var placement = element.placement;
if (element.kind === kind && (placement === "static" || placement === "prototype")) {
var receiver = placement === "static" ? F : proto;
this.defineClassElement(receiver, element);
}
}, this);
}, this);
},
defineClassElement: function defineClassElement(receiver, element) {
var descriptor = element.descriptor;
if (element.kind === "field") {
var initializer = element.initializer;
descriptor = {
enumerable: descriptor.enumerable,
writable: descriptor.writable,
configurable: descriptor.configurable,
value: initializer === void 0 ? void 0 : initializer.call(receiver)
};
}
Object.defineProperty(receiver, element.key, descriptor);
},
decorateClass: function decorateClass(elements, decorators) {
var newElements = [];
var finishers = [];
var placements = {
"static": [],
prototype: [],
own: []
};
elements.forEach(function (element) {
this.addElementPlacement(element, placements);
}, this);
elements.forEach(function (element) {
if (!_hasDecorators(element)) return newElements.push(element);
var elementFinishersExtras = this.decorateElement(element, placements);
newElements.push(elementFinishersExtras.element);
newElements.push.apply(newElements, elementFinishersExtras.extras);
finishers.push.apply(finishers, elementFinishersExtras.finishers);
}, this);
if (!decorators) {
return {
elements: newElements,
finishers: finishers
};
}
var result = this.decorateConstructor(newElements, decorators);
finishers.push.apply(finishers, result.finishers);
result.finishers = finishers;
return result;
},
addElementPlacement: function addElementPlacement(element, placements, silent) {
var keys = placements[element.placement];
if (!silent && keys.indexOf(element.key) !== -1) {
throw new TypeError("Duplicated element (" + element.key + ")");
}
keys.push(element.key);
},
decorateElement: function decorateElement(element, placements) {
var extras = [];
var finishers = [];
for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) {
var keys = placements[element.placement];
keys.splice(keys.indexOf(element.key), 1);
var elementObject = this.fromElementDescriptor(element);
var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject);
element = elementFinisherExtras.element;
this.addElementPlacement(element, placements);
if (elementFinisherExtras.finisher) {
finishers.push(elementFinisherExtras.finisher);
}
var newExtras = elementFinisherExtras.extras;
if (newExtras) {
for (var j = 0; j < newExtras.length; j++) {
this.addElementPlacement(newExtras[j], placements);
}
extras.push.apply(extras, newExtras);
}
}
return {
element: element,
finishers: finishers,
extras: extras
};
},
decorateConstructor: function decorateConstructor(elements, decorators) {
var finishers = [];
for (var i = decorators.length - 1; i >= 0; i--) {
var obj = this.fromClassDescriptor(elements);
var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj);
if (elementsAndFinisher.finisher !== undefined) {
finishers.push(elementsAndFinisher.finisher);
}
if (elementsAndFinisher.elements !== undefined) {
elements = elementsAndFinisher.elements;
for (var j = 0; j < elements.length - 1; j++) {
for (var k = j + 1; k < elements.length; k++) {
if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) {
throw new TypeError("Duplicated element (" + elements[j].key + ")");
}
}
}
}
}
return {
elements: elements,
finishers: finishers
};
},
fromElementDescriptor: function fromElementDescriptor(element) {
var obj = {
kind: element.kind,
key: element.key,
placement: element.placement,
descriptor: element.descriptor
};
var desc = {
value: "Descriptor",
configurable: true
};
Object.defineProperty(obj, Symbol.toStringTag, desc);
if (element.kind === "field") obj.initializer = element.initializer;
return obj;
},
toElementDescriptors: function toElementDescriptors(elementObjects) {
if (elementObjects === undefined) return;
return toArray(elementObjects).map(function (elementObject) {
var element = this.toElementDescriptor(elementObject);
this.disallowProperty(elementObject, "finisher", "An element descriptor");
this.disallowProperty(elementObject, "extras", "An element descriptor");
return element;
}, this);
},
toElementDescriptor: function toElementDescriptor(elementObject) {
var kind = String(elementObject.kind);
if (kind !== "method" && kind !== "field") {
throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"');
}
var key = toPropertyKey(elementObject.key);
var placement = String(elementObject.placement);
if (placement !== "static" && placement !== "prototype" && placement !== "own") {
throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"');
}
var descriptor = elementObject.descriptor;
this.disallowProperty(elementObject, "elements", "An element descriptor");
var element = {
kind: kind,
key: key,
placement: placement,
descriptor: Object.assign({}, descriptor)
};
if (kind !== "field") {
this.disallowProperty(elementObject, "initializer", "A method descriptor");
} else {
this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor");
this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor");
this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor");
element.initializer = elementObject.initializer;
}
return element;
},
toElementFinisherExtras: function toElementFinisherExtras(elementObject) {
var element = this.toElementDescriptor(elementObject);
var finisher = _optionalCallableProperty(elementObject, "finisher");
var extras = this.toElementDescriptors(elementObject.extras);
return {
element: element,
finisher: finisher,
extras: extras
};
},
fromClassDescriptor: function fromClassDescriptor(elements) {
var obj = {
kind: "class",
elements: elements.map(this.fromElementDescriptor, this)
};
var desc = {
value: "Descriptor",
configurable: true
};
Object.defineProperty(obj, Symbol.toStringTag, desc);
return obj;
},
toClassDescriptor: function toClassDescriptor(obj) {
var kind = String(obj.kind);
if (kind !== "class") {
throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"');
}
this.disallowProperty(obj, "key", "A class descriptor");
this.disallowProperty(obj, "placement", "A class descriptor");
this.disallowProperty(obj, "descriptor", "A class descriptor");
this.disallowProperty(obj, "initializer", "A class descriptor");
this.disallowProperty(obj, "extras", "A class descriptor");
var finisher = _optionalCallableProperty(obj, "finisher");
var elements = this.toElementDescriptors(obj.elements);
return {
elements: elements,
finisher: finisher
};
},
runClassFinishers: function runClassFinishers(constructor, finishers) {
for (var i = 0; i < finishers.length; i++) {
var newConstructor = (0, finishers[i])(constructor);
if (newConstructor !== undefined) {
if (typeof newConstructor !== "function") {
throw new TypeError("Finishers must return a constructor.");
}
constructor = newConstructor;
}
}
return constructor;
},
disallowProperty: function disallowProperty(obj, name, objectType) {
if (obj[name] !== undefined) {
throw new TypeError(objectType + " can't have a ." + name + " property.");
}
}
};
return api;
}
function _createElementDescriptor(def) {
var key = toPropertyKey(def.key);
var descriptor;
if (def.kind === "method") {
descriptor = {
value: def.value,
writable: true,
configurable: true,
enumerable: false
};
} else if (def.kind === "get") {
descriptor = {
get: def.value,
configurable: true,
enumerable: false
};
} else if (def.kind === "set") {
descriptor = {
set: def.value,
configurable: true,
enumerable: false
};
} else if (def.kind === "field") {
descriptor = {
configurable: true,
writable: true,
enumerable: true
};
}
var element = {
kind: def.kind === "field" ? "field" : "method",
key: key,
placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype",
descriptor: descriptor
};
if (def.decorators) element.decorators = def.decorators;
if (def.kind === "field") element.initializer = def.value;
return element;
}
function _coalesceGetterSetter(element, other) {
if (element.descriptor.get !== undefined) {
other.descriptor.get = element.descriptor.get;
} else {
other.descriptor.set = element.descriptor.set;
}
}
function _coalesceClassElements(elements) {
var newElements = [];
var isSameElement = function isSameElement(other) {
return other.kind === "method" && other.key === element.key && other.placement === element.placement;
};
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
var other;
if (element.kind === "method" && (other = newElements.find(isSameElement))) {
if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) {
if (_hasDecorators(element) || _hasDecorators(other)) {
throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated.");
}
other.descriptor = element.descriptor;
} else {
if (_hasDecorators(element)) {
if (_hasDecorators(other)) {
throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ").");
}
other.decorators = element.decorators;
}
_coalesceGetterSetter(element, other);
}
} else {
newElements.push(element);
}
}
return newElements;
}
function _hasDecorators(element) {
return element.decorators && element.decorators.length;
}
function _isDataDescriptor(desc) {
return desc !== undefined && !(desc.value === undefined && desc.writable === undefined);
}
function _optionalCallableProperty(obj, name) {
var value = obj[name];
if (value !== undefined && typeof value !== "function") {
throw new TypeError("Expected '" + name + "' to be a function");
}
return value;
}
module.exports = _decorate;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,17 @@
function _defaults(obj, defaults) {
var keys = Object.getOwnPropertyNames(defaults);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = Object.getOwnPropertyDescriptor(defaults, key);
if (value && value.configurable && obj[key] === undefined) {
Object.defineProperty(obj, key, value);
}
}
return obj;
}
module.exports = _defaults;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,25 @@
function _defineEnumerableProperties(obj, descs) {
for (var key in descs) {
var desc = descs[key];
desc.configurable = desc.enumerable = true;
if ("value" in desc) desc.writable = true;
Object.defineProperty(obj, key, desc);
}
if (Object.getOwnPropertySymbols) {
var objectSymbols = Object.getOwnPropertySymbols(descs);
for (var i = 0; i < objectSymbols.length; i++) {
var sym = objectSymbols[i];
var desc = descs[sym];
desc.configurable = desc.enumerable = true;
if ("value" in desc) desc.writable = true;
Object.defineProperty(obj, sym, desc);
}
}
return obj;
}
module.exports = _defineEnumerableProperties;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,17 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View File

@@ -0,0 +1,95 @@
import AwaitValue from "./AwaitValue.js";
export default function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
var wrappedAwait = value instanceof AwaitValue;
Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) {
if (wrappedAwait) {
resume(key === "return" ? "return" : "next", arg);
return;
}
settle(result.done ? "return" : "normal", arg);
}, function (err) {
resume("throw", err);
});
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen["return"] !== "function") {
this["return"] = undefined;
}
}
AsyncGenerator.prototype[typeof Symbol === "function" && Symbol.asyncIterator || "@@asyncIterator"] = function () {
return this;
};
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype["throw"] = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype["return"] = function (arg) {
return this._invoke("return", arg);
};

View File

@@ -0,0 +1,3 @@
export default function _AwaitValue(value) {
this.wrapped = value;
}

View File

@@ -0,0 +1,28 @@
export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
var desc = {};
Object.keys(descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ('value' in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object.defineProperty(target, property, desc);
desc = null;
}
return desc;
}

View File

@@ -0,0 +1,9 @@
export default function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}

View File

@@ -0,0 +1,3 @@
export default function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}

View File

@@ -0,0 +1,4 @@
import arrayLikeToArray from "./arrayLikeToArray.js";
export default function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}

View File

@@ -0,0 +1,7 @@
export default function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}

View File

@@ -0,0 +1,54 @@
export default function _asyncGeneratorDelegate(inner, awaitWrap) {
var iter = {},
waiting = false;
function pump(key, value) {
waiting = true;
value = new Promise(function (resolve) {
resolve(inner[key](value));
});
return {
done: false,
value: awaitWrap(value)
};
}
;
iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () {
return this;
};
iter.next = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("next", value);
};
if (typeof inner["throw"] === "function") {
iter["throw"] = function (value) {
if (waiting) {
waiting = false;
throw value;
}
return pump("throw", value);
};
}
if (typeof inner["return"] === "function") {
iter["return"] = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("return", value);
};
}
return iter;
}

View File

@@ -0,0 +1,13 @@
export default function _asyncIterator(iterable) {
var method;
if (typeof Symbol !== "undefined") {
if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];
if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];
}
if (method == null) method = iterable["@@asyncIterator"];
if (method == null) method = iterable["@@iterator"];
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
}

View File

@@ -0,0 +1,35 @@
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
export default function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}

View File

@@ -0,0 +1,4 @@
import AwaitValue from "./AwaitValue.js";
export default function _awaitAsyncGenerator(value) {
return new AwaitValue(value);
}

View File

@@ -0,0 +1,20 @@
export default function _classApplyDescriptorDestructureSet(receiver, descriptor) {
if (descriptor.set) {
if (!("__destrObj" in descriptor)) {
descriptor.__destrObj = {
set value(v) {
descriptor.set.call(receiver, v);
}
};
}
return descriptor.__destrObj;
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}

View File

@@ -0,0 +1,7 @@
export default function _classApplyDescriptorGet(receiver, descriptor) {
if (descriptor.get) {
return descriptor.get.call(receiver);
}
return descriptor.value;
}

View File

@@ -0,0 +1,11 @@
export default function _classApplyDescriptorSet(receiver, descriptor, value) {
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
}

View File

@@ -0,0 +1,5 @@
export default function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}

View File

@@ -0,0 +1,5 @@
export default function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance");
}
}

View File

@@ -0,0 +1,5 @@
export default function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}

View File

@@ -0,0 +1,7 @@
export default function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}

View File

@@ -0,0 +1,3 @@
export default function _classNameTDZError(name) {
throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys.");
}

View File

@@ -0,0 +1,6 @@
import classApplyDescriptorDestructureSet from "./classApplyDescriptorDestructureSet.js";
import classExtractFieldDescriptor from "./classExtractFieldDescriptor.js";
export default function _classPrivateFieldDestructureSet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
return classApplyDescriptorDestructureSet(receiver, descriptor);
}

View File

@@ -0,0 +1,6 @@
import classApplyDescriptorGet from "./classApplyDescriptorGet.js";
import classExtractFieldDescriptor from "./classExtractFieldDescriptor.js";
export default function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get");
return classApplyDescriptorGet(receiver, descriptor);
}

View File

@@ -0,0 +1,7 @@
export default function _classPrivateFieldBase(receiver, privateKey) {
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
throw new TypeError("attempted to use private field on non-instance");
}
return receiver;
}

View File

@@ -0,0 +1,4 @@
var id = 0;
export default function _classPrivateFieldKey(name) {
return "__private_" + id++ + "_" + name;
}

View File

@@ -0,0 +1,7 @@
import classApplyDescriptorSet from "./classApplyDescriptorSet.js";
import classExtractFieldDescriptor from "./classExtractFieldDescriptor.js";
export default function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
classApplyDescriptorSet(receiver, descriptor, value);
return value;
}

View File

@@ -0,0 +1,7 @@
export default function _classPrivateMethodGet(receiver, privateSet, fn) {
if (!privateSet.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return fn;
}

View File

@@ -0,0 +1,3 @@
export default function _classPrivateMethodSet() {
throw new TypeError("attempted to reassign private method");
}

View File

@@ -0,0 +1,8 @@
import classApplyDescriptorDestructureSet from "./classApplyDescriptorDestructureSet.js";
import classCheckPrivateStaticAccess from "./classCheckPrivateStaticAccess.js";
import classCheckPrivateStaticFieldDescriptor from "./classCheckPrivateStaticFieldDescriptor.js";
export default function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
return classApplyDescriptorDestructureSet(receiver, descriptor);
}

View File

@@ -0,0 +1,8 @@
import classApplyDescriptorGet from "./classApplyDescriptorGet.js";
import classCheckPrivateStaticAccess from "./classCheckPrivateStaticAccess.js";
import classCheckPrivateStaticFieldDescriptor from "./classCheckPrivateStaticFieldDescriptor.js";
export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "get");
return classApplyDescriptorGet(receiver, descriptor);
}

View File

@@ -0,0 +1,9 @@
import classApplyDescriptorSet from "./classApplyDescriptorSet.js";
import classCheckPrivateStaticAccess from "./classCheckPrivateStaticAccess.js";
import classCheckPrivateStaticFieldDescriptor from "./classCheckPrivateStaticFieldDescriptor.js";
export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
classApplyDescriptorSet(receiver, descriptor, value);
return value;
}

View File

@@ -0,0 +1,5 @@
import classCheckPrivateStaticAccess from "./classCheckPrivateStaticAccess.js";
export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
classCheckPrivateStaticAccess(receiver, classConstructor);
return method;
}

View File

@@ -0,0 +1,3 @@
export default function _classStaticPrivateMethodSet() {
throw new TypeError("attempted to set read only static private field");
}

View File

@@ -0,0 +1,18 @@
import setPrototypeOf from "./setPrototypeOf.js";
import isNativeReflectConstruct from "./isNativeReflectConstruct.js";
export default function _construct(Parent, args, Class) {
if (isNativeReflectConstruct()) {
_construct = Reflect.construct;
} else {
_construct = function _construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) setPrototypeOf(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}

View File

@@ -0,0 +1,15 @@
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
export default function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}

View File

@@ -0,0 +1,57 @@
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
export default function _createForOfIteratorHelper(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (!it) {
if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
var F = function F() {};
return {
s: F,
n: function n() {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
},
e: function e(_e) {
throw _e;
},
f: F
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var normalCompletion = true,
didErr = false,
err;
return {
s: function s() {
it = it.call(o);
},
n: function n() {
var step = it.next();
normalCompletion = step.done;
return step;
},
e: function e(_e2) {
didErr = true;
err = _e2;
},
f: function f() {
try {
if (!normalCompletion && it["return"] != null) it["return"]();
} finally {
if (didErr) throw err;
}
}
};
}

View File

@@ -0,0 +1,21 @@
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
export default function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (it) return (it = it.call(o)).next.bind(it);
if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
return function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

View File

@@ -0,0 +1,19 @@
import getPrototypeOf from "./getPrototypeOf.js";
import isNativeReflectConstruct from "./isNativeReflectConstruct.js";
import possibleConstructorReturn from "./possibleConstructorReturn.js";
export default function _createSuper(Derived) {
var hasNativeReflectConstruct = isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return possibleConstructorReturn(this, result);
};
}

View File

@@ -0,0 +1,396 @@
import toArray from "./toArray.js";
import toPropertyKey from "./toPropertyKey.js";
export default function _decorate(decorators, factory, superClass, mixins) {
var api = _getDecoratorsApi();
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
api = mixins[i](api);
}
}
var r = factory(function initialize(O) {
api.initializeInstanceElements(O, decorated.elements);
}, superClass);
var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators);
api.initializeClassElements(r.F, decorated.elements);
return api.runClassFinishers(r.F, decorated.finishers);
}
function _getDecoratorsApi() {
_getDecoratorsApi = function _getDecoratorsApi() {
return api;
};
var api = {
elementsDefinitionOrder: [["method"], ["field"]],
initializeInstanceElements: function initializeInstanceElements(O, elements) {
["method", "field"].forEach(function (kind) {
elements.forEach(function (element) {
if (element.kind === kind && element.placement === "own") {
this.defineClassElement(O, element);
}
}, this);
}, this);
},
initializeClassElements: function initializeClassElements(F, elements) {
var proto = F.prototype;
["method", "field"].forEach(function (kind) {
elements.forEach(function (element) {
var placement = element.placement;
if (element.kind === kind && (placement === "static" || placement === "prototype")) {
var receiver = placement === "static" ? F : proto;
this.defineClassElement(receiver, element);
}
}, this);
}, this);
},
defineClassElement: function defineClassElement(receiver, element) {
var descriptor = element.descriptor;
if (element.kind === "field") {
var initializer = element.initializer;
descriptor = {
enumerable: descriptor.enumerable,
writable: descriptor.writable,
configurable: descriptor.configurable,
value: initializer === void 0 ? void 0 : initializer.call(receiver)
};
}
Object.defineProperty(receiver, element.key, descriptor);
},
decorateClass: function decorateClass(elements, decorators) {
var newElements = [];
var finishers = [];
var placements = {
"static": [],
prototype: [],
own: []
};
elements.forEach(function (element) {
this.addElementPlacement(element, placements);
}, this);
elements.forEach(function (element) {
if (!_hasDecorators(element)) return newElements.push(element);
var elementFinishersExtras = this.decorateElement(element, placements);
newElements.push(elementFinishersExtras.element);
newElements.push.apply(newElements, elementFinishersExtras.extras);
finishers.push.apply(finishers, elementFinishersExtras.finishers);
}, this);
if (!decorators) {
return {
elements: newElements,
finishers: finishers
};
}
var result = this.decorateConstructor(newElements, decorators);
finishers.push.apply(finishers, result.finishers);
result.finishers = finishers;
return result;
},
addElementPlacement: function addElementPlacement(element, placements, silent) {
var keys = placements[element.placement];
if (!silent && keys.indexOf(element.key) !== -1) {
throw new TypeError("Duplicated element (" + element.key + ")");
}
keys.push(element.key);
},
decorateElement: function decorateElement(element, placements) {
var extras = [];
var finishers = [];
for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) {
var keys = placements[element.placement];
keys.splice(keys.indexOf(element.key), 1);
var elementObject = this.fromElementDescriptor(element);
var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject);
element = elementFinisherExtras.element;
this.addElementPlacement(element, placements);
if (elementFinisherExtras.finisher) {
finishers.push(elementFinisherExtras.finisher);
}
var newExtras = elementFinisherExtras.extras;
if (newExtras) {
for (var j = 0; j < newExtras.length; j++) {
this.addElementPlacement(newExtras[j], placements);
}
extras.push.apply(extras, newExtras);
}
}
return {
element: element,
finishers: finishers,
extras: extras
};
},
decorateConstructor: function decorateConstructor(elements, decorators) {
var finishers = [];
for (var i = decorators.length - 1; i >= 0; i--) {
var obj = this.fromClassDescriptor(elements);
var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj);
if (elementsAndFinisher.finisher !== undefined) {
finishers.push(elementsAndFinisher.finisher);
}
if (elementsAndFinisher.elements !== undefined) {
elements = elementsAndFinisher.elements;
for (var j = 0; j < elements.length - 1; j++) {
for (var k = j + 1; k < elements.length; k++) {
if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) {
throw new TypeError("Duplicated element (" + elements[j].key + ")");
}
}
}
}
}
return {
elements: elements,
finishers: finishers
};
},
fromElementDescriptor: function fromElementDescriptor(element) {
var obj = {
kind: element.kind,
key: element.key,
placement: element.placement,
descriptor: element.descriptor
};
var desc = {
value: "Descriptor",
configurable: true
};
Object.defineProperty(obj, Symbol.toStringTag, desc);
if (element.kind === "field") obj.initializer = element.initializer;
return obj;
},
toElementDescriptors: function toElementDescriptors(elementObjects) {
if (elementObjects === undefined) return;
return toArray(elementObjects).map(function (elementObject) {
var element = this.toElementDescriptor(elementObject);
this.disallowProperty(elementObject, "finisher", "An element descriptor");
this.disallowProperty(elementObject, "extras", "An element descriptor");
return element;
}, this);
},
toElementDescriptor: function toElementDescriptor(elementObject) {
var kind = String(elementObject.kind);
if (kind !== "method" && kind !== "field") {
throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"');
}
var key = toPropertyKey(elementObject.key);
var placement = String(elementObject.placement);
if (placement !== "static" && placement !== "prototype" && placement !== "own") {
throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"');
}
var descriptor = elementObject.descriptor;
this.disallowProperty(elementObject, "elements", "An element descriptor");
var element = {
kind: kind,
key: key,
placement: placement,
descriptor: Object.assign({}, descriptor)
};
if (kind !== "field") {
this.disallowProperty(elementObject, "initializer", "A method descriptor");
} else {
this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor");
this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor");
this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor");
element.initializer = elementObject.initializer;
}
return element;
},
toElementFinisherExtras: function toElementFinisherExtras(elementObject) {
var element = this.toElementDescriptor(elementObject);
var finisher = _optionalCallableProperty(elementObject, "finisher");
var extras = this.toElementDescriptors(elementObject.extras);
return {
element: element,
finisher: finisher,
extras: extras
};
},
fromClassDescriptor: function fromClassDescriptor(elements) {
var obj = {
kind: "class",
elements: elements.map(this.fromElementDescriptor, this)
};
var desc = {
value: "Descriptor",
configurable: true
};
Object.defineProperty(obj, Symbol.toStringTag, desc);
return obj;
},
toClassDescriptor: function toClassDescriptor(obj) {
var kind = String(obj.kind);
if (kind !== "class") {
throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"');
}
this.disallowProperty(obj, "key", "A class descriptor");
this.disallowProperty(obj, "placement", "A class descriptor");
this.disallowProperty(obj, "descriptor", "A class descriptor");
this.disallowProperty(obj, "initializer", "A class descriptor");
this.disallowProperty(obj, "extras", "A class descriptor");
var finisher = _optionalCallableProperty(obj, "finisher");
var elements = this.toElementDescriptors(obj.elements);
return {
elements: elements,
finisher: finisher
};
},
runClassFinishers: function runClassFinishers(constructor, finishers) {
for (var i = 0; i < finishers.length; i++) {
var newConstructor = (0, finishers[i])(constructor);
if (newConstructor !== undefined) {
if (typeof newConstructor !== "function") {
throw new TypeError("Finishers must return a constructor.");
}
constructor = newConstructor;
}
}
return constructor;
},
disallowProperty: function disallowProperty(obj, name, objectType) {
if (obj[name] !== undefined) {
throw new TypeError(objectType + " can't have a ." + name + " property.");
}
}
};
return api;
}
function _createElementDescriptor(def) {
var key = toPropertyKey(def.key);
var descriptor;
if (def.kind === "method") {
descriptor = {
value: def.value,
writable: true,
configurable: true,
enumerable: false
};
} else if (def.kind === "get") {
descriptor = {
get: def.value,
configurable: true,
enumerable: false
};
} else if (def.kind === "set") {
descriptor = {
set: def.value,
configurable: true,
enumerable: false
};
} else if (def.kind === "field") {
descriptor = {
configurable: true,
writable: true,
enumerable: true
};
}
var element = {
kind: def.kind === "field" ? "field" : "method",
key: key,
placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype",
descriptor: descriptor
};
if (def.decorators) element.decorators = def.decorators;
if (def.kind === "field") element.initializer = def.value;
return element;
}
function _coalesceGetterSetter(element, other) {
if (element.descriptor.get !== undefined) {
other.descriptor.get = element.descriptor.get;
} else {
other.descriptor.set = element.descriptor.set;
}
}
function _coalesceClassElements(elements) {
var newElements = [];
var isSameElement = function isSameElement(other) {
return other.kind === "method" && other.key === element.key && other.placement === element.placement;
};
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
var other;
if (element.kind === "method" && (other = newElements.find(isSameElement))) {
if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) {
if (_hasDecorators(element) || _hasDecorators(other)) {
throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated.");
}
other.descriptor = element.descriptor;
} else {
if (_hasDecorators(element)) {
if (_hasDecorators(other)) {
throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ").");
}
other.decorators = element.decorators;
}
_coalesceGetterSetter(element, other);
}
} else {
newElements.push(element);
}
}
return newElements;
}
function _hasDecorators(element) {
return element.decorators && element.decorators.length;
}
function _isDataDescriptor(desc) {
return desc !== undefined && !(desc.value === undefined && desc.writable === undefined);
}
function _optionalCallableProperty(obj, name) {
var value = obj[name];
if (value !== undefined && typeof value !== "function") {
throw new TypeError("Expected '" + name + "' to be a function");
}
return value;
}

View File

@@ -0,0 +1,14 @@
export default function _defaults(obj, defaults) {
var keys = Object.getOwnPropertyNames(defaults);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = Object.getOwnPropertyDescriptor(defaults, key);
if (value && value.configurable && obj[key] === undefined) {
Object.defineProperty(obj, key, value);
}
}
return obj;
}

View File

@@ -0,0 +1,22 @@
export default function _defineEnumerableProperties(obj, descs) {
for (var key in descs) {
var desc = descs[key];
desc.configurable = desc.enumerable = true;
if ("value" in desc) desc.writable = true;
Object.defineProperty(obj, key, desc);
}
if (Object.getOwnPropertySymbols) {
var objectSymbols = Object.getOwnPropertySymbols(descs);
for (var i = 0; i < objectSymbols.length; i++) {
var sym = objectSymbols[i];
var desc = descs[sym];
desc.configurable = desc.enumerable = true;
if ("value" in desc) desc.writable = true;
Object.defineProperty(obj, sym, desc);
}
}
return obj;
}

View File

@@ -0,0 +1,14 @@
export default function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}

View File

@@ -0,0 +1,17 @@
export default function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}

View File

@@ -0,0 +1,20 @@
import superPropBase from "./superPropBase.js";
export default function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
_get = Reflect.get;
} else {
_get = function _get(target, property, receiver) {
var base = superPropBase(target, property);
if (!base) return;
var desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.get) {
return desc.get.call(receiver);
}
return desc.value;
};
}
return _get(target, property, receiver || target);
}

View File

@@ -0,0 +1,6 @@
export default function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}

View File

@@ -0,0 +1,15 @@
import setPrototypeOf from "./setPrototypeOf.js";
export default function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) setPrototypeOf(subClass, superClass);
}

View File

@@ -0,0 +1,6 @@
import setPrototypeOf from "./setPrototypeOf.js";
export default function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
setPrototypeOf(subClass, superClass);
}

View File

@@ -0,0 +1,9 @@
export default function _initializerDefineProperty(target, property, descriptor, context) {
if (!descriptor) return;
Object.defineProperty(target, property, {
enumerable: descriptor.enumerable,
configurable: descriptor.configurable,
writable: descriptor.writable,
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
});
}

View File

@@ -0,0 +1,3 @@
export default function _initializerWarningHelper(descriptor, context) {
throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.');
}

View File

@@ -0,0 +1,7 @@
export default function _instanceof(left, right) {
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
return !!right[Symbol.hasInstance](left);
} else {
return left instanceof right;
}
}

Some files were not shown because too many files have changed in this diff Show More