From fad0508b3ed681a778b75f985327f6912bfb2755 Mon Sep 17 00:00:00 2001 From: siubaak Date: Sat, 8 Jun 2019 12:39:30 +0800 Subject: [PATCH] [Release] Version 0.4.6 --- dist/sval.es6.js | 5634 ++++++++++++++++----------------- dist/sval.js | 7610 ++++++++++++++++++++++----------------------- dist/sval.min.js | 2 +- package-lock.json | 2428 +++++++-------- package.json | 14 +- 5 files changed, 7793 insertions(+), 7895 deletions(-) diff --git a/dist/sval.es6.js b/dist/sval.es6.js index e9e50b5..33354dc 100644 --- a/dist/sval.es6.js +++ b/dist/sval.es6.js @@ -21,986 +21,997 @@ get MethodDefinition () { return MethodDefinition$1; } }); - const freeze = Object.freeze; - const define = Object.defineProperty; - const getDptor = Object.getOwnPropertyDescriptor; - const hasOwnProperty = Object.prototype.hasOwnProperty; - function hasOwn(obj, key) { - return hasOwnProperty.call(obj, key); - } - const getOwnNames = Object.getOwnPropertyNames; - const setPrototypeOf = Object.setPrototypeOf; - function setProto(obj, proto) { - setPrototypeOf ? setPrototypeOf(obj, proto) : obj.__proto__ = proto; - } - const getPrototypeOf = Object.getPrototypeOf; - function getProto(obj) { - return getPrototypeOf ? getPrototypeOf(obj) : obj.__proto__; - } - const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - function getGetterOrSetter(method, obj, key) { - while (obj) { - const descriptor = getOwnPropertyDescriptor(obj, key); - const value = typeof descriptor !== 'undefined' - && typeof descriptor.writable === 'undefined' - && typeof descriptor[method] === 'function' - && descriptor[method]; - if (value) { - return value; - } - else { - obj = getProto(obj); - } - } - } - function getGetter(obj, key) { - return getGetterOrSetter('get', obj, key); - } - function getSetter(obj, key) { - return getGetterOrSetter('set', obj, key); - } - const create = Object.create; - function inherits(subClass, superClass) { - setProto(subClass, superClass); - subClass.prototype = create(superClass.prototype, { - constructor: { - value: subClass, - writable: true, - } - }); - } - function _assign(target) { - for (let i = 1; i < arguments.length; ++i) { - const source = arguments[i]; - for (const key in source) { - if (hasOwn(source, key)) { - target[key] = source[key]; - } - } - } - return target; - } - const assign = Object.assign || _assign; - let names = []; - let globalObj = Object.create(null); - try { - if (!window.Object) - throw 0; - names = getOwnNames(globalObj = window).filter(n => n !== 'webkitStorageInfo'); - } - catch (err) { - try { - if (!global.Object) - throw 0; - names = getOwnNames(globalObj = global).filter(n => n !== 'GLOBAL' && n !== 'root'); - } - catch (err) { - try { - globalObj.Object = Object; - } - catch (err) { } - try { - globalObj.Function = Function; - } - catch (err) { } - try { - globalObj.Array = Array; - } - catch (err) { } - try { - globalObj.Number = Number; - } - catch (err) { } - try { - globalObj.parseFloat = parseFloat; - } - catch (err) { } - try { - globalObj.parseInt = parseInt; - } - catch (err) { } - try { - globalObj.Infinity = Infinity; - } - catch (err) { } - try { - globalObj.NaN = NaN; - } - catch (err) { } - try { - globalObj.undefined = undefined; - } - catch (err) { } - try { - globalObj.Boolean = Boolean; - } - catch (err) { } - try { - globalObj.String = String; - } - catch (err) { } - try { - globalObj.Symbol = Symbol; - } - catch (err) { } - try { - globalObj.Date = Date; - } - catch (err) { } - try { - globalObj.Promise = Promise; - } - catch (err) { } - try { - globalObj.RegExp = RegExp; - } - catch (err) { } - try { - globalObj.Error = Error; - } - catch (err) { } - try { - globalObj.EvalError = EvalError; - } - catch (err) { } - try { - globalObj.RangeError = RangeError; - } - catch (err) { } - try { - globalObj.ReferenceError = ReferenceError; - } - catch (err) { } - try { - globalObj.SyntaxError = SyntaxError; - } - catch (err) { } - try { - globalObj.TypeError = TypeError; - } - catch (err) { } - try { - globalObj.URIError = URIError; - } - catch (err) { } - try { - globalObj.JSON = JSON; - } - catch (err) { } - try { - globalObj.Math = Math; - } - catch (err) { } - try { - globalObj.console = console; - } - catch (err) { } - try { - globalObj.Intl = Intl; - } - catch (err) { } - try { - globalObj.ArrayBuffer = ArrayBuffer; - } - catch (err) { } - try { - globalObj.Uint8Array = Uint8Array; - } - catch (err) { } - try { - globalObj.Int8Array = Int8Array; - } - catch (err) { } - try { - globalObj.Uint16Array = Uint16Array; - } - catch (err) { } - try { - globalObj.Int16Array = Int16Array; - } - catch (err) { } - try { - globalObj.Uint32Array = Uint32Array; - } - catch (err) { } - try { - globalObj.Int32Array = Int32Array; - } - catch (err) { } - try { - globalObj.Float32Array = Float32Array; - } - catch (err) { } - try { - globalObj.Float64Array = Float64Array; - } - catch (err) { } - try { - globalObj.Uint8ClampedArray = Uint8ClampedArray; - } - catch (err) { } - try { - globalObj.DataView = DataView; - } - catch (err) { } - try { - globalObj.Map = Map; - } - catch (err) { } - try { - globalObj.Set = Set; - } - catch (err) { } - try { - globalObj.WeakMap = WeakMap; - } - catch (err) { } - try { - globalObj.WeakSet = WeakSet; - } - catch (err) { } - try { - globalObj.Proxy = Proxy; - } - catch (err) { } - try { - globalObj.Reflect = Reflect; - } - catch (err) { } - try { - globalObj.decodeURI = decodeURI; - } - catch (err) { } - try { - globalObj.decodeURIComponent = decodeURIComponent; - } - catch (err) { } - try { - globalObj.encodeURI = encodeURI; - } - catch (err) { } - try { - globalObj.encodeURIComponent = encodeURIComponent; - } - catch (err) { } - try { - globalObj.escape = escape; - } - catch (err) { } - try { - globalObj.unescape = unescape; - } - catch (err) { } - try { - globalObj.eval = eval; - } - catch (err) { } - try { - globalObj.isFinite = isFinite; - } - catch (err) { } - try { - globalObj.isNaN = isNaN; - } - catch (err) { } - try { - globalObj.SharedArrayBuffer = SharedArrayBuffer; - } - catch (err) { } - try { - globalObj.Atomics = Atomics; - } - catch (err) { } - try { - globalObj.WebAssembly = WebAssembly; - } - catch (err) { } - try { - globalObj.clearInterval = clearInterval; - } - catch (err) { } - try { - globalObj.clearTimeout = clearTimeout; - } - catch (err) { } - try { - globalObj.setInterval = setInterval; - } - catch (err) { } - try { - globalObj.setTimeout = setTimeout; - } - catch (err) { } - try { - globalObj.crypto = crypto; - } - catch (err) { } - names = getOwnNames(globalObj); - } - } - if (globalObj.Symbol) { - !globalObj.Symbol.iterator && (globalObj.Symbol.iterator = createSymbol('iterator')); - !globalObj.Symbol.asyncIterator && (globalObj.Symbol.asyncIterator = createSymbol('asynciterator')); - } - const win = Object.create(null); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - try { - win[name] = globalObj[name]; - } - catch (err) { } - } - function createSandBox() { - return assign(Object.create(null), win); - } - function createSymbol(key) { - return key + Math.random().toString(36).substring(2); - } - function getAsyncIterator(obj) { - let iterator; - if (typeof Symbol === 'function') { - iterator = obj[Symbol.asyncIterator]; - !iterator && (iterator = obj[Symbol.iterator]); - } - if (iterator) { - return iterator.call(obj); - } - else if (typeof obj.next === 'function') { - return obj; - } - else { - let i = 0; - return { - next() { - if (obj && i >= obj.length) - obj = undefined; - return { value: obj && obj[i++], done: !obj }; - } - }; - } + const freeze = Object.freeze; + const define = Object.defineProperty; + const getDptor = Object.getOwnPropertyDescriptor; + const hasOwnProperty = Object.prototype.hasOwnProperty; + function hasOwn(obj, key) { + return hasOwnProperty.call(obj, key); + } + const getOwnNames = Object.getOwnPropertyNames; + const setPrototypeOf = Object.setPrototypeOf; + function setProto(obj, proto) { + setPrototypeOf ? setPrototypeOf(obj, proto) : obj.__proto__ = proto; + } + const getPrototypeOf = Object.getPrototypeOf; + function getProto(obj) { + return getPrototypeOf ? getPrototypeOf(obj) : obj.__proto__; + } + const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + function getGetterOrSetter(method, obj, key) { + while (obj) { + const descriptor = getOwnPropertyDescriptor(obj, key); + const value = typeof descriptor !== 'undefined' + && typeof descriptor.writable === 'undefined' + && typeof descriptor[method] === 'function' + && descriptor[method]; + if (value) { + return value; + } + else { + obj = getProto(obj); + } + } + } + function getGetter(obj, key) { + return getGetterOrSetter('get', obj, key); + } + function getSetter(obj, key) { + return getGetterOrSetter('set', obj, key); + } + const create = Object.create; + function inherits(subClass, superClass) { + setProto(subClass, superClass); + subClass.prototype = create(superClass.prototype, { + constructor: { + value: subClass, + writable: true, + } + }); + } + function _assign(target) { + for (let i = 1; i < arguments.length; ++i) { + const source = arguments[i]; + for (const key in source) { + if (hasOwn(source, key)) { + target[key] = source[key]; + } + } + } + return target; + } + const assign = Object.assign || _assign; + let names = []; + let globalObj = Object.create(null); + try { + if (!window.Object) + throw 0; + names = getOwnNames(globalObj = window).filter(n => n !== 'webkitStorageInfo'); + } + catch (err) { + try { + if (!global.Object) + throw 0; + names = getOwnNames(globalObj = global).filter(n => n !== 'GLOBAL' && n !== 'root'); + } + catch (err) { + try { + globalObj.Object = Object; + } + catch (err) { } + try { + globalObj.Function = Function; + } + catch (err) { } + try { + globalObj.Array = Array; + } + catch (err) { } + try { + globalObj.Number = Number; + } + catch (err) { } + try { + globalObj.parseFloat = parseFloat; + } + catch (err) { } + try { + globalObj.parseInt = parseInt; + } + catch (err) { } + try { + globalObj.Infinity = Infinity; + } + catch (err) { } + try { + globalObj.NaN = NaN; + } + catch (err) { } + try { + globalObj.undefined = undefined; + } + catch (err) { } + try { + globalObj.Boolean = Boolean; + } + catch (err) { } + try { + globalObj.String = String; + } + catch (err) { } + try { + globalObj.Symbol = Symbol; + } + catch (err) { } + try { + globalObj.Date = Date; + } + catch (err) { } + try { + globalObj.Promise = Promise; + } + catch (err) { } + try { + globalObj.RegExp = RegExp; + } + catch (err) { } + try { + globalObj.Error = Error; + } + catch (err) { } + try { + globalObj.EvalError = EvalError; + } + catch (err) { } + try { + globalObj.RangeError = RangeError; + } + catch (err) { } + try { + globalObj.ReferenceError = ReferenceError; + } + catch (err) { } + try { + globalObj.SyntaxError = SyntaxError; + } + catch (err) { } + try { + globalObj.TypeError = TypeError; + } + catch (err) { } + try { + globalObj.URIError = URIError; + } + catch (err) { } + try { + globalObj.JSON = JSON; + } + catch (err) { } + try { + globalObj.Math = Math; + } + catch (err) { } + try { + globalObj.console = console; + } + catch (err) { } + try { + globalObj.Intl = Intl; + } + catch (err) { } + try { + globalObj.ArrayBuffer = ArrayBuffer; + } + catch (err) { } + try { + globalObj.Uint8Array = Uint8Array; + } + catch (err) { } + try { + globalObj.Int8Array = Int8Array; + } + catch (err) { } + try { + globalObj.Uint16Array = Uint16Array; + } + catch (err) { } + try { + globalObj.Int16Array = Int16Array; + } + catch (err) { } + try { + globalObj.Uint32Array = Uint32Array; + } + catch (err) { } + try { + globalObj.Int32Array = Int32Array; + } + catch (err) { } + try { + globalObj.Float32Array = Float32Array; + } + catch (err) { } + try { + globalObj.Float64Array = Float64Array; + } + catch (err) { } + try { + globalObj.Uint8ClampedArray = Uint8ClampedArray; + } + catch (err) { } + try { + globalObj.DataView = DataView; + } + catch (err) { } + try { + globalObj.Map = Map; + } + catch (err) { } + try { + globalObj.Set = Set; + } + catch (err) { } + try { + globalObj.WeakMap = WeakMap; + } + catch (err) { } + try { + globalObj.WeakSet = WeakSet; + } + catch (err) { } + try { + globalObj.Proxy = Proxy; + } + catch (err) { } + try { + globalObj.Reflect = Reflect; + } + catch (err) { } + try { + globalObj.decodeURI = decodeURI; + } + catch (err) { } + try { + globalObj.decodeURIComponent = decodeURIComponent; + } + catch (err) { } + try { + globalObj.encodeURI = encodeURI; + } + catch (err) { } + try { + globalObj.encodeURIComponent = encodeURIComponent; + } + catch (err) { } + try { + globalObj.escape = escape; + } + catch (err) { } + try { + globalObj.unescape = unescape; + } + catch (err) { } + try { + globalObj.eval = eval; + } + catch (err) { } + try { + globalObj.isFinite = isFinite; + } + catch (err) { } + try { + globalObj.isNaN = isNaN; + } + catch (err) { } + try { + globalObj.SharedArrayBuffer = SharedArrayBuffer; + } + catch (err) { } + try { + globalObj.Atomics = Atomics; + } + catch (err) { } + try { + globalObj.WebAssembly = WebAssembly; + } + catch (err) { } + try { + globalObj.clearInterval = clearInterval; + } + catch (err) { } + try { + globalObj.clearTimeout = clearTimeout; + } + catch (err) { } + try { + globalObj.setInterval = setInterval; + } + catch (err) { } + try { + globalObj.setTimeout = setTimeout; + } + catch (err) { } + try { + globalObj.crypto = crypto; + } + catch (err) { } + names = getOwnNames(globalObj); + } + } + if (globalObj.Symbol) { + !globalObj.Symbol.iterator && (globalObj.Symbol.iterator = createSymbol('iterator')); + !globalObj.Symbol.asyncIterator && (globalObj.Symbol.asyncIterator = createSymbol('asynciterator')); + } + const win = Object.create(null); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + try { + win[name] = globalObj[name]; + } + catch (err) { } + } + function createSandBox() { + return assign(Object.create(null), win); + } + function createSymbol(key) { + return key + Math.random().toString(36).substring(2); + } + function getAsyncIterator(obj) { + let iterator; + if (typeof Symbol === 'function') { + iterator = obj[Symbol.asyncIterator]; + !iterator && (iterator = obj[Symbol.iterator]); + } + if (iterator) { + return iterator.call(obj); + } + else if (typeof obj.next === 'function') { + return obj; + } + else { + let i = 0; + return { + next() { + if (obj && i >= obj.length) + obj = undefined; + return { value: obj && obj[i++], done: !obj }; + } + }; + } } - var version = "0.4.5"; + var version = "0.4.6"; - const AWAIT = { RES: undefined }; - const RETURN = { RES: undefined }; - const CONTINUE = createSymbol('continue'); - const BREAK = createSymbol('break'); - const SUPER = createSymbol('super'); - const SUPERCALL = createSymbol('supercall'); - const NOCTOR = createSymbol('noctor'); - const CLSCTOR = createSymbol('clsctor'); - const NEWTARGET = createSymbol('newtarget'); - const NOINIT = createSymbol('noinit'); + const AWAIT = { RES: undefined }; + const RETURN = { RES: undefined }; + const CONTINUE = createSymbol('continue'); + const BREAK = createSymbol('break'); + const SUPER = createSymbol('super'); + const SUPERCALL = createSymbol('supercall'); + const NOCTOR = createSymbol('noctor'); + const CLSCTOR = createSymbol('clsctor'); + const NEWTARGET = createSymbol('newtarget'); + const NOINIT = createSymbol('noinit'); const DEADZONE = createSymbol('deadzone'); - class Var { - constructor(kind, value) { - this.kind = kind; - this.value = value; - } - get() { - return this.value; - } - set(value) { - if (this.kind === 'const') { - throw new TypeError('Assignment to constant variable'); - } - else { - return this.value = value; - } - } - } - class Prop { - constructor(object, property) { - this.object = object; - this.property = property; - } - get() { - return this.object[this.property]; - } - set(value) { - this.object[this.property] = value; - return true; - } - del() { - return delete this.object[this.property]; - } + class Var { + constructor(kind, value) { + this.kind = kind; + this.value = value; + } + get() { + return this.value; + } + set(value) { + if (this.kind === 'const') { + throw new TypeError('Assignment to constant variable'); + } + else { + return this.value = value; + } + } + } + class Prop { + constructor(object, property) { + this.object = object; + this.property = property; + } + get() { + return this.object[this.property]; + } + set(value) { + this.object[this.property] = value; + return true; + } + del() { + return delete this.object[this.property]; + } } - class Scope { - constructor(parent = null, isolated = false) { - this.context = Object.create(null); - this.parent = parent; - this.isolated = isolated; - } - global() { - let scope = this; - while (scope.parent) { - scope = scope.parent; - } - return scope; - } - clone() { - const cloneScope = new Scope(this.parent, this.isolated); - for (const name in this.context) { - const variable = this.context[name]; - cloneScope[variable.kind](name, variable.get()); - } - return cloneScope; - } - find(name) { - if (this.context[name]) { - return this.context[name]; - } - else if (this.parent) { - return this.parent.find(name); - } - else { - const win = this.global().find('window').get(); - if (name in win) { - return new Prop(win, name); - } - else { - return null; - } - } - } - var(name, value) { - let scope = this; - while (scope.parent && !scope.isolated) { - scope = scope.parent; - } - const variable = scope.context[name]; - if (!variable) { - scope.context[name] = new Var('var', value === NOINIT ? undefined : value); - } - else { - if (variable.kind === 'var') { - if (value !== NOINIT) { - variable.set(value); - } - } - else { - throw new SyntaxError(`Identifier '${name}' has already been declared`); - } - } - if (!scope.parent) { - const win = scope.find('window').get(); - if (value !== NOINIT) { - define(win, name, { value, writable: true, enumerable: true }); - } - } - } - let(name, value) { - const variable = this.context[name]; - if (!variable || variable.get() === DEADZONE) { - this.context[name] = new Var('let', value); - } - else { - throw new SyntaxError(`Identifier '${name}' has already been declared`); - } - } - const(name, value) { - const variable = this.context[name]; - if (!variable || variable.get() === DEADZONE) { - this.context[name] = new Var('const', value); - } - else { - throw new SyntaxError(`Identifier '${name}' has already been declared`); - } - } - func(name, value) { - const variable = this.context[name]; - if (!variable || variable.kind === 'var') { - this.context[name] = new Var('var', value); - } - else { - throw new SyntaxError(`Identifier '${name}' has already been declared`); - } - } + class Scope { + constructor(parent = null, isolated = false) { + this.context = Object.create(null); + this.parent = parent; + this.isolated = isolated; + } + global() { + let scope = this; + while (scope.parent) { + scope = scope.parent; + } + return scope; + } + clone() { + const cloneScope = new Scope(this.parent, this.isolated); + for (const name in this.context) { + const variable = this.context[name]; + cloneScope[variable.kind](name, variable.get()); + } + return cloneScope; + } + find(name) { + if (this.context[name]) { + return this.context[name]; + } + else if (this.parent) { + return this.parent.find(name); + } + else { + const win = this.global().find('window').get(); + if (name in win) { + return new Prop(win, name); + } + else { + return null; + } + } + } + var(name, value) { + let scope = this; + while (scope.parent && !scope.isolated) { + scope = scope.parent; + } + const variable = scope.context[name]; + if (!variable) { + scope.context[name] = new Var('var', value === NOINIT ? undefined : value); + } + else { + if (variable.kind === 'var') { + if (value !== NOINIT) { + variable.set(value); + } + } + else { + throw new SyntaxError(`Identifier '${name}' has already been declared`); + } + } + if (!scope.parent) { + const win = scope.find('window').get(); + if (value !== NOINIT) { + define(win, name, { value, writable: true, enumerable: true }); + } + } + } + let(name, value) { + const variable = this.context[name]; + if (!variable || variable.get() === DEADZONE) { + this.context[name] = new Var('let', value); + } + else { + throw new SyntaxError(`Identifier '${name}' has already been declared`); + } + } + const(name, value) { + const variable = this.context[name]; + if (!variable || variable.get() === DEADZONE) { + this.context[name] = new Var('const', value); + } + else { + throw new SyntaxError(`Identifier '${name}' has already been declared`); + } + } + func(name, value) { + const variable = this.context[name]; + if (!variable || variable.kind === 'var') { + this.context[name] = new Var('var', value); + } + else { + throw new SyntaxError(`Identifier '${name}' has already been declared`); + } + } } - function Identifier(node, scope, options = {}) { - const { getVar = false, throwErr = true } = options; - if (node.name === 'undefined') { - return undefined; - } - const variable = scope.find(node.name); - if (variable) { - if (getVar) { - return variable; - } - else { - const value = variable.get(); - if (value === DEADZONE) { - throw new ReferenceError(`${node.name} is not defined`); - } - else { - return value; - } - } - } - else if (throwErr) { - throw new ReferenceError(`${node.name} is not defined`); - } - else { - return undefined; - } + function Identifier(node, scope, options = {}) { + const { getVar = false, throwErr = true } = options; + if (node.name === 'undefined') { + return undefined; + } + const variable = scope.find(node.name); + if (variable) { + if (getVar) { + return variable; + } + else { + const value = variable.get(); + if (value === DEADZONE) { + throw new ReferenceError(`${node.name} is not defined`); + } + else { + return value; + } + } + } + else if (throwErr) { + throw new ReferenceError(`${node.name} is not defined`); + } + else { + return undefined; + } } var identifier = /*#__PURE__*/Object.freeze({ Identifier: Identifier }); - function Literal(node, scope) { - return node.value; + function Literal(node, scope) { + return node.value; } var literal = /*#__PURE__*/Object.freeze({ Literal: Literal }); - function ThisExpression(node, scope) { - const superCall = scope.find(SUPERCALL); - if (superCall && !superCall.get()) { - throw new ReferenceError('Must call super constructor in derived class' - + 'before accessing \'this\' or returning from derived constructor'); - } - else { - return scope.find('this').get(); - } - } - function ArrayExpression(node, scope) { - let results = []; - for (let i = 0; i < node.elements.length; i++) { - const item = node.elements[i]; - if (item.type === 'SpreadElement') { - results = results.concat(SpreadElement(item, scope)); - } - else { - results.push(evaluate(item, scope)); - } - } - return results; - } - function ObjectExpression(node, scope) { - const object = {}; - for (let i = 0; i < node.properties.length; i++) { - const property = node.properties[i]; - if (property.type === 'SpreadElement') { - assign(object, SpreadElement(property, scope)); - } - else { - let key; - const propKey = property.key; - if (property.computed) { - key = evaluate(propKey, scope); - } - else { - if (propKey.type === 'Identifier') { - key = propKey.name; - } - else { - key = '' + (Literal(propKey, scope)); - } - } - const value = evaluate(property.value, scope); - const propKind = property.kind; - if (propKind === 'init') { - object[key] = value; - } - else if (propKind === 'get') { - define(object, key, { get: value }); - } - else { - define(object, key, { set: value }); - } - } - } - return object; - } - function FunctionExpression(node, scope) { - if (node.id && node.id.name) { - const tmpScope = new Scope(scope); - const func = createFunc$1(node, tmpScope); - tmpScope.const(node.id.name, func); - return func; - } - else { - return createFunc$1(node, scope); - } - } - function UnaryExpression(node, scope) { - const arg = node.argument; - switch (node.operator) { - case '+': return +(evaluate(arg, scope)); - case '-': return -(evaluate(arg, scope)); - case '!': return !(evaluate(arg, scope)); - case '~': return ~(evaluate(arg, scope)); - case 'void': return void (evaluate(arg, scope)); - case 'typeof': - if (arg.type === 'Identifier') { - return typeof (Identifier(arg, scope, { throwErr: false })); - } - else { - return typeof (evaluate(arg, scope)); - } - case 'delete': - if (arg.type === 'MemberExpression') { - const variable = MemberExpression(arg, scope, { getVar: true }); - return variable.del(); - } - else if (arg.type === 'Identifier') { - const win = scope.global().find('window').get(); - return delete win[arg.name]; - } - else { - throw new SyntaxError('Unexpected token'); - } - default: throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function UpdateExpression(node, scope) { - const arg = node.argument; - let variable; - if (arg.type === 'Identifier') { - variable = Identifier(arg, scope, { getVar: true }); - } - else if (arg.type === 'MemberExpression') { - variable = MemberExpression(arg, scope, { getVar: true }); - } - else { - throw new SyntaxError('Unexpected token'); - } - const value = variable.get(); - if (node.operator === '++') { - variable.set(value + 1); - return node.prefix ? variable.get() : value; - } - else if (node.operator === '--') { - variable.set(value - 1); - return node.prefix ? variable.get() : value; - } - else { - throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function BinaryExpression(node, scope) { - const left = evaluate(node.left, scope); - const right = evaluate(node.right, scope); - switch (node.operator) { - case '==': return left == right; - case '!=': return left != right; - case '===': return left === right; - case '!==': return left !== right; - case '<': return left < right; - case '<=': return left <= right; - case '>': return left > right; - case '>=': return left >= right; - case '<<': return left << right; - case '>>': return left >> right; - case '>>>': return left >>> right; - case '+': return left + right; - case '-': return left - right; - case '*': return left * right; - case '**': return Math.pow(left, right); - case '/': return left / right; - case '%': return left % right; - case '|': return left | right; - case '^': return left ^ right; - case '&': return left & right; - case 'in': return left in right; - case 'instanceof': return left instanceof right; - default: throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function AssignmentExpression(node, scope) { - const value = evaluate(node.right, scope); - const left = node.left; - let variable; - if (left.type === 'Identifier') { - variable = Identifier(left, scope, { getVar: true, throwErr: false }); - if (!variable) { - const win = scope.global().find('window').get(); - variable = new Prop(win, left.name); - } - } - else if (left.type === 'MemberExpression') { - variable = MemberExpression(left, scope, { getVar: true }); - } - else { - return pattern$3(left, scope, { feed: value }); - } - switch (node.operator) { - case '=': - variable.set(value); - return variable.get(); - case '+=': - variable.set(variable.get() + value); - return variable.get(); - case '-=': - variable.set(variable.get() - value); - return variable.get(); - case '*=': - variable.set(variable.get() * value); - return variable.get(); - case '/=': - variable.set(variable.get() / value); - return variable.get(); - case '%=': - variable.set(variable.get() % value); - return variable.get(); - case '**=': - variable.set(Math.pow(variable.get(), value)); - return variable.get(); - case '<<=': - variable.set(variable.get() << value); - return variable.get(); - case '>>=': - variable.set(variable.get() >> value); - return variable.get(); - case '>>>=': - variable.set(variable.get() >>> value); - return variable.get(); - case '|=': - variable.set(variable.get() | value); - return variable.get(); - case '^=': - variable.set(variable.get() ^ value); - return variable.get(); - case '&=': - variable.set(variable.get() & value); - return variable.get(); - default: throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function LogicalExpression(node, scope) { - switch (node.operator) { - case '||': - return (evaluate(node.left, scope)) || (evaluate(node.right, scope)); - case '&&': - return (evaluate(node.left, scope)) && (evaluate(node.right, scope)); - default: - throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function MemberExpression(node, scope, options = {}) { - const { getObj = false, getVar = false } = options; - let object; - if (node.object.type === 'Super') { - object = Super(node.object, scope, { getProto: true }); - } - else { - object = evaluate(node.object, scope); - } - if (getObj) - return object; - let key; - if (node.computed) { - key = evaluate(node.property, scope); - } - else { - key = node.property.name; - } - if (getVar) { - const setter = getSetter(object, key); - if (node.object.type === 'Super' && setter) { - const thisObject = scope.find('this').get(); - const privateKey = createSymbol(key); - define(thisObject, privateKey, { set: setter }); - return new Prop(thisObject, privateKey); - } - else { - return new Prop(object, key); - } - } - else { - const getter = getGetter(object, key); - if (node.object.type === 'Super' && getter) { - const thisObject = scope.find('this').get(); - return getter.call(thisObject); - } - else { - return object[key]; - } - } - } - function ConditionalExpression(node, scope) { - return (evaluate(node.test, scope)) - ? (evaluate(node.consequent, scope)) - : (evaluate(node.alternate, scope)); - } - function CallExpression(node, scope) { - let func; - let object; - if (node.callee.type === 'MemberExpression') { - object = MemberExpression(node.callee, scope, { getObj: true }); - let key; - if (node.callee.computed) { - key = evaluate(node.callee.property, scope); - } - else { - key = node.callee.property.name; - } - const getter = getGetter(object, key); - if (node.callee.object.type === 'Super' && getter) { - const thisObject = scope.find('this').get(); - func = getter.call(thisObject); - } - else { - func = object[key]; - } - if (typeof func !== 'function') { - throw new TypeError(`${key} is not a function`); - } - else if (func[CLSCTOR]) { - throw new TypeError(`Class constructor ${key} cannot be invoked without 'new'`); - } - } - else { - object = scope.find('this').get(); - func = evaluate(node.callee, scope); - if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { - let name; - if (node.callee.type === 'Identifier') { - name = node.callee.name; - } - else { - try { - name = JSON.stringify(func); - } - catch (err) { - name = '' + func; - } - } - if (typeof func !== 'function') { - throw new TypeError(`${name} is not a function`); - } - else { - throw new TypeError(`Class constructor ${name} cannot be invoked without 'new'`); - } - } - } - let args = []; - for (let i = 0; i < node.arguments.length; i++) { - const arg = node.arguments[i]; - if (arg.type === 'SpreadElement') { - args = args.concat(SpreadElement(arg, scope)); - } - else { - args.push(evaluate(arg, scope)); - } - } - if (node.callee.type === 'Super') { - const superCall = scope.find(SUPERCALL); - if (superCall.get()) { - throw new ReferenceError('Super constructor may only be called once'); - } - else { - scope.find(SUPERCALL).set(true); - } - } - return func.apply(object, args); - } - function NewExpression(node, scope) { - const constructor = evaluate(node.callee, scope); - if (typeof constructor !== 'function') { - let name; - if (node.callee.type === 'Identifier') { - name = node.callee.name; - } - else { - try { - name = JSON.stringify(constructor); - } - catch (err) { - name = '' + constructor; - } - } - throw new TypeError(`${name} is not a constructor`); - } - else if (constructor[NOCTOR]) { - throw new TypeError(`${constructor.name || '(intermediate value)'} is not a constructor`); - } - let args = []; - for (let i = 0; i < node.arguments.length; i++) { - const arg = node.arguments[i]; - if (arg.type === 'SpreadElement') { - args = args.concat(SpreadElement(arg, scope)); - } - else { - args.push(evaluate(arg, scope)); - } - } - return new constructor(...args); - } - function MetaProperty(node, scope) { - return scope.find(NEWTARGET).get(); - } - function SequenceExpression(node, scope) { - let result; - for (let i = 0; i < node.expressions.length; i++) { - result = evaluate(node.expressions[i], scope); - } - return result; - } - function ArrowFunctionExpression(node, scope) { - return createFunc$1(node, scope); - } - function TemplateLiteral(node, scope) { - const quasis = node.quasis; - const expressions = node.expressions; - let result = ''; - let temEl; - let expr; - while (temEl = quasis.shift()) { - result += TemplateElement(temEl, scope); - expr = expressions.shift(); - if (expr) { - result += evaluate(expr, scope); - } - } - return result; - } - function TaggedTemplateExpression(node, scope) { - const tagFunc = evaluate(node.tag, scope); - const quasis = node.quasi.quasis; - const str = quasis.map(v => v.value.cooked); - const raw = quasis.map(v => v.value.raw); - define(str, 'raw', { - value: freeze(raw) - }); - const expressions = node.quasi.expressions; - const args = []; - if (expressions) { - for (let i = 0; i < expressions.length; i++) { - args.push(evaluate(expressions[i], scope)); - } - } - return tagFunc(freeze(str), ...args); - } - function TemplateElement(node, scope) { - return node.value.raw; - } - function ClassExpression(node, scope) { - if (node.id && node.id.name) { - const tmpScope = new Scope(scope); - const klass = createClass$1(node, tmpScope); - tmpScope.const(node.id.name, klass); - return klass; - } - else { - return createClass$1(node, scope); - } - } - function Super(node, scope, options = {}) { - const { getProto = false } = options; - const superClass = scope.find(SUPER).get(); - return getProto ? superClass.prototype : superClass; - } - function SpreadElement(node, scope) { - return evaluate(node.argument, scope); + function ThisExpression(node, scope) { + const superCall = scope.find(SUPERCALL); + if (superCall && !superCall.get()) { + throw new ReferenceError('Must call super constructor in derived class ' + + 'before accessing \'this\' or returning from derived constructor'); + } + else { + return scope.find('this').get(); + } + } + function ArrayExpression(node, scope) { + let results = []; + for (let i = 0; i < node.elements.length; i++) { + const item = node.elements[i]; + if (item.type === 'SpreadElement') { + results = results.concat(SpreadElement(item, scope)); + } + else { + results.push(evaluate(item, scope)); + } + } + return results; + } + function ObjectExpression(node, scope) { + const object = {}; + for (let i = 0; i < node.properties.length; i++) { + const property = node.properties[i]; + if (property.type === 'SpreadElement') { + assign(object, SpreadElement(property, scope)); + } + else { + let key; + const propKey = property.key; + if (property.computed) { + key = evaluate(propKey, scope); + } + else { + if (propKey.type === 'Identifier') { + key = propKey.name; + } + else { + key = '' + (Literal(propKey)); + } + } + const value = evaluate(property.value, scope); + const propKind = property.kind; + if (propKind === 'init') { + object[key] = value; + } + else if (propKind === 'get') { + const oriDptor = getDptor(object, key); + define(object, key, { + get: value, + set: oriDptor && oriDptor.set, + enumerable: true, + configurable: true + }); + } + else { + const oriDptor = getDptor(object, key); + define(object, key, { + get: oriDptor && oriDptor.get, + set: value, + enumerable: true, + configurable: true + }); + } + } + } + return object; + } + function FunctionExpression(node, scope) { + if (node.id && node.id.name) { + const tmpScope = new Scope(scope); + const func = createFunc$1(node, tmpScope); + tmpScope.const(node.id.name, func); + return func; + } + else { + return createFunc$1(node, scope); + } + } + function UnaryExpression(node, scope) { + const arg = node.argument; + switch (node.operator) { + case '+': return +(evaluate(arg, scope)); + case '-': return -(evaluate(arg, scope)); + case '!': return !(evaluate(arg, scope)); + case '~': return ~(evaluate(arg, scope)); + case 'void': return void (evaluate(arg, scope)); + case 'typeof': + if (arg.type === 'Identifier') { + return typeof (Identifier(arg, scope, { throwErr: false })); + } + else { + return typeof (evaluate(arg, scope)); + } + case 'delete': + if (arg.type === 'MemberExpression') { + const variable = MemberExpression(arg, scope, { getVar: true }); + return variable.del(); + } + else if (arg.type === 'Identifier') { + throw new SyntaxError('Delete of an unqualified identifier in strict mode'); + } + else { + evaluate(arg, scope); + return true; + } + default: throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function UpdateExpression(node, scope) { + const arg = node.argument; + let variable; + if (arg.type === 'Identifier') { + variable = Identifier(arg, scope, { getVar: true }); + } + else if (arg.type === 'MemberExpression') { + variable = MemberExpression(arg, scope, { getVar: true }); + } + else { + throw new SyntaxError('Unexpected token'); + } + const value = variable.get(); + if (node.operator === '++') { + variable.set(value + 1); + return node.prefix ? variable.get() : value; + } + else if (node.operator === '--') { + variable.set(value - 1); + return node.prefix ? variable.get() : value; + } + else { + throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function BinaryExpression(node, scope) { + const left = evaluate(node.left, scope); + const right = evaluate(node.right, scope); + switch (node.operator) { + case '==': return left == right; + case '!=': return left != right; + case '===': return left === right; + case '!==': return left !== right; + case '<': return left < right; + case '<=': return left <= right; + case '>': return left > right; + case '>=': return left >= right; + case '<<': return left << right; + case '>>': return left >> right; + case '>>>': return left >>> right; + case '+': return left + right; + case '-': return left - right; + case '*': return left * right; + case '**': return Math.pow(left, right); + case '/': return left / right; + case '%': return left % right; + case '|': return left | right; + case '^': return left ^ right; + case '&': return left & right; + case 'in': return left in right; + case 'instanceof': return left instanceof right; + default: throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function AssignmentExpression(node, scope) { + const value = evaluate(node.right, scope); + const left = node.left; + let variable; + if (left.type === 'Identifier') { + variable = Identifier(left, scope, { getVar: true, throwErr: false }); + if (!variable) { + const win = scope.global().find('window').get(); + variable = new Prop(win, left.name); + } + } + else if (left.type === 'MemberExpression') { + variable = MemberExpression(left, scope, { getVar: true }); + } + else { + return pattern$3(left, scope, { feed: value }); + } + switch (node.operator) { + case '=': + variable.set(value); + return variable.get(); + case '+=': + variable.set(variable.get() + value); + return variable.get(); + case '-=': + variable.set(variable.get() - value); + return variable.get(); + case '*=': + variable.set(variable.get() * value); + return variable.get(); + case '/=': + variable.set(variable.get() / value); + return variable.get(); + case '%=': + variable.set(variable.get() % value); + return variable.get(); + case '**=': + variable.set(Math.pow(variable.get(), value)); + return variable.get(); + case '<<=': + variable.set(variable.get() << value); + return variable.get(); + case '>>=': + variable.set(variable.get() >> value); + return variable.get(); + case '>>>=': + variable.set(variable.get() >>> value); + return variable.get(); + case '|=': + variable.set(variable.get() | value); + return variable.get(); + case '^=': + variable.set(variable.get() ^ value); + return variable.get(); + case '&=': + variable.set(variable.get() & value); + return variable.get(); + default: throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function LogicalExpression(node, scope) { + switch (node.operator) { + case '||': + return (evaluate(node.left, scope)) || (evaluate(node.right, scope)); + case '&&': + return (evaluate(node.left, scope)) && (evaluate(node.right, scope)); + default: + throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function MemberExpression(node, scope, options = {}) { + const { getObj = false, getVar = false } = options; + let object; + if (node.object.type === 'Super') { + object = Super(node.object, scope, { getProto: true }); + } + else { + object = evaluate(node.object, scope); + } + if (getObj) + return object; + let key; + if (node.computed) { + key = evaluate(node.property, scope); + } + else { + key = node.property.name; + } + if (getVar) { + const setter = getSetter(object, key); + if (node.object.type === 'Super' && setter) { + const thisObject = scope.find('this').get(); + const privateKey = createSymbol(key); + define(thisObject, privateKey, { set: setter }); + return new Prop(thisObject, privateKey); + } + else { + return new Prop(object, key); + } + } + else { + const getter = getGetter(object, key); + if (node.object.type === 'Super' && getter) { + const thisObject = scope.find('this').get(); + return getter.call(thisObject); + } + else { + return object[key]; + } + } + } + function ConditionalExpression(node, scope) { + return (evaluate(node.test, scope)) + ? (evaluate(node.consequent, scope)) + : (evaluate(node.alternate, scope)); + } + function CallExpression(node, scope) { + let func; + let object; + if (node.callee.type === 'MemberExpression') { + object = MemberExpression(node.callee, scope, { getObj: true }); + let key; + if (node.callee.computed) { + key = evaluate(node.callee.property, scope); + } + else { + key = node.callee.property.name; + } + if (node.callee.object.type === 'Super') { + const thisObject = scope.find('this').get(); + func = object[key].bind(thisObject); + } + else { + func = object[key]; + } + if (typeof func !== 'function') { + throw new TypeError(`${key} is not a function`); + } + else if (func[CLSCTOR]) { + throw new TypeError(`Class constructor ${key} cannot be invoked without 'new'`); + } + } + else { + object = scope.find('this').get(); + func = evaluate(node.callee, scope); + if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { + let name; + if (node.callee.type === 'Identifier') { + name = node.callee.name; + } + else { + try { + name = JSON.stringify(func); + } + catch (err) { + name = '' + func; + } + } + if (typeof func !== 'function') { + throw new TypeError(`${name} is not a function`); + } + else { + throw new TypeError(`Class constructor ${name} cannot be invoked without 'new'`); + } + } + } + let args = []; + for (let i = 0; i < node.arguments.length; i++) { + const arg = node.arguments[i]; + if (arg.type === 'SpreadElement') { + args = args.concat(SpreadElement(arg, scope)); + } + else { + args.push(evaluate(arg, scope)); + } + } + if (node.callee.type === 'Super') { + const superCall = scope.find(SUPERCALL); + if (superCall.get()) { + throw new ReferenceError('Super constructor may only be called once'); + } + else { + scope.find(SUPERCALL).set(true); + } + } + return func.apply(object, args); + } + function NewExpression(node, scope) { + const constructor = evaluate(node.callee, scope); + if (typeof constructor !== 'function') { + let name; + if (node.callee.type === 'Identifier') { + name = node.callee.name; + } + else { + try { + name = JSON.stringify(constructor); + } + catch (err) { + name = '' + constructor; + } + } + throw new TypeError(`${name} is not a constructor`); + } + else if (constructor[NOCTOR]) { + throw new TypeError(`${constructor.name || '(intermediate value)'} is not a constructor`); + } + let args = []; + for (let i = 0; i < node.arguments.length; i++) { + const arg = node.arguments[i]; + if (arg.type === 'SpreadElement') { + args = args.concat(SpreadElement(arg, scope)); + } + else { + args.push(evaluate(arg, scope)); + } + } + return new constructor(...args); + } + function MetaProperty(node, scope) { + return scope.find(NEWTARGET).get(); + } + function SequenceExpression(node, scope) { + let result; + for (let i = 0; i < node.expressions.length; i++) { + result = evaluate(node.expressions[i], scope); + } + return result; + } + function ArrowFunctionExpression(node, scope) { + return createFunc$1(node, scope); + } + function TemplateLiteral(node, scope) { + const quasis = node.quasis; + const expressions = node.expressions; + let result = ''; + let temEl; + let expr; + while (temEl = quasis.shift()) { + result += TemplateElement(temEl); + expr = expressions.shift(); + if (expr) { + result += evaluate(expr, scope); + } + } + return result; + } + function TaggedTemplateExpression(node, scope) { + const tagFunc = evaluate(node.tag, scope); + const quasis = node.quasi.quasis; + const str = quasis.map(v => v.value.cooked); + const raw = quasis.map(v => v.value.raw); + define(str, 'raw', { + value: freeze(raw) + }); + const expressions = node.quasi.expressions; + const args = []; + if (expressions) { + for (let i = 0; i < expressions.length; i++) { + args.push(evaluate(expressions[i], scope)); + } + } + return tagFunc(freeze(str), ...args); + } + function TemplateElement(node, scope) { + return node.value.raw; + } + function ClassExpression(node, scope) { + if (node.id && node.id.name) { + const tmpScope = new Scope(scope); + const klass = createClass$1(node, tmpScope); + tmpScope.const(node.id.name, klass); + return klass; + } + else { + return createClass$1(node, scope); + } + } + function Super(node, scope, options = {}) { + const { getProto = false } = options; + const superClass = scope.find(SUPER).get(); + return getProto ? superClass.prototype : superClass; + } + function SpreadElement(node, scope) { + return evaluate(node.argument, scope); } var expression = /*#__PURE__*/Object.freeze({ @@ -1028,187 +1039,187 @@ SpreadElement: SpreadElement }); - function ExpressionStatement(node, scope) { - evaluate(node.expression, scope); - } - function BlockStatement(block, scope, options = {}) { - const { invasived = false, hoisted = false, } = options; - const subScope = invasived ? scope : new Scope(scope); - if (!hoisted) { - hoist$1(block, subScope, { onlyBlock: true }); - } - for (let i = 0; i < block.body.length; i++) { - const result = evaluate(block.body[i], subScope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - function EmptyStatement() { - } - function DebuggerStatement() { - debugger; - } - function ReturnStatement(node, scope) { - RETURN.RES = node.argument ? (evaluate(node.argument, scope)) : undefined; - return RETURN; - } - function BreakStatement() { - return BREAK; - } - function ContinueStatement() { - return CONTINUE; - } - function IfStatement(node, scope) { - if (evaluate(node.test, scope)) { - return evaluate(node.consequent, scope); - } - else { - return evaluate(node.alternate, scope); - } - } - function SwitchStatement(node, scope) { - const discriminant = evaluate(node.discriminant, scope); - let matched = false; - for (let i = 0; i < node.cases.length; i++) { - const eachCase = node.cases[i]; - if (!matched - && (!eachCase.test - || (evaluate(eachCase.test, scope)) === discriminant)) { - matched = true; - } - if (matched) { - const result = SwitchCase(eachCase, scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - } - function SwitchCase(node, scope) { - for (let i = 0; i < node.consequent.length; i++) { - const result = evaluate(node.consequent[i], scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - function ThrowStatement(node, scope) { - throw evaluate(node.argument, scope); - } - function TryStatement(node, scope) { - try { - return BlockStatement(node.block, scope); - } - catch (err) { - if (node.handler) { - const subScope = new Scope(scope); - const param = node.handler.param; - if (param) { - if (param.type === 'Identifier') { - const name = param.name; - subScope.let(name, err); - } - else { - pattern$3(param, scope, { feed: err }); - } - } - return CatchClause(node.handler, subScope); - } - else { - throw err; - } - } - finally { - if (node.finalizer) { - const result = BlockStatement(node.finalizer, scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - } - function CatchClause(node, scope) { - return BlockStatement(node.body, scope, { invasived: true }); - } - function WhileStatement(node, scope) { - while (evaluate(node.test, scope)) { - const result = evaluate(node.body, scope); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function DoWhileStatement(node, scope) { - do { - const result = evaluate(node.body, scope); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } while (evaluate(node.test, scope)); - } - function ForStatement(node, scope) { - const forScope = new Scope(scope); - for (evaluate(node.init, forScope); node.test ? (evaluate(node.test, forScope)) : true; evaluate(node.update, forScope)) { - const subScope = new Scope(forScope); - let result; - if (node.body.type === 'BlockStatement') { - result = BlockStatement(node.body, subScope, { invasived: true }); - } - else { - result = evaluate(node.body, subScope); - } - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function ForInStatement(node, scope) { - for (const value in evaluate(node.right, scope)) { - const result = ForXHandler$1(node, scope, { value }); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function ForOfStatement(node, scope) { - const right = evaluate(node.right, scope); - for (const value of right) { - const result = ForXHandler$1(node, scope, { value }); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } + function ExpressionStatement(node, scope) { + evaluate(node.expression, scope); + } + function BlockStatement(block, scope, options = {}) { + const { invasived = false, hoisted = false, } = options; + const subScope = invasived ? scope : new Scope(scope); + if (!hoisted) { + hoist$1(block, subScope, { onlyBlock: true }); + } + for (let i = 0; i < block.body.length; i++) { + const result = evaluate(block.body[i], subScope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + function EmptyStatement() { + } + function DebuggerStatement() { + debugger; + } + function ReturnStatement(node, scope) { + RETURN.RES = node.argument ? (evaluate(node.argument, scope)) : undefined; + return RETURN; + } + function BreakStatement() { + return BREAK; + } + function ContinueStatement() { + return CONTINUE; + } + function IfStatement(node, scope) { + if (evaluate(node.test, scope)) { + return evaluate(node.consequent, scope); + } + else { + return evaluate(node.alternate, scope); + } + } + function SwitchStatement(node, scope) { + const discriminant = evaluate(node.discriminant, scope); + let matched = false; + for (let i = 0; i < node.cases.length; i++) { + const eachCase = node.cases[i]; + if (!matched + && (!eachCase.test + || (evaluate(eachCase.test, scope)) === discriminant)) { + matched = true; + } + if (matched) { + const result = SwitchCase(eachCase, scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + } + function SwitchCase(node, scope) { + for (let i = 0; i < node.consequent.length; i++) { + const result = evaluate(node.consequent[i], scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + function ThrowStatement(node, scope) { + throw evaluate(node.argument, scope); + } + function TryStatement(node, scope) { + try { + return BlockStatement(node.block, scope); + } + catch (err) { + if (node.handler) { + const subScope = new Scope(scope); + const param = node.handler.param; + if (param) { + if (param.type === 'Identifier') { + const name = param.name; + subScope.let(name, err); + } + else { + pattern$3(param, scope, { feed: err }); + } + } + return CatchClause(node.handler, subScope); + } + else { + throw err; + } + } + finally { + if (node.finalizer) { + const result = BlockStatement(node.finalizer, scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + } + function CatchClause(node, scope) { + return BlockStatement(node.body, scope, { invasived: true }); + } + function WhileStatement(node, scope) { + while (evaluate(node.test, scope)) { + const result = evaluate(node.body, scope); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function DoWhileStatement(node, scope) { + do { + const result = evaluate(node.body, scope); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } while (evaluate(node.test, scope)); + } + function ForStatement(node, scope) { + const forScope = new Scope(scope); + for (evaluate(node.init, forScope); node.test ? (evaluate(node.test, forScope)) : true; evaluate(node.update, forScope)) { + const subScope = new Scope(forScope); + let result; + if (node.body.type === 'BlockStatement') { + result = BlockStatement(node.body, subScope, { invasived: true }); + } + else { + result = evaluate(node.body, subScope); + } + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function ForInStatement(node, scope) { + for (const value in evaluate(node.right, scope)) { + const result = ForXHandler$1(node, scope, { value }); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function ForOfStatement(node, scope) { + const right = evaluate(node.right, scope); + for (const value of right) { + const result = ForXHandler$1(node, scope, { value }); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } } var statement = /*#__PURE__*/Object.freeze({ @@ -1232,135 +1243,135 @@ ForOfStatement: ForOfStatement }); - function ObjectPattern(node, scope, options = {}) { - const { kind = 'let', hoist = false, onlyBlock = false, feed = {} } = options; - const fedKeys = []; - for (let i = 0; i < node.properties.length; i++) { - const property = node.properties[i]; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (property.type === 'Property') { - const value = property.value; - if (value.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(value, scope, { kind, hoist, onlyBlock }); - } - } - else { - RestElement(property, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (property.type === 'Property') { - let key; - if (property.computed) { - key = evaluate(property.key, scope); - } - else { - key = property.key.name; - } - fedKeys.push(key); - const value = property.value; - if (value.type === 'Identifier') { - scope[kind](value.name, feed[key]); - } - else { - pattern$3(value, scope, { kind, feed: feed[key] }); - } - } - else { - const rest = assign({}, feed); - for (let i = 0; i < fedKeys.length; i++) - delete rest[fedKeys[i]]; - RestElement(property, scope, { kind, feed: rest }); - } - } - } - function ArrayPattern(node, scope, options = {}) { - const { kind, hoist = false, onlyBlock = false, feed = [] } = options; - const result = []; - for (let i = 0; i < node.elements.length; i++) { - const element = node.elements[i]; - if (!element) - continue; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (element.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(element, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (element.type === 'Identifier') { - if (kind) { - scope[kind](element.name, feed[i]); - } - else { - const variable = Identifier(element, scope, { getVar: true }); - variable.set(feed[i]); - result.push(variable.get()); - } - } - else if (element.type === 'RestElement') { - RestElement(element, scope, { kind, feed: feed.slice(i) }); - } - else { - pattern$3(element, scope, { kind, feed: feed[i] }); - } - } - if (result.length) { - return result; - } - } - function RestElement(node, scope, options = {}) { - const { kind, hoist = false, onlyBlock = false, feed = [] } = options; - const arg = node.argument; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (arg.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(arg, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (arg.type === 'Identifier') { - if (kind) { - scope[kind](arg.name, feed); - } - else { - const variable = Identifier(arg, scope, { getVar: true }); - variable.set(feed); - } - } - else { - pattern$3(arg, scope, { kind, feed }); - } - } - function AssignmentPattern(node, scope, options = {}) { - const { kind = 'let', hoist = false, onlyBlock = false, feed = evaluate(node.right, scope) } = options; - const left = node.left; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (left.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(left, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (left.type === 'Identifier') { - scope[kind](left.name, feed); - } - else { - pattern$3(left, scope, { kind, feed }); - } + function ObjectPattern(node, scope, options = {}) { + const { kind = 'let', hoist = false, onlyBlock = false, feed = {} } = options; + const fedKeys = []; + for (let i = 0; i < node.properties.length; i++) { + const property = node.properties[i]; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (property.type === 'Property') { + const value = property.value; + if (value.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(value, scope, { kind, hoist, onlyBlock }); + } + } + else { + RestElement(property, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (property.type === 'Property') { + let key; + if (property.computed) { + key = evaluate(property.key, scope); + } + else { + key = property.key.name; + } + fedKeys.push(key); + const value = property.value; + if (value.type === 'Identifier') { + scope[kind](value.name, feed[key]); + } + else { + pattern$3(value, scope, { kind, feed: feed[key] }); + } + } + else { + const rest = assign({}, feed); + for (let i = 0; i < fedKeys.length; i++) + delete rest[fedKeys[i]]; + RestElement(property, scope, { kind, feed: rest }); + } + } + } + function ArrayPattern(node, scope, options = {}) { + const { kind, hoist = false, onlyBlock = false, feed = [] } = options; + const result = []; + for (let i = 0; i < node.elements.length; i++) { + const element = node.elements[i]; + if (!element) + continue; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (element.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(element, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (element.type === 'Identifier') { + if (kind) { + scope[kind](element.name, feed[i]); + } + else { + const variable = Identifier(element, scope, { getVar: true }); + variable.set(feed[i]); + result.push(variable.get()); + } + } + else if (element.type === 'RestElement') { + RestElement(element, scope, { kind, feed: feed.slice(i) }); + } + else { + pattern$3(element, scope, { kind, feed: feed[i] }); + } + } + if (result.length) { + return result; + } + } + function RestElement(node, scope, options = {}) { + const { kind, hoist = false, onlyBlock = false, feed = [] } = options; + const arg = node.argument; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (arg.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(arg, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (arg.type === 'Identifier') { + if (kind) { + scope[kind](arg.name, feed); + } + else { + const variable = Identifier(arg, scope, { getVar: true }); + variable.set(feed); + } + } + else { + pattern$3(arg, scope, { kind, feed }); + } + } + function AssignmentPattern(node, scope, options = {}) { + const { kind = 'let', hoist = false, onlyBlock = false, feed = evaluate(node.right, scope) } = options; + const left = node.left; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (left.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(left, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (left.type === 'Identifier') { + scope[kind](left.name, feed); + } + else { + pattern$3(left, scope, { kind, feed }); + } } var pattern = /*#__PURE__*/Object.freeze({ @@ -1370,622 +1381,633 @@ AssignmentPattern: AssignmentPattern }); - function Program(program, scope) { - for (let i = 0; i < program.body.length; i++) { - evaluate(program.body[i], scope); - } + function Program(program, scope) { + for (let i = 0; i < program.body.length; i++) { + evaluate(program.body[i], scope); + } } var program = /*#__PURE__*/Object.freeze({ Program: Program }); - let evaluateOps; - function evaluate(node, scope) { - if (!node) - return; - if (!evaluateOps) { - evaluateOps = assign({}, declaration, expression, identifier, statement, literal, pattern, program); - } - const handler = evaluateOps[node.type]; - if (handler) { - return handler(node, scope); - } - else { - throw new Error(`${node.type} isn't implemented`); - } + let evaluateOps; + function evaluate(node, scope) { + if (!node) + return; + if (!evaluateOps) { + evaluateOps = assign({}, declaration, expression, identifier, statement, literal, pattern, program); + } + const handler = evaluateOps[node.type]; + if (handler) { + return handler(node, scope); + } + else { + throw new Error(`${node.type} isn't implemented`); + } } - function FunctionDeclaration(node, scope) { - scope.func(node.id.name, createFunc$1(node, scope)); - } - function VariableDeclaration(node, scope, options = {}) { - for (let i = 0; i < node.declarations.length; i++) { - VariableDeclarator(node.declarations[i], scope, assign({ kind: node.kind }, options)); - } - } - function VariableDeclarator(node, scope, options = {}) { - const { kind = 'let', hoist = false, onlyBlock = false, feed } = options; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (node.id.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(node.id, scope, { kind, hoist, onlyBlock }); - } - } - } - else { - const hasFeed = 'feed' in options; - const value = hasFeed ? feed : evaluate(node.init, scope); - if (node.id.type === 'Identifier') { - const name = node.id.name; - if (kind === 'var' && !node.init && !hasFeed) { - scope.var(name, NOINIT); - } - else { - scope[kind](name, value); - } - if (node.init - && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] - .indexOf(node.init.type) !== -1 - && !value.name) { - define(value, 'name', { - value: name, - configurable: true - }); - } - } - else { - pattern$3(node.id, scope, { kind, feed: value }); - } - } - } - function ClassDeclaration(node, scope) { - scope.func(node.id.name, createClass$1(node, scope)); - } - function ClassBody(node, scope, options = {}) { - const { klass, superClass } = options; - for (let i = 0; i < node.body.length; i++) { - MethodDefinition(node.body[i], scope, { klass, superClass }); - } - } - function MethodDefinition(node, scope, options = {}) { - const { klass, superClass } = options; - let key; - if (node.computed) { - key = evaluate(node.key, scope); - } - else if (node.key.type === 'Identifier') { - key = node.key.name; - } - else { - throw new SyntaxError('Unexpected token'); - } - const obj = node.static ? klass : klass.prototype; - const value = createFunc$1(node.value, scope, { superClass }); - switch (node.kind) { - case 'constructor': - break; - case 'method': - define(obj, key, { - value, - writable: true, - configurable: true, - }); - break; - case 'get': { - const oriDptor = getDptor(obj, key); - define(obj, key, { - get: value, - set: oriDptor && oriDptor.set, - configurable: true, - }); - break; - } - case 'set': { - const oriDptor = getDptor(obj, key); - define(obj, key, { - get: oriDptor && oriDptor.get, - set: value, - configurable: true, - }); - break; - } - default: - throw new SyntaxError('Unexpected token'); - } + function FunctionDeclaration(node, scope) { + scope.func(node.id.name, createFunc$1(node, scope)); + } + function VariableDeclaration(node, scope, options = {}) { + for (let i = 0; i < node.declarations.length; i++) { + VariableDeclarator(node.declarations[i], scope, assign({ kind: node.kind }, options)); + } + } + function VariableDeclarator(node, scope, options = {}) { + const { kind = 'let', hoist = false, onlyBlock = false, feed } = options; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (node.id.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(node.id, scope, { kind, hoist, onlyBlock }); + } + } + } + else { + const hasFeed = 'feed' in options; + const value = hasFeed ? feed : evaluate(node.init, scope); + if (node.id.type === 'Identifier') { + const name = node.id.name; + if (kind === 'var' && !node.init && !hasFeed) { + scope.var(name, NOINIT); + } + else { + scope[kind](name, value); + } + if (node.init + && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] + .indexOf(node.init.type) !== -1 + && !value.name) { + define(value, 'name', { + value: name, + configurable: true + }); + } + } + else { + pattern$3(node.id, scope, { kind, feed: value }); + } + } + } + function ClassDeclaration(node, scope) { + scope.func(node.id.name, createClass$1(node, scope)); + } + function ClassBody(node, scope, options = {}) { + const { klass, superClass } = options; + for (let i = 0; i < node.body.length; i++) { + MethodDefinition(node.body[i], scope, { klass, superClass }); + } + } + function MethodDefinition(node, scope, options = {}) { + const { klass, superClass } = options; + let key; + if (node.computed) { + key = evaluate(node.key, scope); + } + else if (node.key.type === 'Identifier') { + key = node.key.name; + } + else { + throw new SyntaxError('Unexpected token'); + } + const obj = node.static ? klass : klass.prototype; + const value = createFunc$1(node.value, scope, { superClass }); + switch (node.kind) { + case 'constructor': + break; + case 'method': + define(obj, key, { + value, + writable: true, + configurable: true, + }); + break; + case 'get': { + const oriDptor = getDptor(obj, key); + define(obj, key, { + get: value, + set: oriDptor && oriDptor.set, + configurable: true, + }); + break; + } + case 'set': { + const oriDptor = getDptor(obj, key); + define(obj, key, { + get: oriDptor && oriDptor.get, + set: value, + configurable: true, + }); + break; + } + default: + throw new SyntaxError('Unexpected token'); + } } - function* Identifier$1(node, scope, options = {}) { - const { getVar = false, throwErr = true } = options; - if (node.name === 'undefined') { - return undefined; - } - const variable = scope.find(node.name); - if (variable) { - if (getVar) { - return variable; - } - else { - const value = variable.get(); - if (value === DEADZONE) { - throw new ReferenceError(`${node.name} is not defined`); - } - else { - return value; - } - } - } - else if (throwErr) { - throw new ReferenceError(`${node.name} is not defined`); - } - else { - return undefined; - } + function* Identifier$1(node, scope, options = {}) { + const { getVar = false, throwErr = true } = options; + if (node.name === 'undefined') { + return undefined; + } + const variable = scope.find(node.name); + if (variable) { + if (getVar) { + return variable; + } + else { + const value = variable.get(); + if (value === DEADZONE) { + throw new ReferenceError(`${node.name} is not defined`); + } + else { + return value; + } + } + } + else if (throwErr) { + throw new ReferenceError(`${node.name} is not defined`); + } + else { + return undefined; + } } var identifier$1 = /*#__PURE__*/Object.freeze({ Identifier: Identifier$1 }); - function* Literal$1(node, scope) { - return node.value; + function* Literal$1(node, scope) { + return node.value; } var literal$1 = /*#__PURE__*/Object.freeze({ Literal: Literal$1 }); - function* ThisExpression$1(node, scope) { - const superCall = scope.find(SUPERCALL); - if (superCall && !superCall.get()) { - throw new ReferenceError('Must call super constructor in derived class' - + 'before accessing \'this\' or returning from derived constructor'); - } - else { - return scope.find('this').get(); - } - } - function* ArrayExpression$1(node, scope) { - let results = []; - for (let i = 0; i < node.elements.length; i++) { - const item = node.elements[i]; - if (item.type === 'SpreadElement') { - results = results.concat(yield* SpreadElement$1(item, scope)); - } - else { - results.push(yield* evaluate$1(item, scope)); - } - } - return results; - } - function* ObjectExpression$1(node, scope) { - const object = {}; - for (let i = 0; i < node.properties.length; i++) { - const property = node.properties[i]; - if (property.type === 'SpreadElement') { - assign(object, yield* SpreadElement$1(property, scope)); - } - else { - let key; - const propKey = property.key; - if (property.computed) { - key = yield* evaluate$1(propKey, scope); - } - else { - if (propKey.type === 'Identifier') { - key = propKey.name; - } - else { - key = '' + (yield* Literal$1(propKey, scope)); - } - } - const value = yield* evaluate$1(property.value, scope); - const propKind = property.kind; - if (propKind === 'init') { - object[key] = value; - } - else if (propKind === 'get') { - define(object, key, { get: value }); - } - else { - define(object, key, { set: value }); - } - } - } - return object; - } - function* FunctionExpression$1(node, scope) { - if (node.id && node.id.name) { - const tmpScope = new Scope(scope); - const func = createFunc(node, tmpScope); - tmpScope.const(node.id.name, func); - return func; - } - else { - return createFunc(node, scope); - } - } - function* UnaryExpression$1(node, scope) { - const arg = node.argument; - switch (node.operator) { - case '+': return +(yield* evaluate$1(arg, scope)); - case '-': return -(yield* evaluate$1(arg, scope)); - case '!': return !(yield* evaluate$1(arg, scope)); - case '~': return ~(yield* evaluate$1(arg, scope)); - case 'void': return void (yield* evaluate$1(arg, scope)); - case 'typeof': - if (arg.type === 'Identifier') { - return typeof (yield* Identifier$1(arg, scope, { throwErr: false })); - } - else { - return typeof (yield* evaluate$1(arg, scope)); - } - case 'delete': - if (arg.type === 'MemberExpression') { - const variable = yield* MemberExpression$1(arg, scope, { getVar: true }); - return variable.del(); - } - else if (arg.type === 'Identifier') { - const win = scope.global().find('window').get(); - return delete win[arg.name]; - } - else { - throw new SyntaxError('Unexpected token'); - } - default: throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function* UpdateExpression$1(node, scope) { - const arg = node.argument; - let variable; - if (arg.type === 'Identifier') { - variable = yield* Identifier$1(arg, scope, { getVar: true }); - } - else if (arg.type === 'MemberExpression') { - variable = yield* MemberExpression$1(arg, scope, { getVar: true }); - } - else { - throw new SyntaxError('Unexpected token'); - } - const value = variable.get(); - if (node.operator === '++') { - variable.set(value + 1); - return node.prefix ? variable.get() : value; - } - else if (node.operator === '--') { - variable.set(value - 1); - return node.prefix ? variable.get() : value; - } - else { - throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function* BinaryExpression$1(node, scope) { - const left = yield* evaluate$1(node.left, scope); - const right = yield* evaluate$1(node.right, scope); - switch (node.operator) { - case '==': return left == right; - case '!=': return left != right; - case '===': return left === right; - case '!==': return left !== right; - case '<': return left < right; - case '<=': return left <= right; - case '>': return left > right; - case '>=': return left >= right; - case '<<': return left << right; - case '>>': return left >> right; - case '>>>': return left >>> right; - case '+': return left + right; - case '-': return left - right; - case '*': return left * right; - case '**': return Math.pow(left, right); - case '/': return left / right; - case '%': return left % right; - case '|': return left | right; - case '^': return left ^ right; - case '&': return left & right; - case 'in': return left in right; - case 'instanceof': return left instanceof right; - default: throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function* AssignmentExpression$1(node, scope) { - const value = yield* evaluate$1(node.right, scope); - const left = node.left; - let variable; - if (left.type === 'Identifier') { - variable = yield* Identifier$1(left, scope, { getVar: true, throwErr: false }); - if (!variable) { - const win = scope.global().find('window').get(); - variable = new Prop(win, left.name); - } - } - else if (left.type === 'MemberExpression') { - variable = yield* MemberExpression$1(left, scope, { getVar: true }); - } - else { - return yield* pattern$2(left, scope, { feed: value }); - } - switch (node.operator) { - case '=': - variable.set(value); - return variable.get(); - case '+=': - variable.set(variable.get() + value); - return variable.get(); - case '-=': - variable.set(variable.get() - value); - return variable.get(); - case '*=': - variable.set(variable.get() * value); - return variable.get(); - case '/=': - variable.set(variable.get() / value); - return variable.get(); - case '%=': - variable.set(variable.get() % value); - return variable.get(); - case '**=': - variable.set(Math.pow(variable.get(), value)); - return variable.get(); - case '<<=': - variable.set(variable.get() << value); - return variable.get(); - case '>>=': - variable.set(variable.get() >> value); - return variable.get(); - case '>>>=': - variable.set(variable.get() >>> value); - return variable.get(); - case '|=': - variable.set(variable.get() | value); - return variable.get(); - case '^=': - variable.set(variable.get() ^ value); - return variable.get(); - case '&=': - variable.set(variable.get() & value); - return variable.get(); - default: throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function* LogicalExpression$1(node, scope) { - switch (node.operator) { - case '||': - return (yield* evaluate$1(node.left, scope)) || (yield* evaluate$1(node.right, scope)); - case '&&': - return (yield* evaluate$1(node.left, scope)) && (yield* evaluate$1(node.right, scope)); - default: - throw new SyntaxError(`Unexpected token ${node.operator}`); - } - } - function* MemberExpression$1(node, scope, options = {}) { - const { getObj = false, getVar = false } = options; - let object; - if (node.object.type === 'Super') { - object = yield* Super$1(node.object, scope, { getProto: true }); - } - else { - object = yield* evaluate$1(node.object, scope); - } - if (getObj) - return object; - let key; - if (node.computed) { - key = yield* evaluate$1(node.property, scope); - } - else { - key = node.property.name; - } - if (getVar) { - const setter = getSetter(object, key); - if (node.object.type === 'Super' && setter) { - const thisObject = scope.find('this').get(); - const privateKey = createSymbol(key); - define(thisObject, privateKey, { set: setter }); - return new Prop(thisObject, privateKey); - } - else { - return new Prop(object, key); - } - } - else { - const getter = getGetter(object, key); - if (node.object.type === 'Super' && getter) { - const thisObject = scope.find('this').get(); - return getter.call(thisObject); - } - else { - return object[key]; - } - } - } - function* ConditionalExpression$1(node, scope) { - return (yield* evaluate$1(node.test, scope)) - ? (yield* evaluate$1(node.consequent, scope)) - : (yield* evaluate$1(node.alternate, scope)); - } - function* CallExpression$1(node, scope) { - let func; - let object; - if (node.callee.type === 'MemberExpression') { - object = yield* MemberExpression$1(node.callee, scope, { getObj: true }); - let key; - if (node.callee.computed) { - key = yield* evaluate$1(node.callee.property, scope); - } - else { - key = node.callee.property.name; - } - const getter = getGetter(object, key); - if (node.callee.object.type === 'Super' && getter) { - const thisObject = scope.find('this').get(); - func = getter.call(thisObject); - } - else { - func = object[key]; - } - if (typeof func !== 'function') { - throw new TypeError(`${key} is not a function`); - } - else if (func[CLSCTOR]) { - throw new TypeError(`Class constructor ${key} cannot be invoked without 'new'`); - } - } - else { - object = scope.find('this').get(); - func = yield* evaluate$1(node.callee, scope); - if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { - let name; - if (node.callee.type === 'Identifier') { - name = node.callee.name; - } - else { - try { - name = JSON.stringify(func); - } - catch (err) { - name = '' + func; - } - } - if (typeof func !== 'function') { - throw new TypeError(`${name} is not a function`); - } - else { - throw new TypeError(`Class constructor ${name} cannot be invoked without 'new'`); - } - } - } - let args = []; - for (let i = 0; i < node.arguments.length; i++) { - const arg = node.arguments[i]; - if (arg.type === 'SpreadElement') { - args = args.concat(yield* SpreadElement$1(arg, scope)); - } - else { - args.push(yield* evaluate$1(arg, scope)); - } - } - if (node.callee.type === 'Super') { - const superCall = scope.find(SUPERCALL); - if (superCall.get()) { - throw new ReferenceError('Super constructor may only be called once'); - } - else { - scope.find(SUPERCALL).set(true); - } - } - return func.apply(object, args); - } - function* NewExpression$1(node, scope) { - const constructor = yield* evaluate$1(node.callee, scope); - if (typeof constructor !== 'function') { - let name; - if (node.callee.type === 'Identifier') { - name = node.callee.name; - } - else { - try { - name = JSON.stringify(constructor); - } - catch (err) { - name = '' + constructor; - } - } - throw new TypeError(`${name} is not a constructor`); - } - else if (constructor[NOCTOR]) { - throw new TypeError(`${constructor.name || '(intermediate value)'} is not a constructor`); - } - let args = []; - for (let i = 0; i < node.arguments.length; i++) { - const arg = node.arguments[i]; - if (arg.type === 'SpreadElement') { - args = args.concat(yield* SpreadElement$1(arg, scope)); - } - else { - args.push(yield* evaluate$1(arg, scope)); - } - } - return new constructor(...args); - } - function* MetaProperty$1(node, scope) { - return scope.find(NEWTARGET).get(); - } - function* SequenceExpression$1(node, scope) { - let result; - for (let i = 0; i < node.expressions.length; i++) { - result = yield* evaluate$1(node.expressions[i], scope); - } - return result; - } - function* ArrowFunctionExpression$1(node, scope) { - return createFunc(node, scope); - } - function* TemplateLiteral$1(node, scope) { - const quasis = node.quasis; - const expressions = node.expressions; - let result = ''; - let temEl; - let expr; - while (temEl = quasis.shift()) { - result += yield* TemplateElement$1(temEl, scope); - expr = expressions.shift(); - if (expr) { - result += yield* evaluate$1(expr, scope); - } - } - return result; - } - function* TaggedTemplateExpression$1(node, scope) { - const tagFunc = yield* evaluate$1(node.tag, scope); - const quasis = node.quasi.quasis; - const str = quasis.map(v => v.value.cooked); - const raw = quasis.map(v => v.value.raw); - define(str, 'raw', { - value: freeze(raw) - }); - const expressions = node.quasi.expressions; - const args = []; - if (expressions) { - for (let i = 0; i < expressions.length; i++) { - args.push(yield* evaluate$1(expressions[i], scope)); - } - } - return tagFunc(freeze(str), ...args); - } - function* TemplateElement$1(node, scope) { - return node.value.raw; - } - function* ClassExpression$1(node, scope) { - if (node.id && node.id.name) { - const tmpScope = new Scope(scope); - const klass = yield* createClass(node, tmpScope); - tmpScope.const(node.id.name, klass); - return klass; - } - else { - return yield* createClass(node, scope); - } - } - function* Super$1(node, scope, options = {}) { - const { getProto = false } = options; - const superClass = scope.find(SUPER).get(); - return getProto ? superClass.prototype : superClass; - } - function* SpreadElement$1(node, scope) { - return yield* evaluate$1(node.argument, scope); - } - function* YieldExpression(node, scope) { - const res = yield* evaluate$1(node.argument, scope); - return node.delegate ? yield* res : yield res; - } - function* AwaitExpression(node, scope) { - AWAIT.RES = yield* evaluate$1(node.argument, scope); - return yield AWAIT; + function* ThisExpression$1(node, scope) { + const superCall = scope.find(SUPERCALL); + if (superCall && !superCall.get()) { + throw new ReferenceError('Must call super constructor in derived class ' + + 'before accessing \'this\' or returning from derived constructor'); + } + else { + return scope.find('this').get(); + } + } + function* ArrayExpression$1(node, scope) { + let results = []; + for (let i = 0; i < node.elements.length; i++) { + const item = node.elements[i]; + if (item.type === 'SpreadElement') { + results = results.concat(yield* SpreadElement$1(item, scope)); + } + else { + results.push(yield* evaluate$1(item, scope)); + } + } + return results; + } + function* ObjectExpression$1(node, scope) { + const object = {}; + for (let i = 0; i < node.properties.length; i++) { + const property = node.properties[i]; + if (property.type === 'SpreadElement') { + assign(object, yield* SpreadElement$1(property, scope)); + } + else { + let key; + const propKey = property.key; + if (property.computed) { + key = yield* evaluate$1(propKey, scope); + } + else { + if (propKey.type === 'Identifier') { + key = propKey.name; + } + else { + key = '' + (yield* Literal$1(propKey)); + } + } + const value = yield* evaluate$1(property.value, scope); + const propKind = property.kind; + if (propKind === 'init') { + object[key] = value; + } + else if (propKind === 'get') { + const oriDptor = getDptor(object, key); + define(object, key, { + get: value, + set: oriDptor && oriDptor.set, + enumerable: true, + configurable: true + }); + } + else { + const oriDptor = getDptor(object, key); + define(object, key, { + get: oriDptor && oriDptor.get, + set: value, + enumerable: true, + configurable: true + }); + } + } + } + return object; + } + function* FunctionExpression$1(node, scope) { + if (node.id && node.id.name) { + const tmpScope = new Scope(scope); + const func = createFunc(node, tmpScope); + tmpScope.const(node.id.name, func); + return func; + } + else { + return createFunc(node, scope); + } + } + function* UnaryExpression$1(node, scope) { + const arg = node.argument; + switch (node.operator) { + case '+': return +(yield* evaluate$1(arg, scope)); + case '-': return -(yield* evaluate$1(arg, scope)); + case '!': return !(yield* evaluate$1(arg, scope)); + case '~': return ~(yield* evaluate$1(arg, scope)); + case 'void': return void (yield* evaluate$1(arg, scope)); + case 'typeof': + if (arg.type === 'Identifier') { + return typeof (yield* Identifier$1(arg, scope, { throwErr: false })); + } + else { + return typeof (yield* evaluate$1(arg, scope)); + } + case 'delete': + if (arg.type === 'MemberExpression') { + const variable = yield* MemberExpression$1(arg, scope, { getVar: true }); + return variable.del(); + } + else if (arg.type === 'Identifier') { + throw new SyntaxError('Delete of an unqualified identifier in strict mode'); + } + else { + yield* evaluate$1(arg, scope); + return true; + } + default: throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function* UpdateExpression$1(node, scope) { + const arg = node.argument; + let variable; + if (arg.type === 'Identifier') { + variable = yield* Identifier$1(arg, scope, { getVar: true }); + } + else if (arg.type === 'MemberExpression') { + variable = yield* MemberExpression$1(arg, scope, { getVar: true }); + } + else { + throw new SyntaxError('Unexpected token'); + } + const value = variable.get(); + if (node.operator === '++') { + variable.set(value + 1); + return node.prefix ? variable.get() : value; + } + else if (node.operator === '--') { + variable.set(value - 1); + return node.prefix ? variable.get() : value; + } + else { + throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function* BinaryExpression$1(node, scope) { + const left = yield* evaluate$1(node.left, scope); + const right = yield* evaluate$1(node.right, scope); + switch (node.operator) { + case '==': return left == right; + case '!=': return left != right; + case '===': return left === right; + case '!==': return left !== right; + case '<': return left < right; + case '<=': return left <= right; + case '>': return left > right; + case '>=': return left >= right; + case '<<': return left << right; + case '>>': return left >> right; + case '>>>': return left >>> right; + case '+': return left + right; + case '-': return left - right; + case '*': return left * right; + case '**': return Math.pow(left, right); + case '/': return left / right; + case '%': return left % right; + case '|': return left | right; + case '^': return left ^ right; + case '&': return left & right; + case 'in': return left in right; + case 'instanceof': return left instanceof right; + default: throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function* AssignmentExpression$1(node, scope) { + const value = yield* evaluate$1(node.right, scope); + const left = node.left; + let variable; + if (left.type === 'Identifier') { + variable = yield* Identifier$1(left, scope, { getVar: true, throwErr: false }); + if (!variable) { + const win = scope.global().find('window').get(); + variable = new Prop(win, left.name); + } + } + else if (left.type === 'MemberExpression') { + variable = yield* MemberExpression$1(left, scope, { getVar: true }); + } + else { + return yield* pattern$2(left, scope, { feed: value }); + } + switch (node.operator) { + case '=': + variable.set(value); + return variable.get(); + case '+=': + variable.set(variable.get() + value); + return variable.get(); + case '-=': + variable.set(variable.get() - value); + return variable.get(); + case '*=': + variable.set(variable.get() * value); + return variable.get(); + case '/=': + variable.set(variable.get() / value); + return variable.get(); + case '%=': + variable.set(variable.get() % value); + return variable.get(); + case '**=': + variable.set(Math.pow(variable.get(), value)); + return variable.get(); + case '<<=': + variable.set(variable.get() << value); + return variable.get(); + case '>>=': + variable.set(variable.get() >> value); + return variable.get(); + case '>>>=': + variable.set(variable.get() >>> value); + return variable.get(); + case '|=': + variable.set(variable.get() | value); + return variable.get(); + case '^=': + variable.set(variable.get() ^ value); + return variable.get(); + case '&=': + variable.set(variable.get() & value); + return variable.get(); + default: throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function* LogicalExpression$1(node, scope) { + switch (node.operator) { + case '||': + return (yield* evaluate$1(node.left, scope)) || (yield* evaluate$1(node.right, scope)); + case '&&': + return (yield* evaluate$1(node.left, scope)) && (yield* evaluate$1(node.right, scope)); + default: + throw new SyntaxError(`Unexpected token ${node.operator}`); + } + } + function* MemberExpression$1(node, scope, options = {}) { + const { getObj = false, getVar = false } = options; + let object; + if (node.object.type === 'Super') { + object = yield* Super$1(node.object, scope, { getProto: true }); + } + else { + object = yield* evaluate$1(node.object, scope); + } + if (getObj) + return object; + let key; + if (node.computed) { + key = yield* evaluate$1(node.property, scope); + } + else { + key = node.property.name; + } + if (getVar) { + const setter = getSetter(object, key); + if (node.object.type === 'Super' && setter) { + const thisObject = scope.find('this').get(); + const privateKey = createSymbol(key); + define(thisObject, privateKey, { set: setter }); + return new Prop(thisObject, privateKey); + } + else { + return new Prop(object, key); + } + } + else { + const getter = getGetter(object, key); + if (node.object.type === 'Super' && getter) { + const thisObject = scope.find('this').get(); + return getter.call(thisObject); + } + else { + return object[key]; + } + } + } + function* ConditionalExpression$1(node, scope) { + return (yield* evaluate$1(node.test, scope)) + ? (yield* evaluate$1(node.consequent, scope)) + : (yield* evaluate$1(node.alternate, scope)); + } + function* CallExpression$1(node, scope) { + let func; + let object; + if (node.callee.type === 'MemberExpression') { + object = yield* MemberExpression$1(node.callee, scope, { getObj: true }); + let key; + if (node.callee.computed) { + key = yield* evaluate$1(node.callee.property, scope); + } + else { + key = node.callee.property.name; + } + if (node.callee.object.type === 'Super') { + const thisObject = scope.find('this').get(); + func = object[key].bind(thisObject); + } + else { + func = object[key]; + } + if (typeof func !== 'function') { + throw new TypeError(`${key} is not a function`); + } + else if (func[CLSCTOR]) { + throw new TypeError(`Class constructor ${key} cannot be invoked without 'new'`); + } + } + else { + object = scope.find('this').get(); + func = yield* evaluate$1(node.callee, scope); + if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { + let name; + if (node.callee.type === 'Identifier') { + name = node.callee.name; + } + else { + try { + name = JSON.stringify(func); + } + catch (err) { + name = '' + func; + } + } + if (typeof func !== 'function') { + throw new TypeError(`${name} is not a function`); + } + else { + throw new TypeError(`Class constructor ${name} cannot be invoked without 'new'`); + } + } + } + let args = []; + for (let i = 0; i < node.arguments.length; i++) { + const arg = node.arguments[i]; + if (arg.type === 'SpreadElement') { + args = args.concat(yield* SpreadElement$1(arg, scope)); + } + else { + args.push(yield* evaluate$1(arg, scope)); + } + } + if (node.callee.type === 'Super') { + const superCall = scope.find(SUPERCALL); + if (superCall.get()) { + throw new ReferenceError('Super constructor may only be called once'); + } + else { + scope.find(SUPERCALL).set(true); + } + } + return func.apply(object, args); + } + function* NewExpression$1(node, scope) { + const constructor = yield* evaluate$1(node.callee, scope); + if (typeof constructor !== 'function') { + let name; + if (node.callee.type === 'Identifier') { + name = node.callee.name; + } + else { + try { + name = JSON.stringify(constructor); + } + catch (err) { + name = '' + constructor; + } + } + throw new TypeError(`${name} is not a constructor`); + } + else if (constructor[NOCTOR]) { + throw new TypeError(`${constructor.name || '(intermediate value)'} is not a constructor`); + } + let args = []; + for (let i = 0; i < node.arguments.length; i++) { + const arg = node.arguments[i]; + if (arg.type === 'SpreadElement') { + args = args.concat(yield* SpreadElement$1(arg, scope)); + } + else { + args.push(yield* evaluate$1(arg, scope)); + } + } + return new constructor(...args); + } + function* MetaProperty$1(node, scope) { + return scope.find(NEWTARGET).get(); + } + function* SequenceExpression$1(node, scope) { + let result; + for (let i = 0; i < node.expressions.length; i++) { + result = yield* evaluate$1(node.expressions[i], scope); + } + return result; + } + function* ArrowFunctionExpression$1(node, scope) { + return createFunc(node, scope); + } + function* TemplateLiteral$1(node, scope) { + const quasis = node.quasis; + const expressions = node.expressions; + let result = ''; + let temEl; + let expr; + while (temEl = quasis.shift()) { + result += yield* TemplateElement$1(temEl); + expr = expressions.shift(); + if (expr) { + result += yield* evaluate$1(expr, scope); + } + } + return result; + } + function* TaggedTemplateExpression$1(node, scope) { + const tagFunc = yield* evaluate$1(node.tag, scope); + const quasis = node.quasi.quasis; + const str = quasis.map(v => v.value.cooked); + const raw = quasis.map(v => v.value.raw); + define(str, 'raw', { + value: freeze(raw) + }); + const expressions = node.quasi.expressions; + const args = []; + if (expressions) { + for (let i = 0; i < expressions.length; i++) { + args.push(yield* evaluate$1(expressions[i], scope)); + } + } + return tagFunc(freeze(str), ...args); + } + function* TemplateElement$1(node, scope) { + return node.value.raw; + } + function* ClassExpression$1(node, scope) { + if (node.id && node.id.name) { + const tmpScope = new Scope(scope); + const klass = yield* createClass(node, tmpScope); + tmpScope.const(node.id.name, klass); + return klass; + } + else { + return yield* createClass(node, scope); + } + } + function* Super$1(node, scope, options = {}) { + const { getProto = false } = options; + const superClass = scope.find(SUPER).get(); + return getProto ? superClass.prototype : superClass; + } + function* SpreadElement$1(node, scope) { + return yield* evaluate$1(node.argument, scope); + } + function* YieldExpression(node, scope) { + const res = yield* evaluate$1(node.argument, scope); + return node.delegate ? yield* res : yield res; + } + function* AwaitExpression(node, scope) { + AWAIT.RES = yield* evaluate$1(node.argument, scope); + return yield AWAIT; } var expression$1 = /*#__PURE__*/Object.freeze({ @@ -2015,205 +2037,205 @@ AwaitExpression: AwaitExpression }); - function* ExpressionStatement$1(node, scope) { - yield* evaluate$1(node.expression, scope); - } - function* BlockStatement$1(block, scope, options = {}) { - const { invasived = false, hoisted = false, } = options; - const subScope = invasived ? scope : new Scope(scope); - if (!hoisted) { - yield* hoist(block, subScope, { onlyBlock: true }); - } - for (let i = 0; i < block.body.length; i++) { - const result = yield* evaluate$1(block.body[i], subScope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - function* EmptyStatement$1() { - } - function* DebuggerStatement$1() { - debugger; - } - function* ReturnStatement$1(node, scope) { - RETURN.RES = node.argument ? (yield* evaluate$1(node.argument, scope)) : undefined; - return RETURN; - } - function* BreakStatement$1() { - return BREAK; - } - function* ContinueStatement$1() { - return CONTINUE; - } - function* IfStatement$1(node, scope) { - if (yield* evaluate$1(node.test, scope)) { - return yield* evaluate$1(node.consequent, scope); - } - else { - return yield* evaluate$1(node.alternate, scope); - } - } - function* SwitchStatement$1(node, scope) { - const discriminant = yield* evaluate$1(node.discriminant, scope); - let matched = false; - for (let i = 0; i < node.cases.length; i++) { - const eachCase = node.cases[i]; - if (!matched - && (!eachCase.test - || (yield* evaluate$1(eachCase.test, scope)) === discriminant)) { - matched = true; - } - if (matched) { - const result = yield* SwitchCase$1(eachCase, scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - } - function* SwitchCase$1(node, scope) { - for (let i = 0; i < node.consequent.length; i++) { - const result = yield* evaluate$1(node.consequent[i], scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - function* ThrowStatement$1(node, scope) { - throw yield* evaluate$1(node.argument, scope); - } - function* TryStatement$1(node, scope) { - try { - return yield* BlockStatement$1(node.block, scope); - } - catch (err) { - if (node.handler) { - const subScope = new Scope(scope); - const param = node.handler.param; - if (param) { - if (param.type === 'Identifier') { - const name = param.name; - subScope.let(name, err); - } - else { - yield* pattern$2(param, scope, { feed: err }); - } - } - return yield* CatchClause$1(node.handler, subScope); - } - else { - throw err; - } - } - finally { - if (node.finalizer) { - const result = yield* BlockStatement$1(node.finalizer, scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - } - function* CatchClause$1(node, scope) { - return yield* BlockStatement$1(node.body, scope, { invasived: true }); - } - function* WhileStatement$1(node, scope) { - while (yield* evaluate$1(node.test, scope)) { - const result = yield* evaluate$1(node.body, scope); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function* DoWhileStatement$1(node, scope) { - do { - const result = yield* evaluate$1(node.body, scope); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } while (yield* evaluate$1(node.test, scope)); - } - function* ForStatement$1(node, scope) { - const forScope = new Scope(scope); - for (yield* evaluate$1(node.init, forScope); node.test ? (yield* evaluate$1(node.test, forScope)) : true; yield* evaluate$1(node.update, forScope)) { - const subScope = new Scope(forScope); - let result; - if (node.body.type === 'BlockStatement') { - result = yield* BlockStatement$1(node.body, subScope, { invasived: true }); - } - else { - result = yield* evaluate$1(node.body, subScope); - } - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function* ForInStatement$1(node, scope) { - for (const value in yield* evaluate$1(node.right, scope)) { - const result = yield* ForXHandler(node, scope, { value }); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function* ForOfStatement$1(node, scope) { - const right = yield* evaluate$1(node.right, scope); - if (node.await) { - const iterator = getAsyncIterator(right); - let ret; - for (AWAIT.RES = iterator.next(), ret = yield AWAIT; !ret.done; AWAIT.RES = iterator.next(), ret = yield AWAIT) { - const result = yield* ForXHandler(node, scope, { value: ret.value }); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - else { - for (const value of right) { - const result = yield* ForXHandler(node, scope, { value }); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } + function* ExpressionStatement$1(node, scope) { + yield* evaluate$1(node.expression, scope); + } + function* BlockStatement$1(block, scope, options = {}) { + const { invasived = false, hoisted = false, } = options; + const subScope = invasived ? scope : new Scope(scope); + if (!hoisted) { + yield* hoist(block, subScope, { onlyBlock: true }); + } + for (let i = 0; i < block.body.length; i++) { + const result = yield* evaluate$1(block.body[i], subScope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + function* EmptyStatement$1() { + } + function* DebuggerStatement$1() { + debugger; + } + function* ReturnStatement$1(node, scope) { + RETURN.RES = node.argument ? (yield* evaluate$1(node.argument, scope)) : undefined; + return RETURN; + } + function* BreakStatement$1() { + return BREAK; + } + function* ContinueStatement$1() { + return CONTINUE; + } + function* IfStatement$1(node, scope) { + if (yield* evaluate$1(node.test, scope)) { + return yield* evaluate$1(node.consequent, scope); + } + else { + return yield* evaluate$1(node.alternate, scope); + } + } + function* SwitchStatement$1(node, scope) { + const discriminant = yield* evaluate$1(node.discriminant, scope); + let matched = false; + for (let i = 0; i < node.cases.length; i++) { + const eachCase = node.cases[i]; + if (!matched + && (!eachCase.test + || (yield* evaluate$1(eachCase.test, scope)) === discriminant)) { + matched = true; + } + if (matched) { + const result = yield* SwitchCase$1(eachCase, scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + } + function* SwitchCase$1(node, scope) { + for (let i = 0; i < node.consequent.length; i++) { + const result = yield* evaluate$1(node.consequent[i], scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + function* ThrowStatement$1(node, scope) { + throw yield* evaluate$1(node.argument, scope); + } + function* TryStatement$1(node, scope) { + try { + return yield* BlockStatement$1(node.block, scope); + } + catch (err) { + if (node.handler) { + const subScope = new Scope(scope); + const param = node.handler.param; + if (param) { + if (param.type === 'Identifier') { + const name = param.name; + subScope.let(name, err); + } + else { + yield* pattern$2(param, scope, { feed: err }); + } + } + return yield* CatchClause$1(node.handler, subScope); + } + else { + throw err; + } + } + finally { + if (node.finalizer) { + const result = yield* BlockStatement$1(node.finalizer, scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + } + function* CatchClause$1(node, scope) { + return yield* BlockStatement$1(node.body, scope, { invasived: true }); + } + function* WhileStatement$1(node, scope) { + while (yield* evaluate$1(node.test, scope)) { + const result = yield* evaluate$1(node.body, scope); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function* DoWhileStatement$1(node, scope) { + do { + const result = yield* evaluate$1(node.body, scope); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } while (yield* evaluate$1(node.test, scope)); + } + function* ForStatement$1(node, scope) { + const forScope = new Scope(scope); + for (yield* evaluate$1(node.init, forScope); node.test ? (yield* evaluate$1(node.test, forScope)) : true; yield* evaluate$1(node.update, forScope)) { + const subScope = new Scope(forScope); + let result; + if (node.body.type === 'BlockStatement') { + result = yield* BlockStatement$1(node.body, subScope, { invasived: true }); + } + else { + result = yield* evaluate$1(node.body, subScope); + } + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function* ForInStatement$1(node, scope) { + for (const value in yield* evaluate$1(node.right, scope)) { + const result = yield* ForXHandler(node, scope, { value }); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function* ForOfStatement$1(node, scope) { + const right = yield* evaluate$1(node.right, scope); + if (node.await) { + const iterator = getAsyncIterator(right); + let ret; + for (AWAIT.RES = iterator.next(), ret = yield AWAIT; !ret.done; AWAIT.RES = iterator.next(), ret = yield AWAIT) { + const result = yield* ForXHandler(node, scope, { value: ret.value }); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + else { + for (const value of right) { + const result = yield* ForXHandler(node, scope, { value }); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } } var statement$1 = /*#__PURE__*/Object.freeze({ @@ -2237,135 +2259,135 @@ ForOfStatement: ForOfStatement$1 }); - function* ObjectPattern$1(node, scope, options = {}) { - const { kind = 'let', hoist = false, onlyBlock = false, feed = {} } = options; - const fedKeys = []; - for (let i = 0; i < node.properties.length; i++) { - const property = node.properties[i]; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (property.type === 'Property') { - const value = property.value; - if (value.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); - } - else { - yield* pattern$2(value, scope, { kind, hoist, onlyBlock }); - } - } - else { - yield* RestElement$1(property, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (property.type === 'Property') { - let key; - if (property.computed) { - key = yield* evaluate$1(property.key, scope); - } - else { - key = property.key.name; - } - fedKeys.push(key); - const value = property.value; - if (value.type === 'Identifier') { - scope[kind](value.name, feed[key]); - } - else { - yield* pattern$2(value, scope, { kind, feed: feed[key] }); - } - } - else { - const rest = assign({}, feed); - for (let i = 0; i < fedKeys.length; i++) - delete rest[fedKeys[i]]; - yield* RestElement$1(property, scope, { kind, feed: rest }); - } - } - } - function* ArrayPattern$1(node, scope, options = {}) { - const { kind, hoist = false, onlyBlock = false, feed = [] } = options; - const result = []; - for (let i = 0; i < node.elements.length; i++) { - const element = node.elements[i]; - if (!element) - continue; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (element.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); - } - else { - yield* pattern$2(element, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (element.type === 'Identifier') { - if (kind) { - scope[kind](element.name, feed[i]); - } - else { - const variable = yield* Identifier$1(element, scope, { getVar: true }); - variable.set(feed[i]); - result.push(variable.get()); - } - } - else if (element.type === 'RestElement') { - yield* RestElement$1(element, scope, { kind, feed: feed.slice(i) }); - } - else { - yield* pattern$2(element, scope, { kind, feed: feed[i] }); - } - } - if (result.length) { - return result; - } - } - function* RestElement$1(node, scope, options = {}) { - const { kind, hoist = false, onlyBlock = false, feed = [] } = options; - const arg = node.argument; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (arg.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); - } - else { - yield* pattern$2(arg, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (arg.type === 'Identifier') { - if (kind) { - scope[kind](arg.name, feed); - } - else { - const variable = yield* Identifier$1(arg, scope, { getVar: true }); - variable.set(feed); - } - } - else { - yield* pattern$2(arg, scope, { kind, feed }); - } - } - function* AssignmentPattern$1(node, scope, options = {}) { - const { kind = 'let', hoist = false, onlyBlock = false, feed = yield* evaluate$1(node.right, scope) } = options; - const left = node.left; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (left.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); - } - else { - yield* pattern$2(left, scope, { kind, hoist, onlyBlock }); - } - } - } - else if (left.type === 'Identifier') { - scope[kind](left.name, feed); - } - else { - yield* pattern$2(left, scope, { kind, feed }); - } + function* ObjectPattern$1(node, scope, options = {}) { + const { kind = 'let', hoist = false, onlyBlock = false, feed = {} } = options; + const fedKeys = []; + for (let i = 0; i < node.properties.length; i++) { + const property = node.properties[i]; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (property.type === 'Property') { + const value = property.value; + if (value.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); + } + else { + yield* pattern$2(value, scope, { kind, hoist, onlyBlock }); + } + } + else { + yield* RestElement$1(property, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (property.type === 'Property') { + let key; + if (property.computed) { + key = yield* evaluate$1(property.key, scope); + } + else { + key = property.key.name; + } + fedKeys.push(key); + const value = property.value; + if (value.type === 'Identifier') { + scope[kind](value.name, feed[key]); + } + else { + yield* pattern$2(value, scope, { kind, feed: feed[key] }); + } + } + else { + const rest = assign({}, feed); + for (let i = 0; i < fedKeys.length; i++) + delete rest[fedKeys[i]]; + yield* RestElement$1(property, scope, { kind, feed: rest }); + } + } + } + function* ArrayPattern$1(node, scope, options = {}) { + const { kind, hoist = false, onlyBlock = false, feed = [] } = options; + const result = []; + for (let i = 0; i < node.elements.length; i++) { + const element = node.elements[i]; + if (!element) + continue; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (element.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); + } + else { + yield* pattern$2(element, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (element.type === 'Identifier') { + if (kind) { + scope[kind](element.name, feed[i]); + } + else { + const variable = yield* Identifier$1(element, scope, { getVar: true }); + variable.set(feed[i]); + result.push(variable.get()); + } + } + else if (element.type === 'RestElement') { + yield* RestElement$1(element, scope, { kind, feed: feed.slice(i) }); + } + else { + yield* pattern$2(element, scope, { kind, feed: feed[i] }); + } + } + if (result.length) { + return result; + } + } + function* RestElement$1(node, scope, options = {}) { + const { kind, hoist = false, onlyBlock = false, feed = [] } = options; + const arg = node.argument; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (arg.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); + } + else { + yield* pattern$2(arg, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (arg.type === 'Identifier') { + if (kind) { + scope[kind](arg.name, feed); + } + else { + const variable = yield* Identifier$1(arg, scope, { getVar: true }); + variable.set(feed); + } + } + else { + yield* pattern$2(arg, scope, { kind, feed }); + } + } + function* AssignmentPattern$1(node, scope, options = {}) { + const { kind = 'let', hoist = false, onlyBlock = false, feed = yield* evaluate$1(node.right, scope) } = options; + const left = node.left; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (left.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); + } + else { + yield* pattern$2(left, scope, { kind, hoist, onlyBlock }); + } + } + } + else if (left.type === 'Identifier') { + scope[kind](left.name, feed); + } + else { + yield* pattern$2(left, scope, { kind, feed }); + } } var pattern$1 = /*#__PURE__*/Object.freeze({ @@ -2375,626 +2397,636 @@ AssignmentPattern: AssignmentPattern$1 }); - let evaluateOps$1; - function* evaluate$1(node, scope) { - if (!node) - return; - if (!evaluateOps$1) { - evaluateOps$1 = assign({}, declaration$1, expression$1, identifier$1, statement$1, literal$1, pattern$1); - } - const handler = evaluateOps$1[node.type]; - if (handler) { - return yield* handler(node, scope); - } - else { - throw new Error(`${node.type} isn't implemented`); - } + let evaluateOps$1; + function* evaluate$1(node, scope) { + if (!node) + return; + if (!evaluateOps$1) { + evaluateOps$1 = assign({}, declaration$1, expression$1, identifier$1, statement$1, literal$1, pattern$1); + } + const handler = evaluateOps$1[node.type]; + if (handler) { + return yield* handler(node, scope); + } + else { + throw new Error(`${node.type} isn't implemented`); + } } - function* FunctionDeclaration$1(node, scope) { - scope.func(node.id.name, createFunc(node, scope)); - } - function* VariableDeclaration$1(node, scope, options = {}) { - for (let i = 0; i < node.declarations.length; i++) { - yield* VariableDeclarator$1(node.declarations[i], scope, assign({ kind: node.kind }, options)); - } - } - function* VariableDeclarator$1(node, scope, options = {}) { - const { kind = 'let', hoist = false, onlyBlock = false, feed } = options; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (node.id.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); - } - else { - yield* pattern$2(node.id, scope, { kind, hoist, onlyBlock }); - } - } - } - else { - const hasFeed = 'feed' in options; - const value = hasFeed ? feed : yield* evaluate$1(node.init, scope); - if (node.id.type === 'Identifier') { - const name = node.id.name; - if (kind === 'var' && !node.init && !hasFeed) { - scope.var(name, NOINIT); - } - else { - scope[kind](name, value); - } - if (node.init - && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] - .indexOf(node.init.type) !== -1 - && !value.name) { - define(value, 'name', { - value: name, - configurable: true - }); - } - } - else { - yield* pattern$2(node.id, scope, { kind, feed: value }); - } - } - } - function* ClassDeclaration$1(node, scope) { - scope.func(node.id.name, yield* createClass(node, scope)); - } - function* ClassBody$1(node, scope, options = {}) { - const { klass, superClass } = options; - for (let i = 0; i < node.body.length; i++) { - yield* MethodDefinition$1(node.body[i], scope, { klass, superClass }); - } - } - function* MethodDefinition$1(node, scope, options = {}) { - const { klass, superClass } = options; - let key; - if (node.computed) { - key = yield* evaluate$1(node.key, scope); - } - else if (node.key.type === 'Identifier') { - key = node.key.name; - } - else { - throw new SyntaxError('Unexpected token'); - } - const obj = node.static ? klass : klass.prototype; - const value = createFunc(node.value, scope, { superClass }); - switch (node.kind) { - case 'constructor': - break; - case 'method': - define(obj, key, { - value, - writable: true, - configurable: true, - }); - break; - case 'get': { - const oriDptor = getDptor(obj, key); - define(obj, key, { - get: value, - set: oriDptor && oriDptor.set, - configurable: true, - }); - break; - } - case 'set': { - const oriDptor = getDptor(obj, key); - define(obj, key, { - get: oriDptor && oriDptor.get, - set: value, - configurable: true, - }); - break; - } - default: - throw new SyntaxError('Unexpected token'); - } + function* FunctionDeclaration$1(node, scope) { + scope.func(node.id.name, createFunc(node, scope)); + } + function* VariableDeclaration$1(node, scope, options = {}) { + for (let i = 0; i < node.declarations.length; i++) { + yield* VariableDeclarator$1(node.declarations[i], scope, assign({ kind: node.kind }, options)); + } + } + function* VariableDeclarator$1(node, scope, options = {}) { + const { kind = 'let', hoist = false, onlyBlock = false, feed } = options; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (node.id.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); + } + else { + yield* pattern$2(node.id, scope, { kind, hoist, onlyBlock }); + } + } + } + else { + const hasFeed = 'feed' in options; + const value = hasFeed ? feed : yield* evaluate$1(node.init, scope); + if (node.id.type === 'Identifier') { + const name = node.id.name; + if (kind === 'var' && !node.init && !hasFeed) { + scope.var(name, NOINIT); + } + else { + scope[kind](name, value); + } + if (node.init + && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] + .indexOf(node.init.type) !== -1 + && !value.name) { + define(value, 'name', { + value: name, + configurable: true + }); + } + } + else { + yield* pattern$2(node.id, scope, { kind, feed: value }); + } + } + } + function* ClassDeclaration$1(node, scope) { + scope.func(node.id.name, yield* createClass(node, scope)); + } + function* ClassBody$1(node, scope, options = {}) { + const { klass, superClass } = options; + for (let i = 0; i < node.body.length; i++) { + yield* MethodDefinition$1(node.body[i], scope, { klass, superClass }); + } + } + function* MethodDefinition$1(node, scope, options = {}) { + const { klass, superClass } = options; + let key; + if (node.computed) { + key = yield* evaluate$1(node.key, scope); + } + else if (node.key.type === 'Identifier') { + key = node.key.name; + } + else { + throw new SyntaxError('Unexpected token'); + } + const obj = node.static ? klass : klass.prototype; + const value = createFunc(node.value, scope, { superClass }); + switch (node.kind) { + case 'constructor': + break; + case 'method': + define(obj, key, { + value, + writable: true, + configurable: true, + }); + break; + case 'get': { + const oriDptor = getDptor(obj, key); + define(obj, key, { + get: value, + set: oriDptor && oriDptor.set, + configurable: true, + }); + break; + } + case 'set': { + const oriDptor = getDptor(obj, key); + define(obj, key, { + get: oriDptor && oriDptor.get, + set: value, + configurable: true, + }); + break; + } + default: + throw new SyntaxError('Unexpected token'); + } } - function runAsync(iterator, options = {}) { - const { res, err, ret, fullRet } = options; - return new Promise((resolve, reject) => { - if ('ret' in options) { - return resolve(iterator.return(ret)); - } - if ('err' in options) { - onRejected(err); - } - else { - onFulfilled(res); - } - function onFulfilled(res) { - let ret; - try { - ret = iterator.next(res); - } - catch (e) { - return reject(e); - } - next(ret); - return null; - } - function onRejected(err) { - let ret; - try { - ret = iterator.throw(err); - } - catch (e) { - return reject(e); - } - next(ret); - } - function next(ret) { - if (ret.done) - return resolve(fullRet ? ret : ret.value); - if (ret.value !== AWAIT) - return resolve(ret); - const awaitValue = ret.value.RES; - const value = awaitValue && awaitValue.then === 'function' - ? awaitValue : Promise.resolve(awaitValue); - return value.then(onFulfilled, onRejected); - } - }); + function runAsync(iterator, options = {}) { + const { res, err, ret, fullRet } = options; + return new Promise((resolve, reject) => { + if ('ret' in options) { + return resolve(iterator.return(ret)); + } + if ('err' in options) { + onRejected(err); + } + else { + onFulfilled(res); + } + function onFulfilled(res) { + let ret; + try { + ret = iterator.next(res); + } + catch (e) { + return reject(e); + } + next(ret); + return null; + } + function onRejected(err) { + let ret; + try { + ret = iterator.throw(err); + } + catch (e) { + return reject(e); + } + next(ret); + } + function next(ret) { + if (ret.done) + return resolve(fullRet ? ret : ret.value); + if (ret.value !== AWAIT) + return resolve(ret); + const awaitValue = ret.value.RES; + const value = awaitValue && awaitValue.then === 'function' + ? awaitValue : Promise.resolve(awaitValue); + return value.then(onFulfilled, onRejected); + } + }); } - function* hoist(block, scope, options = {}) { - const { onlyBlock = false } = options; - const funcDclrList = []; - const funcDclrIdxs = []; - for (let i = 0; i < block.body.length; i++) { - const statement = block.body[i]; - if (statement.type === 'FunctionDeclaration') { - funcDclrList.push(statement); - funcDclrIdxs.push(i); - } - else if (statement.type === 'VariableDeclaration' - && ['const', 'let'].indexOf(statement.kind) !== -1) { - yield* VariableDeclaration$1(statement, scope, { hoist: true, onlyBlock: true }); - } - else if (!onlyBlock) { - yield* hoistVarRecursion(statement, scope); - } - } - if (funcDclrIdxs.length) { - for (let i = funcDclrIdxs.length - 1; i > -1; i--) { - block.body.splice(funcDclrIdxs[i], 1); - } - block.body = funcDclrList.concat(block.body); - } - } - function* hoistVarRecursion(statement, scope) { - switch (statement.type) { - case 'VariableDeclaration': - yield* VariableDeclaration$1(statement, scope, { hoist: true }); - break; - case 'WhileStatement': - case 'DoWhileStatement': - case 'ForStatement': - case 'ForInStatement': - case 'ForOfStatement': - yield* hoistVarRecursion(statement.body, scope); - break; - case 'BlockStatement': - for (let i = 0; i < statement.body.length; i++) { - yield* hoistVarRecursion(statement.body[i], scope); - } - break; - case 'SwitchStatement': - for (let i = 0; i < statement.cases.length; i++) { - for (let j = 0; j < statement.cases[i].consequent.length; j++) { - yield* hoistVarRecursion(statement.cases[i].consequent[j], scope); - } - } - break; - case 'TryStatement': { - const tryBlock = statement.block.body; - for (let i = 0; i < tryBlock.length; i++) { - yield* hoistVarRecursion(tryBlock[i], scope); - } - const catchBlock = statement.handler && statement.handler.body.body; - if (catchBlock) { - for (let i = 0; i < catchBlock.length; i++) { - yield* hoistVarRecursion(catchBlock[i], scope); - } - } - const finalBlock = statement.finalizer && statement.finalizer.body; - if (finalBlock) { - for (let i = 0; i < finalBlock.length; i++) { - yield* hoistVarRecursion(finalBlock[i], scope); - } - } - break; - } - } - } - function* pattern$2(node, scope, options = {}) { - switch (node.type) { - case 'ObjectPattern': - return yield* ObjectPattern$1(node, scope, options); - case 'ArrayPattern': - return yield* ArrayPattern$1(node, scope, options); - case 'RestElement': - return yield* RestElement$1(node, scope, options); - case 'AssignmentPattern': - return yield* AssignmentPattern$1(node, scope, options); - default: - throw new SyntaxError('Unexpected token'); - } - } - function createFunc(node, scope, options = {}) { - if (!node.generator && !node.async) { - return createFunc$1(node, scope, options); - } - const { superClass } = options; - const params = node.params; - const tmpFunc = function* (...args) { - const subScope = new Scope(scope, true); - if (node.type !== 'ArrowFunctionExpression') { - subScope.const('this', this); - subScope.let('arguments', arguments); - subScope.const(NEWTARGET, new.target); - if (superClass) { - subScope.const(SUPER, superClass); - subScope.let(SUPERCALL, false); - } - } - for (let i = 0; i < params.length; i++) { - const param = params[i]; - if (param.type === 'Identifier') { - subScope.let(param.name, args[i]); - } - else if (param.type === 'RestElement') { - yield* RestElement$1(param, subScope, { kind: 'let', feed: args.slice(i) }); - } - else { - yield* pattern$2(param, subScope, { feed: args[i] }); - } - } - let result; - if (node.body.type === 'BlockStatement') { - yield* hoist(node.body, subScope); - result = yield* BlockStatement$1(node.body, subScope, { - invasived: true, - hoisted: true - }); - } - else { - result = yield* evaluate$1(node.body, subScope); - if (node.type === 'ArrowFunctionExpression') { - RETURN.RES = result; - result = RETURN; - } - } - if (result === RETURN) { - return result.RES; - } - }; - let func; - if (node.async && node.generator) { - func = function () { - const iterator = tmpFunc.apply(void 0, arguments); - let last = Promise.resolve(); - const run = (opts) => last = last.then(() => runAsync(iterator, assign({ fullRet: true }, opts))); - const asyncIterator = { - next: (res) => run({ res }), - throw: (err) => run({ err }), - return: (ret) => run({ ret }) - }; - if (typeof Symbol === 'function') { - asyncIterator[Symbol.iterator] = function () { return this; }; - } - return asyncIterator; - }; - } - else if (node.async) { - func = function () { return runAsync(tmpFunc.apply(void 0, arguments)); }; - } - else { - func = tmpFunc; - } - define(func, NOCTOR, { value: true }); - define(func, 'name', { - value: node.id - && node.id.name - || '', - configurable: true - }); - define(func, 'length', { - value: params.length, - configurable: true - }); - return func; - } - function* createClass(node, scope) { - const superClass = yield* evaluate$1(node.superClass, scope); - let klass = function () { - if (superClass) { - superClass.apply(this); - } - }; - const methodBody = node.body.body; - for (let i = 0; i < methodBody.length; i++) { - const method = methodBody[i]; - if (method.kind === 'constructor') { - klass = createFunc(method.value, scope, { superClass }); - break; - } - } - if (superClass) { - inherits(klass, superClass); - } - yield* ClassBody$1(node.body, scope, { klass, superClass }); - define(klass, CLSCTOR, { value: true }); - define(klass, 'name', { - value: node.id && node.id.name || '', - configurable: true - }); - return klass; - } - function* ForXHandler(node, scope, options) { - const { value } = options; - const left = node.left; - const subScope = new Scope(scope); - if (left.type === 'VariableDeclaration') { - yield* VariableDeclaration$1(left, subScope, { feed: value }); - } - else if (left.type === 'Identifier') { - const variable = yield* Identifier(left, scope, { getVar: true }); - variable.set(value); - } - else { - yield* pattern$2(left, scope, { feed: value }); - } - let result; - if (node.body.type === 'BlockStatement') { - result = yield* BlockStatement$1(node.body, subScope, { invasived: true }); - } - else { - result = yield* evaluate$1(node.body, subScope); - } - return result; + function* hoist(block, scope, options = {}) { + const { onlyBlock = false } = options; + const funcDclrList = []; + const funcDclrIdxs = []; + for (let i = 0; i < block.body.length; i++) { + const statement = block.body[i]; + if (statement.type === 'FunctionDeclaration') { + funcDclrList.push(statement); + funcDclrIdxs.push(i); + } + else if (statement.type === 'VariableDeclaration' + && ['const', 'let'].indexOf(statement.kind) !== -1) { + yield* VariableDeclaration$1(statement, scope, { hoist: true, onlyBlock: true }); + } + else if (!onlyBlock) { + yield* hoistVarRecursion(statement, scope); + } + } + if (funcDclrIdxs.length) { + for (let i = funcDclrIdxs.length - 1; i > -1; i--) { + block.body.splice(funcDclrIdxs[i], 1); + } + block.body = funcDclrList.concat(block.body); + } + } + function* hoistVarRecursion(statement, scope) { + switch (statement.type) { + case 'VariableDeclaration': + yield* VariableDeclaration$1(statement, scope, { hoist: true }); + break; + case 'WhileStatement': + case 'DoWhileStatement': + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + yield* hoistVarRecursion(statement.body, scope); + break; + case 'BlockStatement': + for (let i = 0; i < statement.body.length; i++) { + yield* hoistVarRecursion(statement.body[i], scope); + } + break; + case 'SwitchStatement': + for (let i = 0; i < statement.cases.length; i++) { + for (let j = 0; j < statement.cases[i].consequent.length; j++) { + yield* hoistVarRecursion(statement.cases[i].consequent[j], scope); + } + } + break; + case 'TryStatement': { + const tryBlock = statement.block.body; + for (let i = 0; i < tryBlock.length; i++) { + yield* hoistVarRecursion(tryBlock[i], scope); + } + const catchBlock = statement.handler && statement.handler.body.body; + if (catchBlock) { + for (let i = 0; i < catchBlock.length; i++) { + yield* hoistVarRecursion(catchBlock[i], scope); + } + } + const finalBlock = statement.finalizer && statement.finalizer.body; + if (finalBlock) { + for (let i = 0; i < finalBlock.length; i++) { + yield* hoistVarRecursion(finalBlock[i], scope); + } + } + break; + } + } + } + function* pattern$2(node, scope, options = {}) { + switch (node.type) { + case 'ObjectPattern': + return yield* ObjectPattern$1(node, scope, options); + case 'ArrayPattern': + return yield* ArrayPattern$1(node, scope, options); + case 'RestElement': + return yield* RestElement$1(node, scope, options); + case 'AssignmentPattern': + return yield* AssignmentPattern$1(node, scope, options); + default: + throw new SyntaxError('Unexpected token'); + } + } + function createFunc(node, scope, options = {}) { + if (!node.generator && !node.async) { + return createFunc$1(node, scope, options); + } + const { superClass, isCtor } = options; + const params = node.params; + const tmpFunc = function* (...args) { + const subScope = new Scope(scope, true); + if (node.type !== 'ArrowFunctionExpression') { + subScope.const('this', this); + subScope.let('arguments', arguments); + subScope.const(NEWTARGET, new.target); + if (superClass) { + subScope.const(SUPER, superClass); + if (isCtor) + subScope.let(SUPERCALL, false); + } + } + for (let i = 0; i < params.length; i++) { + const param = params[i]; + if (param.type === 'Identifier') { + subScope.let(param.name, args[i]); + } + else if (param.type === 'RestElement') { + yield* RestElement$1(param, subScope, { kind: 'let', feed: args.slice(i) }); + } + else { + yield* pattern$2(param, subScope, { feed: args[i] }); + } + } + let result; + if (node.body.type === 'BlockStatement') { + yield* hoist(node.body, subScope); + result = yield* BlockStatement$1(node.body, subScope, { + invasived: true, + hoisted: true + }); + } + else { + result = yield* evaluate$1(node.body, subScope); + if (node.type === 'ArrowFunctionExpression') { + RETURN.RES = result; + result = RETURN; + } + } + if (result === RETURN) { + return result.RES; + } + }; + let func; + if (node.async && node.generator) { + func = function () { + const iterator = tmpFunc.apply(void 0, arguments); + let last = Promise.resolve(); + let hasCatch = false; + const run = (opts) => last = last + .then(() => runAsync(iterator, assign({ fullRet: true }, opts))) + .catch(err => { + if (!hasCatch) { + hasCatch = true; + return Promise.reject(err); + } + }); + const asyncIterator = { + next: (res) => run({ res }), + throw: (err) => run({ err }), + return: (ret) => run({ ret }) + }; + if (typeof Symbol === 'function') { + asyncIterator[Symbol.iterator] = function () { return this; }; + } + return asyncIterator; + }; + } + else if (node.async) { + func = function () { return runAsync(tmpFunc.apply(void 0, arguments)); }; + } + else { + func = tmpFunc; + } + define(func, NOCTOR, { value: true }); + define(func, 'name', { + value: node.id + && node.id.name + || '', + configurable: true + }); + define(func, 'length', { + value: params.length, + configurable: true + }); + return func; + } + function* createClass(node, scope) { + const superClass = yield* evaluate$1(node.superClass, scope); + let klass = function () { + if (superClass) { + superClass.apply(this); + } + }; + const methodBody = node.body.body; + for (let i = 0; i < methodBody.length; i++) { + const method = methodBody[i]; + if (method.kind === 'constructor') { + klass = createFunc(method.value, scope, { superClass, isCtor: true }); + break; + } + } + if (superClass) { + inherits(klass, superClass); + } + yield* ClassBody$1(node.body, scope, { klass, superClass }); + define(klass, CLSCTOR, { value: true }); + define(klass, 'name', { + value: node.id && node.id.name || '', + configurable: true + }); + return klass; + } + function* ForXHandler(node, scope, options) { + const { value } = options; + const left = node.left; + const subScope = new Scope(scope); + if (left.type === 'VariableDeclaration') { + yield* VariableDeclaration$1(left, subScope, { feed: value }); + } + else if (left.type === 'Identifier') { + const variable = yield* Identifier(left, scope, { getVar: true }); + variable.set(value); + } + else { + yield* pattern$2(left, scope, { feed: value }); + } + let result; + if (node.body.type === 'BlockStatement') { + result = yield* BlockStatement$1(node.body, subScope, { invasived: true }); + } + else { + result = yield* evaluate$1(node.body, subScope); + } + return result; } - function hoist$1(block, scope, options = {}) { - const { onlyBlock = false } = options; - const funcDclrList = []; - const funcDclrIdxs = []; - for (let i = 0; i < block.body.length; i++) { - const statement = block.body[i]; - if (statement.type === 'FunctionDeclaration') { - funcDclrList.push(statement); - funcDclrIdxs.push(i); - } - else if (statement.type === 'VariableDeclaration' - && ['const', 'let'].indexOf(statement.kind) !== -1) { - VariableDeclaration(statement, scope, { hoist: true, onlyBlock: true }); - } - else if (!onlyBlock) { - hoistVarRecursion$1(statement, scope); - } - } - if (funcDclrIdxs.length) { - for (let i = funcDclrIdxs.length - 1; i > -1; i--) { - block.body.splice(funcDclrIdxs[i], 1); - } - block.body = funcDclrList.concat(block.body); - } - } - function hoistVarRecursion$1(statement, scope) { - switch (statement.type) { - case 'VariableDeclaration': - VariableDeclaration(statement, scope, { hoist: true }); - break; - case 'WhileStatement': - case 'DoWhileStatement': - case 'ForStatement': - case 'ForInStatement': - case 'ForOfStatement': - hoistVarRecursion$1(statement.body, scope); - break; - case 'BlockStatement': - for (let i = 0; i < statement.body.length; i++) { - hoistVarRecursion$1(statement.body[i], scope); - } - break; - case 'SwitchStatement': - for (let i = 0; i < statement.cases.length; i++) { - for (let j = 0; j < statement.cases[i].consequent.length; j++) { - hoistVarRecursion$1(statement.cases[i].consequent[j], scope); - } - } - break; - case 'TryStatement': { - const tryBlock = statement.block.body; - for (let i = 0; i < tryBlock.length; i++) { - hoistVarRecursion$1(tryBlock[i], scope); - } - const catchBlock = statement.handler && statement.handler.body.body; - if (catchBlock) { - for (let i = 0; i < catchBlock.length; i++) { - hoistVarRecursion$1(catchBlock[i], scope); - } - } - const finalBlock = statement.finalizer && statement.finalizer.body; - if (finalBlock) { - for (let i = 0; i < finalBlock.length; i++) { - hoistVarRecursion$1(finalBlock[i], scope); - } - } - break; - } - } - } - function pattern$3(node, scope, options = {}) { - switch (node.type) { - case 'ObjectPattern': - return ObjectPattern(node, scope, options); - case 'ArrayPattern': - return ArrayPattern(node, scope, options); - case 'RestElement': - return RestElement(node, scope, options); - case 'AssignmentPattern': - return AssignmentPattern(node, scope, options); - default: - throw new SyntaxError('Unexpected token'); - } - } - function createFunc$1(node, scope, options = {}) { - if (node.generator || node.async) { - return createFunc(node, scope, options); - } - const { superClass } = options; - const params = node.params; - const tmpFunc = function (...args) { - const subScope = new Scope(scope, true); - if (node.type !== 'ArrowFunctionExpression') { - subScope.const('this', this); - subScope.let('arguments', arguments); - subScope.const(NEWTARGET, new.target); - if (superClass) { - subScope.const(SUPER, superClass); - subScope.let(SUPERCALL, false); - } - } - for (let i = 0; i < params.length; i++) { - const param = params[i]; - if (param.type === 'Identifier') { - subScope.let(param.name, args[i]); - } - else if (param.type === 'RestElement') { - RestElement(param, subScope, { kind: 'let', feed: args.slice(i) }); - } - else { - pattern$3(param, subScope, { feed: args[i] }); - } - } - let result; - if (node.body.type === 'BlockStatement') { - hoist$1(node.body, subScope); - result = BlockStatement(node.body, subScope, { - invasived: true, - hoisted: true - }); - } - else { - result = evaluate(node.body, subScope); - if (node.type === 'ArrowFunctionExpression') { - RETURN.RES = result; - result = RETURN; - } - } - if (result === RETURN) { - return result.RES; - } - }; - let func = tmpFunc; - if (node.type === 'ArrowFunctionExpression') { - define(func, NOCTOR, { value: true }); - } - define(func, 'name', { - value: node.id - && node.id.name - || '', - configurable: true - }); - define(func, 'length', { - value: params.length, - configurable: true - }); - return func; - } - function createClass$1(node, scope) { - const superClass = evaluate(node.superClass, scope); - let klass = function () { - if (superClass) { - superClass.apply(this); - } - }; - const methodBody = node.body.body; - for (let i = 0; i < methodBody.length; i++) { - const method = methodBody[i]; - if (method.kind === 'constructor') { - klass = createFunc$1(method.value, scope, { superClass }); - break; - } - } - if (superClass) { - inherits(klass, superClass); - } - ClassBody(node.body, scope, { klass, superClass }); - define(klass, CLSCTOR, { value: true }); - define(klass, 'name', { - value: node.id && node.id.name || '', - configurable: true - }); - return klass; - } - function ForXHandler$1(node, scope, options) { - const { value } = options; - const left = node.left; - const subScope = new Scope(scope); - if (left.type === 'VariableDeclaration') { - VariableDeclaration(left, subScope, { feed: value }); - } - else if (left.type === 'Identifier') { - const variable = Identifier(left, scope, { getVar: true }); - variable.set(value); - } - else { - pattern$3(left, scope, { feed: value }); - } - let result; - if (node.body.type === 'BlockStatement') { - result = BlockStatement(node.body, subScope, { invasived: true }); - } - else { - result = evaluate(node.body, subScope); - } - return result; + function hoist$1(block, scope, options = {}) { + const { onlyBlock = false } = options; + const funcDclrList = []; + const funcDclrIdxs = []; + for (let i = 0; i < block.body.length; i++) { + const statement = block.body[i]; + if (statement.type === 'FunctionDeclaration') { + funcDclrList.push(statement); + funcDclrIdxs.push(i); + } + else if (statement.type === 'VariableDeclaration' + && ['const', 'let'].indexOf(statement.kind) !== -1) { + VariableDeclaration(statement, scope, { hoist: true, onlyBlock: true }); + } + else if (!onlyBlock) { + hoistVarRecursion$1(statement, scope); + } + } + if (funcDclrIdxs.length) { + for (let i = funcDclrIdxs.length - 1; i > -1; i--) { + block.body.splice(funcDclrIdxs[i], 1); + } + block.body = funcDclrList.concat(block.body); + } + } + function hoistVarRecursion$1(statement, scope) { + switch (statement.type) { + case 'VariableDeclaration': + VariableDeclaration(statement, scope, { hoist: true }); + break; + case 'WhileStatement': + case 'DoWhileStatement': + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + hoistVarRecursion$1(statement.body, scope); + break; + case 'BlockStatement': + for (let i = 0; i < statement.body.length; i++) { + hoistVarRecursion$1(statement.body[i], scope); + } + break; + case 'SwitchStatement': + for (let i = 0; i < statement.cases.length; i++) { + for (let j = 0; j < statement.cases[i].consequent.length; j++) { + hoistVarRecursion$1(statement.cases[i].consequent[j], scope); + } + } + break; + case 'TryStatement': { + const tryBlock = statement.block.body; + for (let i = 0; i < tryBlock.length; i++) { + hoistVarRecursion$1(tryBlock[i], scope); + } + const catchBlock = statement.handler && statement.handler.body.body; + if (catchBlock) { + for (let i = 0; i < catchBlock.length; i++) { + hoistVarRecursion$1(catchBlock[i], scope); + } + } + const finalBlock = statement.finalizer && statement.finalizer.body; + if (finalBlock) { + for (let i = 0; i < finalBlock.length; i++) { + hoistVarRecursion$1(finalBlock[i], scope); + } + } + break; + } + } + } + function pattern$3(node, scope, options = {}) { + switch (node.type) { + case 'ObjectPattern': + return ObjectPattern(node, scope, options); + case 'ArrayPattern': + return ArrayPattern(node, scope, options); + case 'RestElement': + return RestElement(node, scope, options); + case 'AssignmentPattern': + return AssignmentPattern(node, scope, options); + default: + throw new SyntaxError('Unexpected token'); + } + } + function createFunc$1(node, scope, options = {}) { + if (node.generator || node.async) { + return createFunc(node, scope, options); + } + const { superClass, isCtor } = options; + const params = node.params; + const tmpFunc = function (...args) { + const subScope = new Scope(scope, true); + if (node.type !== 'ArrowFunctionExpression') { + subScope.const('this', this); + subScope.let('arguments', arguments); + subScope.const(NEWTARGET, new.target); + if (superClass) { + subScope.const(SUPER, superClass); + if (isCtor) + subScope.let(SUPERCALL, false); + } + } + for (let i = 0; i < params.length; i++) { + const param = params[i]; + if (param.type === 'Identifier') { + subScope.let(param.name, args[i]); + } + else if (param.type === 'RestElement') { + RestElement(param, subScope, { kind: 'let', feed: args.slice(i) }); + } + else { + pattern$3(param, subScope, { feed: args[i] }); + } + } + let result; + if (node.body.type === 'BlockStatement') { + hoist$1(node.body, subScope); + result = BlockStatement(node.body, subScope, { + invasived: true, + hoisted: true + }); + } + else { + result = evaluate(node.body, subScope); + if (node.type === 'ArrowFunctionExpression') { + RETURN.RES = result; + result = RETURN; + } + } + if (result === RETURN) { + return result.RES; + } + }; + let func = tmpFunc; + if (node.type === 'ArrowFunctionExpression') { + define(func, NOCTOR, { value: true }); + } + define(func, 'name', { + value: node.id + && node.id.name + || '', + configurable: true + }); + define(func, 'length', { + value: params.length, + configurable: true + }); + return func; + } + function createClass$1(node, scope) { + const superClass = evaluate(node.superClass, scope); + let klass = function () { + if (superClass) { + superClass.apply(this); + } + }; + const methodBody = node.body.body; + for (let i = 0; i < methodBody.length; i++) { + const method = methodBody[i]; + if (method.kind === 'constructor') { + klass = createFunc$1(method.value, scope, { superClass, isCtor: true }); + break; + } + } + if (superClass) { + inherits(klass, superClass); + } + ClassBody(node.body, scope, { klass, superClass }); + define(klass, CLSCTOR, { value: true }); + define(klass, 'name', { + value: node.id && node.id.name || '', + configurable: true + }); + return klass; + } + function ForXHandler$1(node, scope, options) { + const { value } = options; + const left = node.left; + const subScope = new Scope(scope); + if (left.type === 'VariableDeclaration') { + VariableDeclaration(left, subScope, { feed: value }); + } + else if (left.type === 'Identifier') { + const variable = Identifier(left, scope, { getVar: true }); + variable.set(value); + } + else { + pattern$3(left, scope, { feed: value }); + } + let result; + if (node.body.type === 'BlockStatement') { + result = BlockStatement(node.body, subScope, { invasived: true }); + } + else { + result = evaluate(node.body, subScope); + } + return result; } - class Sval { - constructor(options = {}) { - this.options = {}; - this.scope = new Scope(null, true); - this.exports = {}; - let { ecmaVer = 9, sandBox = true } = options; - ecmaVer -= ecmaVer < 2015 ? 0 : 2009; - if ([3, 5, 6, 7, 8, 9, 10].indexOf(ecmaVer) === -1) { - throw new Error(`unsupported ecmaVer`); - } - this.options.ecmaVersion = ecmaVer; - if (sandBox) { - const win = createSandBox(); - this.scope.let('window', win); - this.scope.let('this', win); - } - else { - this.scope.let('window', globalObj); - this.scope.let('this', globalObj); - } - this.scope.const('exports', this.exports = {}); - } - import(nameOrModules, mod) { - if (typeof nameOrModules === 'string') { - nameOrModules = { [nameOrModules]: mod }; - } - if (typeof nameOrModules !== 'object') - return; - const names = getOwnNames(nameOrModules); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - this.scope.var(name, nameOrModules[name]); - } - } - run(code) { - const ast = acorn.parse(code, this.options); - hoist$1(ast, this.scope); - evaluate(ast, this.scope); - } - } + class Sval { + constructor(options = {}) { + this.options = {}; + this.scope = new Scope(null, true); + this.exports = {}; + let { ecmaVer = 9, sandBox = true } = options; + ecmaVer -= ecmaVer < 2015 ? 0 : 2009; + if ([3, 5, 6, 7, 8, 9, 10].indexOf(ecmaVer) === -1) { + throw new Error(`unsupported ecmaVer`); + } + this.options.ecmaVersion = ecmaVer; + if (sandBox) { + const win = createSandBox(); + this.scope.let('window', win); + this.scope.let('this', win); + } + else { + this.scope.let('window', globalObj); + this.scope.let('this', globalObj); + } + this.scope.const('exports', this.exports = {}); + } + import(nameOrModules, mod) { + if (typeof nameOrModules === 'string') { + nameOrModules = { [nameOrModules]: mod }; + } + if (typeof nameOrModules !== 'object') + return; + const names = getOwnNames(nameOrModules); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + this.scope.var(name, nameOrModules[name]); + } + } + run(code) { + const ast = acorn.parse(code, this.options); + hoist$1(ast, this.scope); + evaluate(ast, this.scope); + } + } Sval.version = version; return Sval; diff --git a/dist/sval.js b/dist/sval.js index d15d000..597d5af 100644 --- a/dist/sval.js +++ b/dist/sval.js @@ -21,1202 +21,1082 @@ get MethodDefinition () { return MethodDefinition$1; } }); - var freeze = Object.freeze; - var define = Object.defineProperty; - var getDptor = Object.getOwnPropertyDescriptor; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function hasOwn(obj, key) { - return hasOwnProperty.call(obj, key); - } - var getOwnNames = Object.getOwnPropertyNames; - var setPrototypeOf = Object.setPrototypeOf; - function setProto(obj, proto) { - setPrototypeOf ? setPrototypeOf(obj, proto) : obj.__proto__ = proto; - } - var getPrototypeOf = Object.getPrototypeOf; - function getProto(obj) { - return getPrototypeOf ? getPrototypeOf(obj) : obj.__proto__; - } - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - function getGetterOrSetter(method, obj, key) { - while (obj) { - var descriptor = getOwnPropertyDescriptor(obj, key); - var value = typeof descriptor !== 'undefined' - && typeof descriptor.writable === 'undefined' - && typeof descriptor[method] === 'function' - && descriptor[method]; - if (value) { - return value; - } - else { - obj = getProto(obj); - } - } - } - function getGetter(obj, key) { - return getGetterOrSetter('get', obj, key); - } - function getSetter(obj, key) { - return getGetterOrSetter('set', obj, key); - } - var create = Object.create; - function inherits(subClass, superClass) { - setProto(subClass, superClass); - subClass.prototype = create(superClass.prototype, { - constructor: { - value: subClass, - writable: true, - } - }); - } - function _assign(target) { - for (var i = 1; i < arguments.length; ++i) { - var source = arguments[i]; - for (var key in source) { - if (hasOwn(source, key)) { - target[key] = source[key]; - } - } - } - return target; - } - var assign = Object.assign || _assign; - var names = []; - var globalObj = Object.create(null); - try { - if (!window.Object) - throw 0; - names = getOwnNames(globalObj = window).filter(function (n) { return n !== 'webkitStorageInfo'; }); - } - catch (err) { - try { - if (!global.Object) - throw 0; - names = getOwnNames(globalObj = global).filter(function (n) { return n !== 'GLOBAL' && n !== 'root'; }); - } - catch (err) { - try { - globalObj.Object = Object; - } - catch (err) { } - try { - globalObj.Function = Function; - } - catch (err) { } - try { - globalObj.Array = Array; - } - catch (err) { } - try { - globalObj.Number = Number; - } - catch (err) { } - try { - globalObj.parseFloat = parseFloat; - } - catch (err) { } - try { - globalObj.parseInt = parseInt; - } - catch (err) { } - try { - globalObj.Infinity = Infinity; - } - catch (err) { } - try { - globalObj.NaN = NaN; - } - catch (err) { } - try { - globalObj.undefined = undefined; - } - catch (err) { } - try { - globalObj.Boolean = Boolean; - } - catch (err) { } - try { - globalObj.String = String; - } - catch (err) { } - try { - globalObj.Symbol = Symbol; - } - catch (err) { } - try { - globalObj.Date = Date; - } - catch (err) { } - try { - globalObj.Promise = Promise; - } - catch (err) { } - try { - globalObj.RegExp = RegExp; - } - catch (err) { } - try { - globalObj.Error = Error; - } - catch (err) { } - try { - globalObj.EvalError = EvalError; - } - catch (err) { } - try { - globalObj.RangeError = RangeError; - } - catch (err) { } - try { - globalObj.ReferenceError = ReferenceError; - } - catch (err) { } - try { - globalObj.SyntaxError = SyntaxError; - } - catch (err) { } - try { - globalObj.TypeError = TypeError; - } - catch (err) { } - try { - globalObj.URIError = URIError; - } - catch (err) { } - try { - globalObj.JSON = JSON; - } - catch (err) { } - try { - globalObj.Math = Math; - } - catch (err) { } - try { - globalObj.console = console; - } - catch (err) { } - try { - globalObj.Intl = Intl; - } - catch (err) { } - try { - globalObj.ArrayBuffer = ArrayBuffer; - } - catch (err) { } - try { - globalObj.Uint8Array = Uint8Array; - } - catch (err) { } - try { - globalObj.Int8Array = Int8Array; - } - catch (err) { } - try { - globalObj.Uint16Array = Uint16Array; - } - catch (err) { } - try { - globalObj.Int16Array = Int16Array; - } - catch (err) { } - try { - globalObj.Uint32Array = Uint32Array; - } - catch (err) { } - try { - globalObj.Int32Array = Int32Array; - } - catch (err) { } - try { - globalObj.Float32Array = Float32Array; - } - catch (err) { } - try { - globalObj.Float64Array = Float64Array; - } - catch (err) { } - try { - globalObj.Uint8ClampedArray = Uint8ClampedArray; - } - catch (err) { } - try { - globalObj.DataView = DataView; - } - catch (err) { } - try { - globalObj.Map = Map; - } - catch (err) { } - try { - globalObj.Set = Set; - } - catch (err) { } - try { - globalObj.WeakMap = WeakMap; - } - catch (err) { } - try { - globalObj.WeakSet = WeakSet; - } - catch (err) { } - try { - globalObj.Proxy = Proxy; - } - catch (err) { } - try { - globalObj.Reflect = Reflect; - } - catch (err) { } - try { - globalObj.decodeURI = decodeURI; - } - catch (err) { } - try { - globalObj.decodeURIComponent = decodeURIComponent; - } - catch (err) { } - try { - globalObj.encodeURI = encodeURI; - } - catch (err) { } - try { - globalObj.encodeURIComponent = encodeURIComponent; - } - catch (err) { } - try { - globalObj.escape = escape; - } - catch (err) { } - try { - globalObj.unescape = unescape; - } - catch (err) { } - try { - globalObj.eval = eval; - } - catch (err) { } - try { - globalObj.isFinite = isFinite; - } - catch (err) { } - try { - globalObj.isNaN = isNaN; - } - catch (err) { } - try { - globalObj.SharedArrayBuffer = SharedArrayBuffer; - } - catch (err) { } - try { - globalObj.Atomics = Atomics; - } - catch (err) { } - try { - globalObj.WebAssembly = WebAssembly; - } - catch (err) { } - try { - globalObj.clearInterval = clearInterval; - } - catch (err) { } - try { - globalObj.clearTimeout = clearTimeout; - } - catch (err) { } - try { - globalObj.setInterval = setInterval; - } - catch (err) { } - try { - globalObj.setTimeout = setTimeout; - } - catch (err) { } - try { - globalObj.crypto = crypto; - } - catch (err) { } - names = getOwnNames(globalObj); - } - } - if (globalObj.Symbol) { - !globalObj.Symbol.iterator && (globalObj.Symbol.iterator = createSymbol('iterator')); - !globalObj.Symbol.asyncIterator && (globalObj.Symbol.asyncIterator = createSymbol('asynciterator')); - } - var win = Object.create(null); - for (var i = 0; i < names.length; i++) { - var name_1 = names[i]; - try { - win[name_1] = globalObj[name_1]; - } - catch (err) { } - } - function createSandBox() { - return assign(Object.create(null), win); - } - function createSymbol(key) { - return key + Math.random().toString(36).substring(2); - } - function getAsyncIterator(obj) { - var iterator; - if (typeof Symbol === 'function') { - iterator = obj[Symbol.asyncIterator]; - !iterator && (iterator = obj[Symbol.iterator]); - } - if (iterator) { - return iterator.call(obj); - } - else if (typeof obj.next === 'function') { - return obj; - } - else { - var i_1 = 0; - return { - next: function () { - if (obj && i_1 >= obj.length) - obj = undefined; - return { value: obj && obj[i_1++], done: !obj }; - } - }; - } + var freeze = Object.freeze; + var define = Object.defineProperty; + var getDptor = Object.getOwnPropertyDescriptor; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function hasOwn(obj, key) { + return hasOwnProperty.call(obj, key); + } + var getOwnNames = Object.getOwnPropertyNames; + var setPrototypeOf = Object.setPrototypeOf; + function setProto(obj, proto) { + setPrototypeOf ? setPrototypeOf(obj, proto) : obj.__proto__ = proto; + } + var getPrototypeOf = Object.getPrototypeOf; + function getProto(obj) { + return getPrototypeOf ? getPrototypeOf(obj) : obj.__proto__; + } + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + function getGetterOrSetter(method, obj, key) { + while (obj) { + var descriptor = getOwnPropertyDescriptor(obj, key); + var value = typeof descriptor !== 'undefined' + && typeof descriptor.writable === 'undefined' + && typeof descriptor[method] === 'function' + && descriptor[method]; + if (value) { + return value; + } + else { + obj = getProto(obj); + } + } + } + function getGetter(obj, key) { + return getGetterOrSetter('get', obj, key); + } + function getSetter(obj, key) { + return getGetterOrSetter('set', obj, key); + } + var create = Object.create; + function inherits(subClass, superClass) { + setProto(subClass, superClass); + subClass.prototype = create(superClass.prototype, { + constructor: { + value: subClass, + writable: true, + } + }); + } + function _assign(target) { + for (var i = 1; i < arguments.length; ++i) { + var source = arguments[i]; + for (var key in source) { + if (hasOwn(source, key)) { + target[key] = source[key]; + } + } + } + return target; + } + var assign = Object.assign || _assign; + var names = []; + var globalObj = Object.create(null); + try { + if (!window.Object) + throw 0; + names = getOwnNames(globalObj = window).filter(function (n) { return n !== 'webkitStorageInfo'; }); + } + catch (err) { + try { + if (!global.Object) + throw 0; + names = getOwnNames(globalObj = global).filter(function (n) { return n !== 'GLOBAL' && n !== 'root'; }); + } + catch (err) { + try { + globalObj.Object = Object; + } + catch (err) { } + try { + globalObj.Function = Function; + } + catch (err) { } + try { + globalObj.Array = Array; + } + catch (err) { } + try { + globalObj.Number = Number; + } + catch (err) { } + try { + globalObj.parseFloat = parseFloat; + } + catch (err) { } + try { + globalObj.parseInt = parseInt; + } + catch (err) { } + try { + globalObj.Infinity = Infinity; + } + catch (err) { } + try { + globalObj.NaN = NaN; + } + catch (err) { } + try { + globalObj.undefined = undefined; + } + catch (err) { } + try { + globalObj.Boolean = Boolean; + } + catch (err) { } + try { + globalObj.String = String; + } + catch (err) { } + try { + globalObj.Symbol = Symbol; + } + catch (err) { } + try { + globalObj.Date = Date; + } + catch (err) { } + try { + globalObj.Promise = Promise; + } + catch (err) { } + try { + globalObj.RegExp = RegExp; + } + catch (err) { } + try { + globalObj.Error = Error; + } + catch (err) { } + try { + globalObj.EvalError = EvalError; + } + catch (err) { } + try { + globalObj.RangeError = RangeError; + } + catch (err) { } + try { + globalObj.ReferenceError = ReferenceError; + } + catch (err) { } + try { + globalObj.SyntaxError = SyntaxError; + } + catch (err) { } + try { + globalObj.TypeError = TypeError; + } + catch (err) { } + try { + globalObj.URIError = URIError; + } + catch (err) { } + try { + globalObj.JSON = JSON; + } + catch (err) { } + try { + globalObj.Math = Math; + } + catch (err) { } + try { + globalObj.console = console; + } + catch (err) { } + try { + globalObj.Intl = Intl; + } + catch (err) { } + try { + globalObj.ArrayBuffer = ArrayBuffer; + } + catch (err) { } + try { + globalObj.Uint8Array = Uint8Array; + } + catch (err) { } + try { + globalObj.Int8Array = Int8Array; + } + catch (err) { } + try { + globalObj.Uint16Array = Uint16Array; + } + catch (err) { } + try { + globalObj.Int16Array = Int16Array; + } + catch (err) { } + try { + globalObj.Uint32Array = Uint32Array; + } + catch (err) { } + try { + globalObj.Int32Array = Int32Array; + } + catch (err) { } + try { + globalObj.Float32Array = Float32Array; + } + catch (err) { } + try { + globalObj.Float64Array = Float64Array; + } + catch (err) { } + try { + globalObj.Uint8ClampedArray = Uint8ClampedArray; + } + catch (err) { } + try { + globalObj.DataView = DataView; + } + catch (err) { } + try { + globalObj.Map = Map; + } + catch (err) { } + try { + globalObj.Set = Set; + } + catch (err) { } + try { + globalObj.WeakMap = WeakMap; + } + catch (err) { } + try { + globalObj.WeakSet = WeakSet; + } + catch (err) { } + try { + globalObj.Proxy = Proxy; + } + catch (err) { } + try { + globalObj.Reflect = Reflect; + } + catch (err) { } + try { + globalObj.decodeURI = decodeURI; + } + catch (err) { } + try { + globalObj.decodeURIComponent = decodeURIComponent; + } + catch (err) { } + try { + globalObj.encodeURI = encodeURI; + } + catch (err) { } + try { + globalObj.encodeURIComponent = encodeURIComponent; + } + catch (err) { } + try { + globalObj.escape = escape; + } + catch (err) { } + try { + globalObj.unescape = unescape; + } + catch (err) { } + try { + globalObj.eval = eval; + } + catch (err) { } + try { + globalObj.isFinite = isFinite; + } + catch (err) { } + try { + globalObj.isNaN = isNaN; + } + catch (err) { } + try { + globalObj.SharedArrayBuffer = SharedArrayBuffer; + } + catch (err) { } + try { + globalObj.Atomics = Atomics; + } + catch (err) { } + try { + globalObj.WebAssembly = WebAssembly; + } + catch (err) { } + try { + globalObj.clearInterval = clearInterval; + } + catch (err) { } + try { + globalObj.clearTimeout = clearTimeout; + } + catch (err) { } + try { + globalObj.setInterval = setInterval; + } + catch (err) { } + try { + globalObj.setTimeout = setTimeout; + } + catch (err) { } + try { + globalObj.crypto = crypto; + } + catch (err) { } + names = getOwnNames(globalObj); + } + } + if (globalObj.Symbol) { + !globalObj.Symbol.iterator && (globalObj.Symbol.iterator = createSymbol('iterator')); + !globalObj.Symbol.asyncIterator && (globalObj.Symbol.asyncIterator = createSymbol('asynciterator')); + } + var win = Object.create(null); + for (var i = 0; i < names.length; i++) { + var name_1 = names[i]; + try { + win[name_1] = globalObj[name_1]; + } + catch (err) { } + } + function createSandBox() { + return assign(Object.create(null), win); + } + function createSymbol(key) { + return key + Math.random().toString(36).substring(2); + } + function getAsyncIterator(obj) { + var iterator; + if (typeof Symbol === 'function') { + iterator = obj[Symbol.asyncIterator]; + !iterator && (iterator = obj[Symbol.iterator]); + } + if (iterator) { + return iterator.call(obj); + } + else if (typeof obj.next === 'function') { + return obj; + } + else { + var i_1 = 0; + return { + next: function () { + if (obj && i_1 >= obj.length) + obj = undefined; + return { value: obj && obj[i_1++], done: !obj }; + } + }; + } } - var version = "0.4.5"; + var version = "0.4.6"; - var AWAIT = { RES: undefined }; - var RETURN = { RES: undefined }; - var CONTINUE = createSymbol('continue'); - var BREAK = createSymbol('break'); - var SUPER = createSymbol('super'); - var SUPERCALL = createSymbol('supercall'); - var NOCTOR = createSymbol('noctor'); - var CLSCTOR = createSymbol('clsctor'); - var NEWTARGET = createSymbol('newtarget'); - var NOINIT = createSymbol('noinit'); + var AWAIT = { RES: undefined }; + var RETURN = { RES: undefined }; + var CONTINUE = createSymbol('continue'); + var BREAK = createSymbol('break'); + var SUPER = createSymbol('super'); + var SUPERCALL = createSymbol('supercall'); + var NOCTOR = createSymbol('noctor'); + var CLSCTOR = createSymbol('clsctor'); + var NEWTARGET = createSymbol('newtarget'); + var NOINIT = createSymbol('noinit'); var DEADZONE = createSymbol('deadzone'); - var Var = (function () { - function Var(kind, value) { - this.kind = kind; - this.value = value; - } - Var.prototype.get = function () { - return this.value; - }; - Var.prototype.set = function (value) { - if (this.kind === 'const') { - throw new TypeError('Assignment to constant variable'); - } - else { - return this.value = value; - } - }; - return Var; - }()); - var Prop = (function () { - function Prop(object, property) { - this.object = object; - this.property = property; - } - Prop.prototype.get = function () { - return this.object[this.property]; - }; - Prop.prototype.set = function (value) { - this.object[this.property] = value; - return true; - }; - Prop.prototype.del = function () { - return delete this.object[this.property]; - }; - return Prop; + var Var = (function () { + function Var(kind, value) { + this.kind = kind; + this.value = value; + } + Var.prototype.get = function () { + return this.value; + }; + Var.prototype.set = function (value) { + if (this.kind === 'const') { + throw new TypeError('Assignment to constant variable'); + } + else { + return this.value = value; + } + }; + return Var; + }()); + var Prop = (function () { + function Prop(object, property) { + this.object = object; + this.property = property; + } + Prop.prototype.get = function () { + return this.object[this.property]; + }; + Prop.prototype.set = function (value) { + this.object[this.property] = value; + return true; + }; + Prop.prototype.del = function () { + return delete this.object[this.property]; + }; + return Prop; }()); - var Scope = (function () { - function Scope(parent, isolated) { - if (parent === void 0) { parent = null; } - if (isolated === void 0) { isolated = false; } - this.context = Object.create(null); - this.parent = parent; - this.isolated = isolated; - } - Scope.prototype.global = function () { - var scope = this; - while (scope.parent) { - scope = scope.parent; - } - return scope; - }; - Scope.prototype.clone = function () { - var cloneScope = new Scope(this.parent, this.isolated); - for (var name_1 in this.context) { - var variable = this.context[name_1]; - cloneScope[variable.kind](name_1, variable.get()); - } - return cloneScope; - }; - Scope.prototype.find = function (name) { - if (this.context[name]) { - return this.context[name]; - } - else if (this.parent) { - return this.parent.find(name); - } - else { - var win = this.global().find('window').get(); - if (name in win) { - return new Prop(win, name); - } - else { - return null; - } - } - }; - Scope.prototype.var = function (name, value) { - var scope = this; - while (scope.parent && !scope.isolated) { - scope = scope.parent; - } - var variable = scope.context[name]; - if (!variable) { - scope.context[name] = new Var('var', value === NOINIT ? undefined : value); - } - else { - if (variable.kind === 'var') { - if (value !== NOINIT) { - variable.set(value); - } - } - else { - throw new SyntaxError("Identifier '" + name + "' has already been declared"); - } - } - if (!scope.parent) { - var win = scope.find('window').get(); - if (value !== NOINIT) { - define(win, name, { value: value, writable: true, enumerable: true }); - } - } - }; - Scope.prototype.let = function (name, value) { - var variable = this.context[name]; - if (!variable || variable.get() === DEADZONE) { - this.context[name] = new Var('let', value); - } - else { - throw new SyntaxError("Identifier '" + name + "' has already been declared"); - } - }; - Scope.prototype.const = function (name, value) { - var variable = this.context[name]; - if (!variable || variable.get() === DEADZONE) { - this.context[name] = new Var('const', value); - } - else { - throw new SyntaxError("Identifier '" + name + "' has already been declared"); - } - }; - Scope.prototype.func = function (name, value) { - var variable = this.context[name]; - if (!variable || variable.kind === 'var') { - this.context[name] = new Var('var', value); - } - else { - throw new SyntaxError("Identifier '" + name + "' has already been declared"); - } - }; - return Scope; + var Scope = (function () { + function Scope(parent, isolated) { + if (parent === void 0) { parent = null; } + if (isolated === void 0) { isolated = false; } + this.context = Object.create(null); + this.parent = parent; + this.isolated = isolated; + } + Scope.prototype.global = function () { + var scope = this; + while (scope.parent) { + scope = scope.parent; + } + return scope; + }; + Scope.prototype.clone = function () { + var cloneScope = new Scope(this.parent, this.isolated); + for (var name_1 in this.context) { + var variable = this.context[name_1]; + cloneScope[variable.kind](name_1, variable.get()); + } + return cloneScope; + }; + Scope.prototype.find = function (name) { + if (this.context[name]) { + return this.context[name]; + } + else if (this.parent) { + return this.parent.find(name); + } + else { + var win = this.global().find('window').get(); + if (name in win) { + return new Prop(win, name); + } + else { + return null; + } + } + }; + Scope.prototype.var = function (name, value) { + var scope = this; + while (scope.parent && !scope.isolated) { + scope = scope.parent; + } + var variable = scope.context[name]; + if (!variable) { + scope.context[name] = new Var('var', value === NOINIT ? undefined : value); + } + else { + if (variable.kind === 'var') { + if (value !== NOINIT) { + variable.set(value); + } + } + else { + throw new SyntaxError("Identifier '" + name + "' has already been declared"); + } + } + if (!scope.parent) { + var win = scope.find('window').get(); + if (value !== NOINIT) { + define(win, name, { value: value, writable: true, enumerable: true }); + } + } + }; + Scope.prototype.let = function (name, value) { + var variable = this.context[name]; + if (!variable || variable.get() === DEADZONE) { + this.context[name] = new Var('let', value); + } + else { + throw new SyntaxError("Identifier '" + name + "' has already been declared"); + } + }; + Scope.prototype.const = function (name, value) { + var variable = this.context[name]; + if (!variable || variable.get() === DEADZONE) { + this.context[name] = new Var('const', value); + } + else { + throw new SyntaxError("Identifier '" + name + "' has already been declared"); + } + }; + Scope.prototype.func = function (name, value) { + var variable = this.context[name]; + if (!variable || variable.kind === 'var') { + this.context[name] = new Var('var', value); + } + else { + throw new SyntaxError("Identifier '" + name + "' has already been declared"); + } + }; + return Scope; }()); - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - - function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - - function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; - } - - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - - function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - } - - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - } - - function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - - function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - } - - function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - } - - function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - } - - function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - } - - function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + } + + function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + } + + function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; } - function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - } - - function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - } - - function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - } - - function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - } - - function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - } - function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; - } - - function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; - } - - var tslib_1 = /*#__PURE__*/Object.freeze({ - __extends: __extends, - get __assign () { return __assign; }, - __rest: __rest, - __decorate: __decorate, - __param: __param, - __metadata: __metadata, - __awaiter: __awaiter, - __generator: __generator, - __exportStar: __exportStar, - __values: __values, - __read: __read, - __spread: __spread, - __await: __await, - __asyncGenerator: __asyncGenerator, - __asyncDelegator: __asyncDelegator, - __asyncValues: __asyncValues, - __makeTemplateObject: __makeTemplateObject, - __importStar: __importStar, - __importDefault: __importDefault - }); - - function Identifier(node, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.getVar, getVar = _a === void 0 ? false : _a, _b = options.throwErr, throwErr = _b === void 0 ? true : _b; - if (node.name === 'undefined') { - return undefined; - } - var variable = scope.find(node.name); - if (variable) { - if (getVar) { - return variable; - } - else { - var value = variable.get(); - if (value === DEADZONE) { - throw new ReferenceError(node.name + " is not defined"); - } - else { - return value; - } - } - } - else if (throwErr) { - throw new ReferenceError(node.name + " is not defined"); - } - else { - return undefined; - } + function Identifier(node, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.getVar, getVar = _a === void 0 ? false : _a, _b = options.throwErr, throwErr = _b === void 0 ? true : _b; + if (node.name === 'undefined') { + return undefined; + } + var variable = scope.find(node.name); + if (variable) { + if (getVar) { + return variable; + } + else { + var value = variable.get(); + if (value === DEADZONE) { + throw new ReferenceError(node.name + " is not defined"); + } + else { + return value; + } + } + } + else if (throwErr) { + throw new ReferenceError(node.name + " is not defined"); + } + else { + return undefined; + } } var identifier = /*#__PURE__*/Object.freeze({ Identifier: Identifier }); - function Literal(node, scope) { - return node.value; + function Literal(node, scope) { + return node.value; } var literal = /*#__PURE__*/Object.freeze({ Literal: Literal }); - function ThisExpression(node, scope) { - var superCall = scope.find(SUPERCALL); - if (superCall && !superCall.get()) { - throw new ReferenceError('Must call super constructor in derived class' - + 'before accessing \'this\' or returning from derived constructor'); - } - else { - return scope.find('this').get(); - } - } - function ArrayExpression(node, scope) { - var results = []; - for (var i = 0; i < node.elements.length; i++) { - var item = node.elements[i]; - if (item.type === 'SpreadElement') { - results = results.concat(SpreadElement(item, scope)); - } - else { - results.push(evaluate(item, scope)); - } - } - return results; - } - function ObjectExpression(node, scope) { - var object = {}; - for (var i = 0; i < node.properties.length; i++) { - var property = node.properties[i]; - if (property.type === 'SpreadElement') { - assign(object, SpreadElement(property, scope)); - } - else { - var key = void 0; - var propKey = property.key; - if (property.computed) { - key = evaluate(propKey, scope); - } - else { - if (propKey.type === 'Identifier') { - key = propKey.name; - } - else { - key = '' + (Literal(propKey, scope)); - } - } - var value = evaluate(property.value, scope); - var propKind = property.kind; - if (propKind === 'init') { - object[key] = value; - } - else if (propKind === 'get') { - define(object, key, { get: value }); - } - else { - define(object, key, { set: value }); - } - } - } - return object; - } - function FunctionExpression(node, scope) { - if (node.id && node.id.name) { - var tmpScope = new Scope(scope); - var func = createFunc$1(node, tmpScope); - tmpScope.const(node.id.name, func); - return func; - } - else { - return createFunc$1(node, scope); - } - } - function UnaryExpression(node, scope) { - var arg = node.argument; - switch (node.operator) { - case '+': return +(evaluate(arg, scope)); - case '-': return -(evaluate(arg, scope)); - case '!': return !(evaluate(arg, scope)); - case '~': return ~(evaluate(arg, scope)); - case 'void': return void (evaluate(arg, scope)); - case 'typeof': - if (arg.type === 'Identifier') { - return typeof (Identifier(arg, scope, { throwErr: false })); - } - else { - return typeof (evaluate(arg, scope)); - } - case 'delete': - if (arg.type === 'MemberExpression') { - var variable = MemberExpression(arg, scope, { getVar: true }); - return variable.del(); - } - else if (arg.type === 'Identifier') { - var win = scope.global().find('window').get(); - return delete win[arg.name]; - } - else { - throw new SyntaxError('Unexpected token'); - } - default: throw new SyntaxError("Unexpected token " + node.operator); - } - } - function UpdateExpression(node, scope) { - var arg = node.argument; - var variable; - if (arg.type === 'Identifier') { - variable = Identifier(arg, scope, { getVar: true }); - } - else if (arg.type === 'MemberExpression') { - variable = MemberExpression(arg, scope, { getVar: true }); - } - else { - throw new SyntaxError('Unexpected token'); - } - var value = variable.get(); - if (node.operator === '++') { - variable.set(value + 1); - return node.prefix ? variable.get() : value; - } - else if (node.operator === '--') { - variable.set(value - 1); - return node.prefix ? variable.get() : value; - } - else { - throw new SyntaxError("Unexpected token " + node.operator); - } - } - function BinaryExpression(node, scope) { - var left = evaluate(node.left, scope); - var right = evaluate(node.right, scope); - switch (node.operator) { - case '==': return left == right; - case '!=': return left != right; - case '===': return left === right; - case '!==': return left !== right; - case '<': return left < right; - case '<=': return left <= right; - case '>': return left > right; - case '>=': return left >= right; - case '<<': return left << right; - case '>>': return left >> right; - case '>>>': return left >>> right; - case '+': return left + right; - case '-': return left - right; - case '*': return left * right; - case '**': return Math.pow(left, right); - case '/': return left / right; - case '%': return left % right; - case '|': return left | right; - case '^': return left ^ right; - case '&': return left & right; - case 'in': return left in right; - case 'instanceof': return left instanceof right; - default: throw new SyntaxError("Unexpected token " + node.operator); - } - } - function AssignmentExpression(node, scope) { - var value = evaluate(node.right, scope); - var left = node.left; - var variable; - if (left.type === 'Identifier') { - variable = Identifier(left, scope, { getVar: true, throwErr: false }); - if (!variable) { - var win = scope.global().find('window').get(); - variable = new Prop(win, left.name); - } - } - else if (left.type === 'MemberExpression') { - variable = MemberExpression(left, scope, { getVar: true }); - } - else { - return pattern$3(left, scope, { feed: value }); - } - switch (node.operator) { - case '=': - variable.set(value); - return variable.get(); - case '+=': - variable.set(variable.get() + value); - return variable.get(); - case '-=': - variable.set(variable.get() - value); - return variable.get(); - case '*=': - variable.set(variable.get() * value); - return variable.get(); - case '/=': - variable.set(variable.get() / value); - return variable.get(); - case '%=': - variable.set(variable.get() % value); - return variable.get(); - case '**=': - variable.set(Math.pow(variable.get(), value)); - return variable.get(); - case '<<=': - variable.set(variable.get() << value); - return variable.get(); - case '>>=': - variable.set(variable.get() >> value); - return variable.get(); - case '>>>=': - variable.set(variable.get() >>> value); - return variable.get(); - case '|=': - variable.set(variable.get() | value); - return variable.get(); - case '^=': - variable.set(variable.get() ^ value); - return variable.get(); - case '&=': - variable.set(variable.get() & value); - return variable.get(); - default: throw new SyntaxError("Unexpected token " + node.operator); - } - } - function LogicalExpression(node, scope) { - switch (node.operator) { - case '||': - return (evaluate(node.left, scope)) || (evaluate(node.right, scope)); - case '&&': - return (evaluate(node.left, scope)) && (evaluate(node.right, scope)); - default: - throw new SyntaxError("Unexpected token " + node.operator); - } - } - function MemberExpression(node, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.getObj, getObj = _a === void 0 ? false : _a, _b = options.getVar, getVar = _b === void 0 ? false : _b; - var object; - if (node.object.type === 'Super') { - object = Super(node.object, scope, { getProto: true }); - } - else { - object = evaluate(node.object, scope); - } - if (getObj) - return object; - var key; - if (node.computed) { - key = evaluate(node.property, scope); - } - else { - key = node.property.name; - } - if (getVar) { - var setter = getSetter(object, key); - if (node.object.type === 'Super' && setter) { - var thisObject = scope.find('this').get(); - var privateKey = createSymbol(key); - define(thisObject, privateKey, { set: setter }); - return new Prop(thisObject, privateKey); - } - else { - return new Prop(object, key); - } - } - else { - var getter = getGetter(object, key); - if (node.object.type === 'Super' && getter) { - var thisObject = scope.find('this').get(); - return getter.call(thisObject); - } - else { - return object[key]; - } - } - } - function ConditionalExpression(node, scope) { - return (evaluate(node.test, scope)) - ? (evaluate(node.consequent, scope)) - : (evaluate(node.alternate, scope)); - } - function CallExpression(node, scope) { - var func; - var object; - if (node.callee.type === 'MemberExpression') { - object = MemberExpression(node.callee, scope, { getObj: true }); - var key = void 0; - if (node.callee.computed) { - key = evaluate(node.callee.property, scope); - } - else { - key = node.callee.property.name; - } - var getter = getGetter(object, key); - if (node.callee.object.type === 'Super' && getter) { - var thisObject = scope.find('this').get(); - func = getter.call(thisObject); - } - else { - func = object[key]; - } - if (typeof func !== 'function') { - throw new TypeError(key + " is not a function"); - } - else if (func[CLSCTOR]) { - throw new TypeError("Class constructor " + key + " cannot be invoked without 'new'"); - } - } - else { - object = scope.find('this').get(); - func = evaluate(node.callee, scope); - if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { - var name_1; - if (node.callee.type === 'Identifier') { - name_1 = node.callee.name; - } - else { - try { - name_1 = JSON.stringify(func); - } - catch (err) { - name_1 = '' + func; - } - } - if (typeof func !== 'function') { - throw new TypeError(name_1 + " is not a function"); - } - else { - throw new TypeError("Class constructor " + name_1 + " cannot be invoked without 'new'"); - } - } - } - var args = []; - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - if (arg.type === 'SpreadElement') { - args = args.concat(SpreadElement(arg, scope)); - } - else { - args.push(evaluate(arg, scope)); - } - } - if (node.callee.type === 'Super') { - var superCall = scope.find(SUPERCALL); - if (superCall.get()) { - throw new ReferenceError('Super constructor may only be called once'); - } - else { - scope.find(SUPERCALL).set(true); - } - } - return func.apply(object, args); - } - function NewExpression(node, scope) { - var constructor = evaluate(node.callee, scope); - if (typeof constructor !== 'function') { - var name_2; - if (node.callee.type === 'Identifier') { - name_2 = node.callee.name; - } - else { - try { - name_2 = JSON.stringify(constructor); - } - catch (err) { - name_2 = '' + constructor; - } - } - throw new TypeError(name_2 + " is not a constructor"); - } - else if (constructor[NOCTOR]) { - throw new TypeError((constructor.name || '(intermediate value)') + " is not a constructor"); - } - var args = []; - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - if (arg.type === 'SpreadElement') { - args = args.concat(SpreadElement(arg, scope)); - } - else { - args.push(evaluate(arg, scope)); - } - } - return new (constructor.bind.apply(constructor, __spread([void 0], args)))(); - } - function MetaProperty(node, scope) { - return scope.find(NEWTARGET).get(); - } - function SequenceExpression(node, scope) { - var result; - for (var i = 0; i < node.expressions.length; i++) { - result = evaluate(node.expressions[i], scope); - } - return result; - } - function ArrowFunctionExpression(node, scope) { - return createFunc$1(node, scope); - } - function TemplateLiteral(node, scope) { - var quasis = node.quasis; - var expressions = node.expressions; - var result = ''; - var temEl; - var expr; - while (temEl = quasis.shift()) { - result += TemplateElement(temEl, scope); - expr = expressions.shift(); - if (expr) { - result += evaluate(expr, scope); - } - } - return result; - } - function TaggedTemplateExpression(node, scope) { - var tagFunc = evaluate(node.tag, scope); - var quasis = node.quasi.quasis; - var str = quasis.map(function (v) { return v.value.cooked; }); - var raw = quasis.map(function (v) { return v.value.raw; }); - define(str, 'raw', { - value: freeze(raw) - }); - var expressions = node.quasi.expressions; - var args = []; - if (expressions) { - for (var i = 0; i < expressions.length; i++) { - args.push(evaluate(expressions[i], scope)); - } - } - return tagFunc.apply(void 0, __spread([freeze(str)], args)); - } - function TemplateElement(node, scope) { - return node.value.raw; - } - function ClassExpression(node, scope) { - if (node.id && node.id.name) { - var tmpScope = new Scope(scope); - var klass = createClass$1(node, tmpScope); - tmpScope.const(node.id.name, klass); - return klass; - } - else { - return createClass$1(node, scope); - } - } - function Super(node, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.getProto, getProto = _a === void 0 ? false : _a; - var superClass = scope.find(SUPER).get(); - return getProto ? superClass.prototype : superClass; - } - function SpreadElement(node, scope) { - return evaluate(node.argument, scope); + function ThisExpression(node, scope) { + var superCall = scope.find(SUPERCALL); + if (superCall && !superCall.get()) { + throw new ReferenceError('Must call super constructor in derived class ' + + 'before accessing \'this\' or returning from derived constructor'); + } + else { + return scope.find('this').get(); + } + } + function ArrayExpression(node, scope) { + var results = []; + for (var i = 0; i < node.elements.length; i++) { + var item = node.elements[i]; + if (item.type === 'SpreadElement') { + results = results.concat(SpreadElement(item, scope)); + } + else { + results.push(evaluate(item, scope)); + } + } + return results; + } + function ObjectExpression(node, scope) { + var object = {}; + for (var i = 0; i < node.properties.length; i++) { + var property = node.properties[i]; + if (property.type === 'SpreadElement') { + assign(object, SpreadElement(property, scope)); + } + else { + var key = void 0; + var propKey = property.key; + if (property.computed) { + key = evaluate(propKey, scope); + } + else { + if (propKey.type === 'Identifier') { + key = propKey.name; + } + else { + key = '' + (Literal(propKey)); + } + } + var value = evaluate(property.value, scope); + var propKind = property.kind; + if (propKind === 'init') { + object[key] = value; + } + else if (propKind === 'get') { + var oriDptor = getDptor(object, key); + define(object, key, { + get: value, + set: oriDptor && oriDptor.set, + enumerable: true, + configurable: true + }); + } + else { + var oriDptor = getDptor(object, key); + define(object, key, { + get: oriDptor && oriDptor.get, + set: value, + enumerable: true, + configurable: true + }); + } + } + } + return object; + } + function FunctionExpression(node, scope) { + if (node.id && node.id.name) { + var tmpScope = new Scope(scope); + var func = createFunc$1(node, tmpScope); + tmpScope.const(node.id.name, func); + return func; + } + else { + return createFunc$1(node, scope); + } + } + function UnaryExpression(node, scope) { + var arg = node.argument; + switch (node.operator) { + case '+': return +(evaluate(arg, scope)); + case '-': return -(evaluate(arg, scope)); + case '!': return !(evaluate(arg, scope)); + case '~': return ~(evaluate(arg, scope)); + case 'void': return void (evaluate(arg, scope)); + case 'typeof': + if (arg.type === 'Identifier') { + return typeof (Identifier(arg, scope, { throwErr: false })); + } + else { + return typeof (evaluate(arg, scope)); + } + case 'delete': + if (arg.type === 'MemberExpression') { + var variable = MemberExpression(arg, scope, { getVar: true }); + return variable.del(); + } + else if (arg.type === 'Identifier') { + throw new SyntaxError('Delete of an unqualified identifier in strict mode'); + } + else { + evaluate(arg, scope); + return true; + } + default: throw new SyntaxError("Unexpected token " + node.operator); + } + } + function UpdateExpression(node, scope) { + var arg = node.argument; + var variable; + if (arg.type === 'Identifier') { + variable = Identifier(arg, scope, { getVar: true }); + } + else if (arg.type === 'MemberExpression') { + variable = MemberExpression(arg, scope, { getVar: true }); + } + else { + throw new SyntaxError('Unexpected token'); + } + var value = variable.get(); + if (node.operator === '++') { + variable.set(value + 1); + return node.prefix ? variable.get() : value; + } + else if (node.operator === '--') { + variable.set(value - 1); + return node.prefix ? variable.get() : value; + } + else { + throw new SyntaxError("Unexpected token " + node.operator); + } + } + function BinaryExpression(node, scope) { + var left = evaluate(node.left, scope); + var right = evaluate(node.right, scope); + switch (node.operator) { + case '==': return left == right; + case '!=': return left != right; + case '===': return left === right; + case '!==': return left !== right; + case '<': return left < right; + case '<=': return left <= right; + case '>': return left > right; + case '>=': return left >= right; + case '<<': return left << right; + case '>>': return left >> right; + case '>>>': return left >>> right; + case '+': return left + right; + case '-': return left - right; + case '*': return left * right; + case '**': return Math.pow(left, right); + case '/': return left / right; + case '%': return left % right; + case '|': return left | right; + case '^': return left ^ right; + case '&': return left & right; + case 'in': return left in right; + case 'instanceof': return left instanceof right; + default: throw new SyntaxError("Unexpected token " + node.operator); + } + } + function AssignmentExpression(node, scope) { + var value = evaluate(node.right, scope); + var left = node.left; + var variable; + if (left.type === 'Identifier') { + variable = Identifier(left, scope, { getVar: true, throwErr: false }); + if (!variable) { + var win = scope.global().find('window').get(); + variable = new Prop(win, left.name); + } + } + else if (left.type === 'MemberExpression') { + variable = MemberExpression(left, scope, { getVar: true }); + } + else { + return pattern$3(left, scope, { feed: value }); + } + switch (node.operator) { + case '=': + variable.set(value); + return variable.get(); + case '+=': + variable.set(variable.get() + value); + return variable.get(); + case '-=': + variable.set(variable.get() - value); + return variable.get(); + case '*=': + variable.set(variable.get() * value); + return variable.get(); + case '/=': + variable.set(variable.get() / value); + return variable.get(); + case '%=': + variable.set(variable.get() % value); + return variable.get(); + case '**=': + variable.set(Math.pow(variable.get(), value)); + return variable.get(); + case '<<=': + variable.set(variable.get() << value); + return variable.get(); + case '>>=': + variable.set(variable.get() >> value); + return variable.get(); + case '>>>=': + variable.set(variable.get() >>> value); + return variable.get(); + case '|=': + variable.set(variable.get() | value); + return variable.get(); + case '^=': + variable.set(variable.get() ^ value); + return variable.get(); + case '&=': + variable.set(variable.get() & value); + return variable.get(); + default: throw new SyntaxError("Unexpected token " + node.operator); + } + } + function LogicalExpression(node, scope) { + switch (node.operator) { + case '||': + return (evaluate(node.left, scope)) || (evaluate(node.right, scope)); + case '&&': + return (evaluate(node.left, scope)) && (evaluate(node.right, scope)); + default: + throw new SyntaxError("Unexpected token " + node.operator); + } + } + function MemberExpression(node, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.getObj, getObj = _a === void 0 ? false : _a, _b = options.getVar, getVar = _b === void 0 ? false : _b; + var object; + if (node.object.type === 'Super') { + object = Super(node.object, scope, { getProto: true }); + } + else { + object = evaluate(node.object, scope); + } + if (getObj) + return object; + var key; + if (node.computed) { + key = evaluate(node.property, scope); + } + else { + key = node.property.name; + } + if (getVar) { + var setter = getSetter(object, key); + if (node.object.type === 'Super' && setter) { + var thisObject = scope.find('this').get(); + var privateKey = createSymbol(key); + define(thisObject, privateKey, { set: setter }); + return new Prop(thisObject, privateKey); + } + else { + return new Prop(object, key); + } + } + else { + var getter = getGetter(object, key); + if (node.object.type === 'Super' && getter) { + var thisObject = scope.find('this').get(); + return getter.call(thisObject); + } + else { + return object[key]; + } + } + } + function ConditionalExpression(node, scope) { + return (evaluate(node.test, scope)) + ? (evaluate(node.consequent, scope)) + : (evaluate(node.alternate, scope)); + } + function CallExpression(node, scope) { + var func; + var object; + if (node.callee.type === 'MemberExpression') { + object = MemberExpression(node.callee, scope, { getObj: true }); + var key = void 0; + if (node.callee.computed) { + key = evaluate(node.callee.property, scope); + } + else { + key = node.callee.property.name; + } + if (node.callee.object.type === 'Super') { + var thisObject = scope.find('this').get(); + func = object[key].bind(thisObject); + } + else { + func = object[key]; + } + if (typeof func !== 'function') { + throw new TypeError(key + " is not a function"); + } + else if (func[CLSCTOR]) { + throw new TypeError("Class constructor " + key + " cannot be invoked without 'new'"); + } + } + else { + object = scope.find('this').get(); + func = evaluate(node.callee, scope); + if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { + var name_1; + if (node.callee.type === 'Identifier') { + name_1 = node.callee.name; + } + else { + try { + name_1 = JSON.stringify(func); + } + catch (err) { + name_1 = '' + func; + } + } + if (typeof func !== 'function') { + throw new TypeError(name_1 + " is not a function"); + } + else { + throw new TypeError("Class constructor " + name_1 + " cannot be invoked without 'new'"); + } + } + } + var args = []; + for (var i = 0; i < node.arguments.length; i++) { + var arg = node.arguments[i]; + if (arg.type === 'SpreadElement') { + args = args.concat(SpreadElement(arg, scope)); + } + else { + args.push(evaluate(arg, scope)); + } + } + if (node.callee.type === 'Super') { + var superCall = scope.find(SUPERCALL); + if (superCall.get()) { + throw new ReferenceError('Super constructor may only be called once'); + } + else { + scope.find(SUPERCALL).set(true); + } + } + return func.apply(object, args); + } + function NewExpression(node, scope) { + var constructor = evaluate(node.callee, scope); + if (typeof constructor !== 'function') { + var name_2; + if (node.callee.type === 'Identifier') { + name_2 = node.callee.name; + } + else { + try { + name_2 = JSON.stringify(constructor); + } + catch (err) { + name_2 = '' + constructor; + } + } + throw new TypeError(name_2 + " is not a constructor"); + } + else if (constructor[NOCTOR]) { + throw new TypeError((constructor.name || '(intermediate value)') + " is not a constructor"); + } + var args = []; + for (var i = 0; i < node.arguments.length; i++) { + var arg = node.arguments[i]; + if (arg.type === 'SpreadElement') { + args = args.concat(SpreadElement(arg, scope)); + } + else { + args.push(evaluate(arg, scope)); + } + } + return new (constructor.bind.apply(constructor, __spread([void 0], args)))(); + } + function MetaProperty(node, scope) { + return scope.find(NEWTARGET).get(); + } + function SequenceExpression(node, scope) { + var result; + for (var i = 0; i < node.expressions.length; i++) { + result = evaluate(node.expressions[i], scope); + } + return result; + } + function ArrowFunctionExpression(node, scope) { + return createFunc$1(node, scope); + } + function TemplateLiteral(node, scope) { + var quasis = node.quasis; + var expressions = node.expressions; + var result = ''; + var temEl; + var expr; + while (temEl = quasis.shift()) { + result += TemplateElement(temEl); + expr = expressions.shift(); + if (expr) { + result += evaluate(expr, scope); + } + } + return result; + } + function TaggedTemplateExpression(node, scope) { + var tagFunc = evaluate(node.tag, scope); + var quasis = node.quasi.quasis; + var str = quasis.map(function (v) { return v.value.cooked; }); + var raw = quasis.map(function (v) { return v.value.raw; }); + define(str, 'raw', { + value: freeze(raw) + }); + var expressions = node.quasi.expressions; + var args = []; + if (expressions) { + for (var i = 0; i < expressions.length; i++) { + args.push(evaluate(expressions[i], scope)); + } + } + return tagFunc.apply(void 0, __spread([freeze(str)], args)); + } + function TemplateElement(node, scope) { + return node.value.raw; + } + function ClassExpression(node, scope) { + if (node.id && node.id.name) { + var tmpScope = new Scope(scope); + var klass = createClass$1(node, tmpScope); + tmpScope.const(node.id.name, klass); + return klass; + } + else { + return createClass$1(node, scope); + } + } + function Super(node, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.getProto, getProto = _a === void 0 ? false : _a; + var superClass = scope.find(SUPER).get(); + return getProto ? superClass.prototype : superClass; + } + function SpreadElement(node, scope) { + return evaluate(node.argument, scope); } var expression = /*#__PURE__*/Object.freeze({ @@ -1244,199 +1124,199 @@ SpreadElement: SpreadElement }); - function ExpressionStatement(node, scope) { - evaluate(node.expression, scope); - } - function BlockStatement(block, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.invasived, invasived = _a === void 0 ? false : _a, _b = options.hoisted, hoisted = _b === void 0 ? false : _b; - var subScope = invasived ? scope : new Scope(scope); - if (!hoisted) { - hoist$1(block, subScope, { onlyBlock: true }); - } - for (var i = 0; i < block.body.length; i++) { - var result = evaluate(block.body[i], subScope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - function EmptyStatement() { - } - function DebuggerStatement() { - debugger; - } - function ReturnStatement(node, scope) { - RETURN.RES = node.argument ? (evaluate(node.argument, scope)) : undefined; - return RETURN; - } - function BreakStatement() { - return BREAK; - } - function ContinueStatement() { - return CONTINUE; - } - function IfStatement(node, scope) { - if (evaluate(node.test, scope)) { - return evaluate(node.consequent, scope); - } - else { - return evaluate(node.alternate, scope); - } - } - function SwitchStatement(node, scope) { - var discriminant = evaluate(node.discriminant, scope); - var matched = false; - for (var i = 0; i < node.cases.length; i++) { - var eachCase = node.cases[i]; - if (!matched - && (!eachCase.test - || (evaluate(eachCase.test, scope)) === discriminant)) { - matched = true; - } - if (matched) { - var result = SwitchCase(eachCase, scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - } - function SwitchCase(node, scope) { - for (var i = 0; i < node.consequent.length; i++) { - var result = evaluate(node.consequent[i], scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - function ThrowStatement(node, scope) { - throw evaluate(node.argument, scope); - } - function TryStatement(node, scope) { - try { - return BlockStatement(node.block, scope); - } - catch (err) { - if (node.handler) { - var subScope = new Scope(scope); - var param = node.handler.param; - if (param) { - if (param.type === 'Identifier') { - var name_1 = param.name; - subScope.let(name_1, err); - } - else { - pattern$3(param, scope, { feed: err }); - } - } - return CatchClause(node.handler, subScope); - } - else { - throw err; - } - } - finally { - if (node.finalizer) { - var result = BlockStatement(node.finalizer, scope); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return result; - } - } - } - } - function CatchClause(node, scope) { - return BlockStatement(node.body, scope, { invasived: true }); - } - function WhileStatement(node, scope) { - while (evaluate(node.test, scope)) { - var result = evaluate(node.body, scope); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function DoWhileStatement(node, scope) { - do { - var result = evaluate(node.body, scope); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } while (evaluate(node.test, scope)); - } - function ForStatement(node, scope) { - var forScope = new Scope(scope); - for (evaluate(node.init, forScope); node.test ? (evaluate(node.test, forScope)) : true; evaluate(node.update, forScope)) { - var subScope = new Scope(forScope); - var result = void 0; - if (node.body.type === 'BlockStatement') { - result = BlockStatement(node.body, subScope, { invasived: true }); - } - else { - result = evaluate(node.body, subScope); - } - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function ForInStatement(node, scope) { - for (var value in evaluate(node.right, scope)) { - var result = ForXHandler$1(node, scope, { value: value }); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - function ForOfStatement(node, scope) { - var e_1, _a; - var right = evaluate(node.right, scope); - try { - for (var right_1 = __values(right), right_1_1 = right_1.next(); !right_1_1.done; right_1_1 = right_1.next()) { - var value = right_1_1.value; - var result = ForXHandler$1(node, scope, { value: value }); - if (result === BREAK) { - break; - } - else if (result === CONTINUE) { - continue; - } - else if (result === RETURN) { - return result; - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (right_1_1 && !right_1_1.done && (_a = right_1.return)) _a.call(right_1); - } - finally { if (e_1) throw e_1.error; } - } + function ExpressionStatement(node, scope) { + evaluate(node.expression, scope); + } + function BlockStatement(block, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.invasived, invasived = _a === void 0 ? false : _a, _b = options.hoisted, hoisted = _b === void 0 ? false : _b; + var subScope = invasived ? scope : new Scope(scope); + if (!hoisted) { + hoist$1(block, subScope, { onlyBlock: true }); + } + for (var i = 0; i < block.body.length; i++) { + var result = evaluate(block.body[i], subScope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + function EmptyStatement() { + } + function DebuggerStatement() { + debugger; + } + function ReturnStatement(node, scope) { + RETURN.RES = node.argument ? (evaluate(node.argument, scope)) : undefined; + return RETURN; + } + function BreakStatement() { + return BREAK; + } + function ContinueStatement() { + return CONTINUE; + } + function IfStatement(node, scope) { + if (evaluate(node.test, scope)) { + return evaluate(node.consequent, scope); + } + else { + return evaluate(node.alternate, scope); + } + } + function SwitchStatement(node, scope) { + var discriminant = evaluate(node.discriminant, scope); + var matched = false; + for (var i = 0; i < node.cases.length; i++) { + var eachCase = node.cases[i]; + if (!matched + && (!eachCase.test + || (evaluate(eachCase.test, scope)) === discriminant)) { + matched = true; + } + if (matched) { + var result = SwitchCase(eachCase, scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + } + function SwitchCase(node, scope) { + for (var i = 0; i < node.consequent.length; i++) { + var result = evaluate(node.consequent[i], scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + function ThrowStatement(node, scope) { + throw evaluate(node.argument, scope); + } + function TryStatement(node, scope) { + try { + return BlockStatement(node.block, scope); + } + catch (err) { + if (node.handler) { + var subScope = new Scope(scope); + var param = node.handler.param; + if (param) { + if (param.type === 'Identifier') { + var name_1 = param.name; + subScope.let(name_1, err); + } + else { + pattern$3(param, scope, { feed: err }); + } + } + return CatchClause(node.handler, subScope); + } + else { + throw err; + } + } + finally { + if (node.finalizer) { + var result = BlockStatement(node.finalizer, scope); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return result; + } + } + } + } + function CatchClause(node, scope) { + return BlockStatement(node.body, scope, { invasived: true }); + } + function WhileStatement(node, scope) { + while (evaluate(node.test, scope)) { + var result = evaluate(node.body, scope); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function DoWhileStatement(node, scope) { + do { + var result = evaluate(node.body, scope); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } while (evaluate(node.test, scope)); + } + function ForStatement(node, scope) { + var forScope = new Scope(scope); + for (evaluate(node.init, forScope); node.test ? (evaluate(node.test, forScope)) : true; evaluate(node.update, forScope)) { + var subScope = new Scope(forScope); + var result = void 0; + if (node.body.type === 'BlockStatement') { + result = BlockStatement(node.body, subScope, { invasived: true }); + } + else { + result = evaluate(node.body, subScope); + } + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function ForInStatement(node, scope) { + for (var value in evaluate(node.right, scope)) { + var result = ForXHandler$1(node, scope, { value: value }); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + function ForOfStatement(node, scope) { + var e_1, _a; + var right = evaluate(node.right, scope); + try { + for (var right_1 = __values(right), right_1_1 = right_1.next(); !right_1_1.done; right_1_1 = right_1.next()) { + var value = right_1_1.value; + var result = ForXHandler$1(node, scope, { value: value }); + if (result === BREAK) { + break; + } + else if (result === CONTINUE) { + continue; + } + else if (result === RETURN) { + return result; + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (right_1_1 && !right_1_1.done && (_a = right_1.return)) _a.call(right_1); + } + finally { if (e_1) throw e_1.error; } + } } var statement = /*#__PURE__*/Object.freeze({ @@ -1460,139 +1340,139 @@ ForOfStatement: ForOfStatement }); - function ObjectPattern(node, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed, feed = _d === void 0 ? {} : _d; - var fedKeys = []; - for (var i = 0; i < node.properties.length; i++) { - var property = node.properties[i]; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (property.type === 'Property') { - var value = property.value; - if (value.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(value, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); - } - } - else { - RestElement(property, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); - } - } - } - else if (property.type === 'Property') { - var key = void 0; - if (property.computed) { - key = evaluate(property.key, scope); - } - else { - key = property.key.name; - } - fedKeys.push(key); - var value = property.value; - if (value.type === 'Identifier') { - scope[kind](value.name, feed[key]); - } - else { - pattern$3(value, scope, { kind: kind, feed: feed[key] }); - } - } - else { - var rest = assign({}, feed); - for (var i_1 = 0; i_1 < fedKeys.length; i_1++) - delete rest[fedKeys[i_1]]; - RestElement(property, scope, { kind: kind, feed: rest }); - } - } - } - function ArrayPattern(node, scope, options) { - if (options === void 0) { options = {}; } - var kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; - var result = []; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - if (!element) - continue; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (element.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(element, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); - } - } - } - else if (element.type === 'Identifier') { - if (kind) { - scope[kind](element.name, feed[i]); - } - else { - var variable = Identifier(element, scope, { getVar: true }); - variable.set(feed[i]); - result.push(variable.get()); - } - } - else if (element.type === 'RestElement') { - RestElement(element, scope, { kind: kind, feed: feed.slice(i) }); - } - else { - pattern$3(element, scope, { kind: kind, feed: feed[i] }); - } - } - if (result.length) { - return result; - } - } - function RestElement(node, scope, options) { - if (options === void 0) { options = {}; } - var kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; - var arg = node.argument; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (arg.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(arg, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); - } - } - } - else if (arg.type === 'Identifier') { - if (kind) { - scope[kind](arg.name, feed); - } - else { - var variable = Identifier(arg, scope, { getVar: true }); - variable.set(feed); - } - } - else { - pattern$3(arg, scope, { kind: kind, feed: feed }); - } - } - function AssignmentPattern(node, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed, feed = _d === void 0 ? evaluate(node.right, scope) : _d; - var left = node.left; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (left.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(left, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); - } - } - } - else if (left.type === 'Identifier') { - scope[kind](left.name, feed); - } - else { - pattern$3(left, scope, { kind: kind, feed: feed }); - } + function ObjectPattern(node, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed, feed = _d === void 0 ? {} : _d; + var fedKeys = []; + for (var i = 0; i < node.properties.length; i++) { + var property = node.properties[i]; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (property.type === 'Property') { + var value = property.value; + if (value.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(value, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); + } + } + else { + RestElement(property, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); + } + } + } + else if (property.type === 'Property') { + var key = void 0; + if (property.computed) { + key = evaluate(property.key, scope); + } + else { + key = property.key.name; + } + fedKeys.push(key); + var value = property.value; + if (value.type === 'Identifier') { + scope[kind](value.name, feed[key]); + } + else { + pattern$3(value, scope, { kind: kind, feed: feed[key] }); + } + } + else { + var rest = assign({}, feed); + for (var i_1 = 0; i_1 < fedKeys.length; i_1++) + delete rest[fedKeys[i_1]]; + RestElement(property, scope, { kind: kind, feed: rest }); + } + } + } + function ArrayPattern(node, scope, options) { + if (options === void 0) { options = {}; } + var kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; + var result = []; + for (var i = 0; i < node.elements.length; i++) { + var element = node.elements[i]; + if (!element) + continue; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (element.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(element, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); + } + } + } + else if (element.type === 'Identifier') { + if (kind) { + scope[kind](element.name, feed[i]); + } + else { + var variable = Identifier(element, scope, { getVar: true }); + variable.set(feed[i]); + result.push(variable.get()); + } + } + else if (element.type === 'RestElement') { + RestElement(element, scope, { kind: kind, feed: feed.slice(i) }); + } + else { + pattern$3(element, scope, { kind: kind, feed: feed[i] }); + } + } + if (result.length) { + return result; + } + } + function RestElement(node, scope, options) { + if (options === void 0) { options = {}; } + var kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; + var arg = node.argument; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (arg.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(arg, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); + } + } + } + else if (arg.type === 'Identifier') { + if (kind) { + scope[kind](arg.name, feed); + } + else { + var variable = Identifier(arg, scope, { getVar: true }); + variable.set(feed); + } + } + else { + pattern$3(arg, scope, { kind: kind, feed: feed }); + } + } + function AssignmentPattern(node, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed, feed = _d === void 0 ? evaluate(node.right, scope) : _d; + var left = node.left; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (left.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(left, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); + } + } + } + else if (left.type === 'Identifier') { + scope[kind](left.name, feed); + } + else { + pattern$3(left, scope, { kind: kind, feed: feed }); + } } var pattern = /*#__PURE__*/Object.freeze({ @@ -1602,910 +1482,919 @@ AssignmentPattern: AssignmentPattern }); - function Program(program, scope) { - for (var i = 0; i < program.body.length; i++) { - evaluate(program.body[i], scope); - } + function Program(program, scope) { + for (var i = 0; i < program.body.length; i++) { + evaluate(program.body[i], scope); + } } var program = /*#__PURE__*/Object.freeze({ Program: Program }); - var evaluateOps; - function evaluate(node, scope) { - if (!node) - return; - if (!evaluateOps) { - evaluateOps = assign({}, declaration, expression, identifier, statement, literal, pattern, program); - } - var handler = evaluateOps[node.type]; - if (handler) { - return handler(node, scope); - } - else { - throw new Error(node.type + " isn't implemented"); - } + var evaluateOps; + function evaluate(node, scope) { + if (!node) + return; + if (!evaluateOps) { + evaluateOps = assign({}, declaration, expression, identifier, statement, literal, pattern, program); + } + var handler = evaluateOps[node.type]; + if (handler) { + return handler(node, scope); + } + else { + throw new Error(node.type + " isn't implemented"); + } } - function FunctionDeclaration(node, scope) { - scope.func(node.id.name, createFunc$1(node, scope)); - } - function VariableDeclaration(node, scope, options) { - if (options === void 0) { options = {}; } - for (var i = 0; i < node.declarations.length; i++) { - VariableDeclarator(node.declarations[i], scope, assign({ kind: node.kind }, options)); - } - } - function VariableDeclarator(node, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, feed = options.feed; - if (hoist) { - if (onlyBlock || kind === 'var') { - if (node.id.type === 'Identifier') { - scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); - } - else { - pattern$3(node.id, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); - } - } - } - else { - var hasFeed = 'feed' in options; - var value = hasFeed ? feed : evaluate(node.init, scope); - if (node.id.type === 'Identifier') { - var name_1 = node.id.name; - if (kind === 'var' && !node.init && !hasFeed) { - scope.var(name_1, NOINIT); - } - else { - scope[kind](name_1, value); - } - if (node.init - && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] - .indexOf(node.init.type) !== -1 - && !value.name) { - define(value, 'name', { - value: name_1, - configurable: true - }); - } - } - else { - pattern$3(node.id, scope, { kind: kind, feed: value }); - } - } - } - function ClassDeclaration(node, scope) { - scope.func(node.id.name, createClass$1(node, scope)); - } - function ClassBody(node, scope, options) { - if (options === void 0) { options = {}; } - var klass = options.klass, superClass = options.superClass; - for (var i = 0; i < node.body.length; i++) { - MethodDefinition(node.body[i], scope, { klass: klass, superClass: superClass }); - } - } - function MethodDefinition(node, scope, options) { - if (options === void 0) { options = {}; } - var klass = options.klass, superClass = options.superClass; - var key; - if (node.computed) { - key = evaluate(node.key, scope); - } - else if (node.key.type === 'Identifier') { - key = node.key.name; - } - else { - throw new SyntaxError('Unexpected token'); - } - var obj = node.static ? klass : klass.prototype; - var value = createFunc$1(node.value, scope, { superClass: superClass }); - switch (node.kind) { - case 'constructor': - break; - case 'method': - define(obj, key, { - value: value, - writable: true, - configurable: true, - }); - break; - case 'get': { - var oriDptor = getDptor(obj, key); - define(obj, key, { - get: value, - set: oriDptor && oriDptor.set, - configurable: true, - }); - break; - } - case 'set': { - var oriDptor = getDptor(obj, key); - define(obj, key, { - get: oriDptor && oriDptor.get, - set: value, - configurable: true, - }); - break; - } - default: - throw new SyntaxError('Unexpected token'); - } + function FunctionDeclaration(node, scope) { + scope.func(node.id.name, createFunc$1(node, scope)); + } + function VariableDeclaration(node, scope, options) { + if (options === void 0) { options = {}; } + for (var i = 0; i < node.declarations.length; i++) { + VariableDeclarator(node.declarations[i], scope, assign({ kind: node.kind }, options)); + } + } + function VariableDeclarator(node, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, feed = options.feed; + if (hoist) { + if (onlyBlock || kind === 'var') { + if (node.id.type === 'Identifier') { + scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); + } + else { + pattern$3(node.id, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }); + } + } + } + else { + var hasFeed = 'feed' in options; + var value = hasFeed ? feed : evaluate(node.init, scope); + if (node.id.type === 'Identifier') { + var name_1 = node.id.name; + if (kind === 'var' && !node.init && !hasFeed) { + scope.var(name_1, NOINIT); + } + else { + scope[kind](name_1, value); + } + if (node.init + && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] + .indexOf(node.init.type) !== -1 + && !value.name) { + define(value, 'name', { + value: name_1, + configurable: true + }); + } + } + else { + pattern$3(node.id, scope, { kind: kind, feed: value }); + } + } + } + function ClassDeclaration(node, scope) { + scope.func(node.id.name, createClass$1(node, scope)); + } + function ClassBody(node, scope, options) { + if (options === void 0) { options = {}; } + var klass = options.klass, superClass = options.superClass; + for (var i = 0; i < node.body.length; i++) { + MethodDefinition(node.body[i], scope, { klass: klass, superClass: superClass }); + } + } + function MethodDefinition(node, scope, options) { + if (options === void 0) { options = {}; } + var klass = options.klass, superClass = options.superClass; + var key; + if (node.computed) { + key = evaluate(node.key, scope); + } + else if (node.key.type === 'Identifier') { + key = node.key.name; + } + else { + throw new SyntaxError('Unexpected token'); + } + var obj = node.static ? klass : klass.prototype; + var value = createFunc$1(node.value, scope, { superClass: superClass }); + switch (node.kind) { + case 'constructor': + break; + case 'method': + define(obj, key, { + value: value, + writable: true, + configurable: true, + }); + break; + case 'get': { + var oriDptor = getDptor(obj, key); + define(obj, key, { + get: value, + set: oriDptor && oriDptor.set, + configurable: true, + }); + break; + } + case 'set': { + var oriDptor = getDptor(obj, key); + define(obj, key, { + get: oriDptor && oriDptor.get, + set: value, + configurable: true, + }); + break; + } + default: + throw new SyntaxError('Unexpected token'); + } } - function Identifier$1(node, scope, options) { - var _a, getVar, _b, throwErr, variable, value; - if (options === void 0) { options = {}; } - return __generator(this, function (_c) { - _a = options.getVar, getVar = _a === void 0 ? false : _a, _b = options.throwErr, throwErr = _b === void 0 ? true : _b; - if (node.name === 'undefined') { - return [2, undefined]; - } - variable = scope.find(node.name); - if (variable) { - if (getVar) { - return [2, variable]; - } - else { - value = variable.get(); - if (value === DEADZONE) { - throw new ReferenceError(node.name + " is not defined"); - } - else { - return [2, value]; - } - } - } - else if (throwErr) { - throw new ReferenceError(node.name + " is not defined"); - } - else { - return [2, undefined]; - } - return [2]; - }); + function Identifier$1(node, scope, options) { + var _a, getVar, _b, throwErr, variable, value; + if (options === void 0) { options = {}; } + return __generator(this, function (_c) { + _a = options.getVar, getVar = _a === void 0 ? false : _a, _b = options.throwErr, throwErr = _b === void 0 ? true : _b; + if (node.name === 'undefined') { + return [2, undefined]; + } + variable = scope.find(node.name); + if (variable) { + if (getVar) { + return [2, variable]; + } + else { + value = variable.get(); + if (value === DEADZONE) { + throw new ReferenceError(node.name + " is not defined"); + } + else { + return [2, value]; + } + } + } + else if (throwErr) { + throw new ReferenceError(node.name + " is not defined"); + } + else { + return [2, undefined]; + } + return [2]; + }); } var identifier$1 = /*#__PURE__*/Object.freeze({ Identifier: Identifier$1 }); - function Literal$1(node, scope) { - return __generator(this, function (_a) { - return [2, node.value]; - }); + function Literal$1(node, scope) { + return __generator(this, function (_a) { + return [2, node.value]; + }); } var literal$1 = /*#__PURE__*/Object.freeze({ Literal: Literal$1 }); - function ThisExpression$1(node, scope) { - var superCall; - return __generator(this, function (_a) { - superCall = scope.find(SUPERCALL); - if (superCall && !superCall.get()) { - throw new ReferenceError('Must call super constructor in derived class' - + 'before accessing \'this\' or returning from derived constructor'); - } - else { - return [2, scope.find('this').get()]; - } - return [2]; - }); - } - function ArrayExpression$1(node, scope) { - var results, i, item, _a, _b, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - results = []; - i = 0; - _e.label = 1; - case 1: - if (!(i < node.elements.length)) return [3, 6]; - item = node.elements[i]; - if (!(item.type === 'SpreadElement')) return [3, 3]; - _b = (_a = results).concat; - return [5, __values(SpreadElement$1(item, scope))]; - case 2: - results = _b.apply(_a, [_e.sent()]); - return [3, 5]; - case 3: - _d = (_c = results).push; - return [5, __values(evaluate$1(item, scope))]; - case 4: - _d.apply(_c, [_e.sent()]); - _e.label = 5; - case 5: - i++; - return [3, 1]; - case 6: return [2, results]; - } - }); - } - function ObjectExpression$1(node, scope) { - var object, i, property, _a, _b, key, propKey, _c, value, propKind; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - object = {}; - i = 0; - _d.label = 1; - case 1: - if (!(i < node.properties.length)) return [3, 11]; - property = node.properties[i]; - if (!(property.type === 'SpreadElement')) return [3, 3]; - _a = assign; - _b = [object]; - return [5, __values(SpreadElement$1(property, scope))]; - case 2: - _a.apply(void 0, _b.concat([_d.sent()])); - return [3, 10]; - case 3: - key = void 0; - propKey = property.key; - if (!property.computed) return [3, 5]; - return [5, __values(evaluate$1(propKey, scope))]; - case 4: - key = _d.sent(); - return [3, 8]; - case 5: - if (!(propKey.type === 'Identifier')) return [3, 6]; - key = propKey.name; - return [3, 8]; - case 6: - _c = ''; - return [5, __values(Literal$1(propKey, scope))]; - case 7: - key = _c + (_d.sent()); - _d.label = 8; - case 8: return [5, __values(evaluate$1(property.value, scope))]; - case 9: - value = _d.sent(); - propKind = property.kind; - if (propKind === 'init') { - object[key] = value; - } - else if (propKind === 'get') { - define(object, key, { get: value }); - } - else { - define(object, key, { set: value }); - } - _d.label = 10; - case 10: - i++; - return [3, 1]; - case 11: return [2, object]; - } - }); - } - function FunctionExpression$1(node, scope) { - var tmpScope, func; - return __generator(this, function (_a) { - if (node.id && node.id.name) { - tmpScope = new Scope(scope); - func = createFunc(node, tmpScope); - tmpScope.const(node.id.name, func); - return [2, func]; - } - else { - return [2, createFunc(node, scope)]; - } - return [2]; - }); - } - function UnaryExpression$1(node, scope) { - var arg, _a, variable, win; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - arg = node.argument; - _a = node.operator; - switch (_a) { - case '+': return [3, 1]; - case '-': return [3, 3]; - case '!': return [3, 5]; - case '~': return [3, 7]; - case 'void': return [3, 9]; - case 'typeof': return [3, 11]; - case 'delete': return [3, 15]; - } - return [3, 18]; - case 1: return [5, __values(evaluate$1(arg, scope))]; - case 2: return [2, +(_b.sent())]; - case 3: return [5, __values(evaluate$1(arg, scope))]; - case 4: return [2, -(_b.sent())]; - case 5: return [5, __values(evaluate$1(arg, scope))]; - case 6: return [2, !(_b.sent())]; - case 7: return [5, __values(evaluate$1(arg, scope))]; - case 8: return [2, ~(_b.sent())]; - case 9: return [5, __values(evaluate$1(arg, scope))]; - case 10: return [2, void (_b.sent())]; - case 11: - if (!(arg.type === 'Identifier')) return [3, 13]; - return [5, __values(Identifier$1(arg, scope, { throwErr: false }))]; - case 12: return [2, typeof (_b.sent())]; - case 13: return [5, __values(evaluate$1(arg, scope))]; - case 14: return [2, typeof (_b.sent())]; - case 15: - if (!(arg.type === 'MemberExpression')) return [3, 17]; - return [5, __values(MemberExpression$1(arg, scope, { getVar: true }))]; - case 16: - variable = _b.sent(); - return [2, variable.del()]; - case 17: - if (arg.type === 'Identifier') { - win = scope.global().find('window').get(); - return [2, delete win[arg.name]]; - } - else { - throw new SyntaxError('Unexpected token'); - } - _b.label = 18; - case 18: throw new SyntaxError("Unexpected token " + node.operator); - } - }); - } - function UpdateExpression$1(node, scope) { - var arg, variable, value; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - arg = node.argument; - if (!(arg.type === 'Identifier')) return [3, 2]; - return [5, __values(Identifier$1(arg, scope, { getVar: true }))]; - case 1: - variable = _a.sent(); - return [3, 5]; - case 2: - if (!(arg.type === 'MemberExpression')) return [3, 4]; - return [5, __values(MemberExpression$1(arg, scope, { getVar: true }))]; - case 3: - variable = _a.sent(); - return [3, 5]; - case 4: throw new SyntaxError('Unexpected token'); - case 5: - value = variable.get(); - if (node.operator === '++') { - variable.set(value + 1); - return [2, node.prefix ? variable.get() : value]; - } - else if (node.operator === '--') { - variable.set(value - 1); - return [2, node.prefix ? variable.get() : value]; - } - else { - throw new SyntaxError("Unexpected token " + node.operator); - } - return [2]; - } - }); - } - function BinaryExpression$1(node, scope) { - var left, right; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.left, scope))]; - case 1: - left = _a.sent(); - return [5, __values(evaluate$1(node.right, scope))]; - case 2: - right = _a.sent(); - switch (node.operator) { - case '==': return [2, left == right]; - case '!=': return [2, left != right]; - case '===': return [2, left === right]; - case '!==': return [2, left !== right]; - case '<': return [2, left < right]; - case '<=': return [2, left <= right]; - case '>': return [2, left > right]; - case '>=': return [2, left >= right]; - case '<<': return [2, left << right]; - case '>>': return [2, left >> right]; - case '>>>': return [2, left >>> right]; - case '+': return [2, left + right]; - case '-': return [2, left - right]; - case '*': return [2, left * right]; - case '**': return [2, Math.pow(left, right)]; - case '/': return [2, left / right]; - case '%': return [2, left % right]; - case '|': return [2, left | right]; - case '^': return [2, left ^ right]; - case '&': return [2, left & right]; - case 'in': return [2, left in right]; - case 'instanceof': return [2, left instanceof right]; - default: throw new SyntaxError("Unexpected token " + node.operator); - } - return [2]; - } - }); - } - function AssignmentExpression$1(node, scope) { - var value, left, variable, win; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.right, scope))]; - case 1: - value = _a.sent(); - left = node.left; - if (!(left.type === 'Identifier')) return [3, 3]; - return [5, __values(Identifier$1(left, scope, { getVar: true, throwErr: false }))]; - case 2: - variable = _a.sent(); - if (!variable) { - win = scope.global().find('window').get(); - variable = new Prop(win, left.name); - } - return [3, 7]; - case 3: - if (!(left.type === 'MemberExpression')) return [3, 5]; - return [5, __values(MemberExpression$1(left, scope, { getVar: true }))]; - case 4: - variable = _a.sent(); - return [3, 7]; - case 5: return [5, __values(pattern$2(left, scope, { feed: value }))]; - case 6: return [2, _a.sent()]; - case 7: - switch (node.operator) { - case '=': - variable.set(value); - return [2, variable.get()]; - case '+=': - variable.set(variable.get() + value); - return [2, variable.get()]; - case '-=': - variable.set(variable.get() - value); - return [2, variable.get()]; - case '*=': - variable.set(variable.get() * value); - return [2, variable.get()]; - case '/=': - variable.set(variable.get() / value); - return [2, variable.get()]; - case '%=': - variable.set(variable.get() % value); - return [2, variable.get()]; - case '**=': - variable.set(Math.pow(variable.get(), value)); - return [2, variable.get()]; - case '<<=': - variable.set(variable.get() << value); - return [2, variable.get()]; - case '>>=': - variable.set(variable.get() >> value); - return [2, variable.get()]; - case '>>>=': - variable.set(variable.get() >>> value); - return [2, variable.get()]; - case '|=': - variable.set(variable.get() | value); - return [2, variable.get()]; - case '^=': - variable.set(variable.get() ^ value); - return [2, variable.get()]; - case '&=': - variable.set(variable.get() & value); - return [2, variable.get()]; - default: throw new SyntaxError("Unexpected token " + node.operator); - } - return [2]; - } - }); - } - function LogicalExpression$1(node, scope) { - var _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - _a = node.operator; - switch (_a) { - case '||': return [3, 1]; - case '&&': return [3, 5]; - } - return [3, 9]; - case 1: return [5, __values(evaluate$1(node.left, scope))]; - case 2: - _b = (_d.sent()); - if (_b) return [3, 4]; - return [5, __values(evaluate$1(node.right, scope))]; - case 3: - _b = (_d.sent()); - _d.label = 4; - case 4: return [2, _b]; - case 5: return [5, __values(evaluate$1(node.left, scope))]; - case 6: - _c = (_d.sent()); - if (!_c) return [3, 8]; - return [5, __values(evaluate$1(node.right, scope))]; - case 7: - _c = (_d.sent()); - _d.label = 8; - case 8: return [2, _c]; - case 9: throw new SyntaxError("Unexpected token " + node.operator); - } - }); - } - function MemberExpression$1(node, scope, options) { - var _a, getObj, _b, getVar, object, key, setter, thisObject, privateKey, getter, thisObject; - if (options === void 0) { options = {}; } - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _a = options.getObj, getObj = _a === void 0 ? false : _a, _b = options.getVar, getVar = _b === void 0 ? false : _b; - if (!(node.object.type === 'Super')) return [3, 2]; - return [5, __values(Super$1(node.object, scope, { getProto: true }))]; - case 1: - object = _c.sent(); - return [3, 4]; - case 2: return [5, __values(evaluate$1(node.object, scope))]; - case 3: - object = _c.sent(); - _c.label = 4; - case 4: - if (getObj) - return [2, object]; - if (!node.computed) return [3, 6]; - return [5, __values(evaluate$1(node.property, scope))]; - case 5: - key = _c.sent(); - return [3, 7]; - case 6: - key = node.property.name; - _c.label = 7; - case 7: - if (getVar) { - setter = getSetter(object, key); - if (node.object.type === 'Super' && setter) { - thisObject = scope.find('this').get(); - privateKey = createSymbol(key); - define(thisObject, privateKey, { set: setter }); - return [2, new Prop(thisObject, privateKey)]; - } - else { - return [2, new Prop(object, key)]; - } - } - else { - getter = getGetter(object, key); - if (node.object.type === 'Super' && getter) { - thisObject = scope.find('this').get(); - return [2, getter.call(thisObject)]; - } - else { - return [2, object[key]]; - } - } - return [2]; - } - }); - } - function ConditionalExpression$1(node, scope) { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [5, __values(evaluate$1(node.test, scope))]; - case 1: - if (!(_b.sent())) return [3, 3]; - return [5, __values(evaluate$1(node.consequent, scope))]; - case 2: - _a = (_b.sent()); - return [3, 5]; - case 3: return [5, __values(evaluate$1(node.alternate, scope))]; - case 4: - _a = (_b.sent()); - _b.label = 5; - case 5: return [2, _a]; - } - }); - } - function CallExpression$1(node, scope) { - var func, object, key, getter, thisObject, name_1, args, i, arg, _a, _b, _c, _d, superCall; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - if (!(node.callee.type === 'MemberExpression')) return [3, 5]; - return [5, __values(MemberExpression$1(node.callee, scope, { getObj: true }))]; - case 1: - object = _e.sent(); - key = void 0; - if (!node.callee.computed) return [3, 3]; - return [5, __values(evaluate$1(node.callee.property, scope))]; - case 2: - key = _e.sent(); - return [3, 4]; - case 3: - key = node.callee.property.name; - _e.label = 4; - case 4: - getter = getGetter(object, key); - if (node.callee.object.type === 'Super' && getter) { - thisObject = scope.find('this').get(); - func = getter.call(thisObject); - } - else { - func = object[key]; - } - if (typeof func !== 'function') { - throw new TypeError(key + " is not a function"); - } - else if (func[CLSCTOR]) { - throw new TypeError("Class constructor " + key + " cannot be invoked without 'new'"); - } - return [3, 7]; - case 5: - object = scope.find('this').get(); - return [5, __values(evaluate$1(node.callee, scope))]; - case 6: - func = _e.sent(); - if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { - if (node.callee.type === 'Identifier') { - name_1 = node.callee.name; - } - else { - try { - name_1 = JSON.stringify(func); - } - catch (err) { - name_1 = '' + func; - } - } - if (typeof func !== 'function') { - throw new TypeError(name_1 + " is not a function"); - } - else { - throw new TypeError("Class constructor " + name_1 + " cannot be invoked without 'new'"); - } - } - _e.label = 7; - case 7: - args = []; - i = 0; - _e.label = 8; - case 8: - if (!(i < node.arguments.length)) return [3, 13]; - arg = node.arguments[i]; - if (!(arg.type === 'SpreadElement')) return [3, 10]; - _b = (_a = args).concat; - return [5, __values(SpreadElement$1(arg, scope))]; - case 9: - args = _b.apply(_a, [_e.sent()]); - return [3, 12]; - case 10: - _d = (_c = args).push; - return [5, __values(evaluate$1(arg, scope))]; - case 11: - _d.apply(_c, [_e.sent()]); - _e.label = 12; - case 12: - i++; - return [3, 8]; - case 13: - if (node.callee.type === 'Super') { - superCall = scope.find(SUPERCALL); - if (superCall.get()) { - throw new ReferenceError('Super constructor may only be called once'); - } - else { - scope.find(SUPERCALL).set(true); - } - } - return [2, func.apply(object, args)]; - } - }); - } - function NewExpression$1(node, scope) { - var constructor, name_2, args, i, arg, _a, _b, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: return [5, __values(evaluate$1(node.callee, scope))]; - case 1: - constructor = _e.sent(); - if (typeof constructor !== 'function') { - if (node.callee.type === 'Identifier') { - name_2 = node.callee.name; - } - else { - try { - name_2 = JSON.stringify(constructor); - } - catch (err) { - name_2 = '' + constructor; - } - } - throw new TypeError(name_2 + " is not a constructor"); - } - else if (constructor[NOCTOR]) { - throw new TypeError((constructor.name || '(intermediate value)') + " is not a constructor"); - } - args = []; - i = 0; - _e.label = 2; - case 2: - if (!(i < node.arguments.length)) return [3, 7]; - arg = node.arguments[i]; - if (!(arg.type === 'SpreadElement')) return [3, 4]; - _b = (_a = args).concat; - return [5, __values(SpreadElement$1(arg, scope))]; - case 3: - args = _b.apply(_a, [_e.sent()]); - return [3, 6]; - case 4: - _d = (_c = args).push; - return [5, __values(evaluate$1(arg, scope))]; - case 5: - _d.apply(_c, [_e.sent()]); - _e.label = 6; - case 6: - i++; - return [3, 2]; - case 7: return [2, new (constructor.bind.apply(constructor, __spread([void 0], args)))()]; - } - }); - } - function MetaProperty$1(node, scope) { - return __generator(this, function (_a) { - return [2, scope.find(NEWTARGET).get()]; - }); - } - function SequenceExpression$1(node, scope) { - var result, i; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - i = 0; - _a.label = 1; - case 1: - if (!(i < node.expressions.length)) return [3, 4]; - return [5, __values(evaluate$1(node.expressions[i], scope))]; - case 2: - result = _a.sent(); - _a.label = 3; - case 3: - i++; - return [3, 1]; - case 4: return [2, result]; - } - }); - } - function ArrowFunctionExpression$1(node, scope) { - return __generator(this, function (_a) { - return [2, createFunc(node, scope)]; - }); - } - function TemplateLiteral$1(node, scope) { - var quasis, expressions, result, temEl, expr, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - quasis = node.quasis; - expressions = node.expressions; - result = ''; - _c.label = 1; - case 1: - if (!(temEl = quasis.shift())) return [3, 5]; - _a = result; - return [5, __values(TemplateElement$1(temEl, scope))]; - case 2: - result = _a + _c.sent(); - expr = expressions.shift(); - if (!expr) return [3, 4]; - _b = result; - return [5, __values(evaluate$1(expr, scope))]; - case 3: - result = _b + _c.sent(); - _c.label = 4; - case 4: return [3, 1]; - case 5: return [2, result]; - } - }); - } - function TaggedTemplateExpression$1(node, scope) { - var tagFunc, quasis, str, raw, expressions, args, i, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [5, __values(evaluate$1(node.tag, scope))]; - case 1: - tagFunc = _c.sent(); - quasis = node.quasi.quasis; - str = quasis.map(function (v) { return v.value.cooked; }); - raw = quasis.map(function (v) { return v.value.raw; }); - define(str, 'raw', { - value: freeze(raw) - }); - expressions = node.quasi.expressions; - args = []; - if (!expressions) return [3, 5]; - i = 0; - _c.label = 2; - case 2: - if (!(i < expressions.length)) return [3, 5]; - _b = (_a = args).push; - return [5, __values(evaluate$1(expressions[i], scope))]; - case 3: - _b.apply(_a, [_c.sent()]); - _c.label = 4; - case 4: - i++; - return [3, 2]; - case 5: return [2, tagFunc.apply(void 0, __spread([freeze(str)], args))]; - } - }); - } - function TemplateElement$1(node, scope) { - return __generator(this, function (_a) { - return [2, node.value.raw]; - }); - } - function ClassExpression$1(node, scope) { - var tmpScope, klass; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(node.id && node.id.name)) return [3, 2]; - tmpScope = new Scope(scope); - return [5, __values(createClass(node, tmpScope))]; - case 1: - klass = _a.sent(); - tmpScope.const(node.id.name, klass); - return [2, klass]; - case 2: return [5, __values(createClass(node, scope))]; - case 3: return [2, _a.sent()]; - } - }); - } - function Super$1(node, scope, options) { - var _a, getProto, superClass; - if (options === void 0) { options = {}; } - return __generator(this, function (_b) { - _a = options.getProto, getProto = _a === void 0 ? false : _a; - superClass = scope.find(SUPER).get(); - return [2, getProto ? superClass.prototype : superClass]; - }); - } - function SpreadElement$1(node, scope) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.argument, scope))]; - case 1: return [2, _a.sent()]; - } - }); - } - function YieldExpression(node, scope) { - var res, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [5, __values(evaluate$1(node.argument, scope))]; - case 1: - res = _b.sent(); - if (!node.delegate) return [3, 3]; - return [5, __values(res)]; - case 2: - _a = _b.sent(); - return [3, 5]; - case 3: return [4, res]; - case 4: - _a = _b.sent(); - _b.label = 5; - case 5: return [2, _a]; - } - }); - } - function AwaitExpression(node, scope) { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = AWAIT; - return [5, __values(evaluate$1(node.argument, scope))]; - case 1: - _a.RES = _b.sent(); - return [4, AWAIT]; - case 2: return [2, _b.sent()]; - } - }); + function ThisExpression$1(node, scope) { + var superCall; + return __generator(this, function (_a) { + superCall = scope.find(SUPERCALL); + if (superCall && !superCall.get()) { + throw new ReferenceError('Must call super constructor in derived class ' + + 'before accessing \'this\' or returning from derived constructor'); + } + else { + return [2, scope.find('this').get()]; + } + return [2]; + }); + } + function ArrayExpression$1(node, scope) { + var results, i, item, _a, _b, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + results = []; + i = 0; + _e.label = 1; + case 1: + if (!(i < node.elements.length)) return [3, 6]; + item = node.elements[i]; + if (!(item.type === 'SpreadElement')) return [3, 3]; + _b = (_a = results).concat; + return [5, __values(SpreadElement$1(item, scope))]; + case 2: + results = _b.apply(_a, [_e.sent()]); + return [3, 5]; + case 3: + _d = (_c = results).push; + return [5, __values(evaluate$1(item, scope))]; + case 4: + _d.apply(_c, [_e.sent()]); + _e.label = 5; + case 5: + i++; + return [3, 1]; + case 6: return [2, results]; + } + }); + } + function ObjectExpression$1(node, scope) { + var object, i, property, _a, _b, key, propKey, _c, value, propKind, oriDptor, oriDptor; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + object = {}; + i = 0; + _d.label = 1; + case 1: + if (!(i < node.properties.length)) return [3, 11]; + property = node.properties[i]; + if (!(property.type === 'SpreadElement')) return [3, 3]; + _a = assign; + _b = [object]; + return [5, __values(SpreadElement$1(property, scope))]; + case 2: + _a.apply(void 0, _b.concat([_d.sent()])); + return [3, 10]; + case 3: + key = void 0; + propKey = property.key; + if (!property.computed) return [3, 5]; + return [5, __values(evaluate$1(propKey, scope))]; + case 4: + key = _d.sent(); + return [3, 8]; + case 5: + if (!(propKey.type === 'Identifier')) return [3, 6]; + key = propKey.name; + return [3, 8]; + case 6: + _c = ''; + return [5, __values(Literal$1(propKey))]; + case 7: + key = _c + (_d.sent()); + _d.label = 8; + case 8: return [5, __values(evaluate$1(property.value, scope))]; + case 9: + value = _d.sent(); + propKind = property.kind; + if (propKind === 'init') { + object[key] = value; + } + else if (propKind === 'get') { + oriDptor = getDptor(object, key); + define(object, key, { + get: value, + set: oriDptor && oriDptor.set, + enumerable: true, + configurable: true + }); + } + else { + oriDptor = getDptor(object, key); + define(object, key, { + get: oriDptor && oriDptor.get, + set: value, + enumerable: true, + configurable: true + }); + } + _d.label = 10; + case 10: + i++; + return [3, 1]; + case 11: return [2, object]; + } + }); + } + function FunctionExpression$1(node, scope) { + var tmpScope, func; + return __generator(this, function (_a) { + if (node.id && node.id.name) { + tmpScope = new Scope(scope); + func = createFunc(node, tmpScope); + tmpScope.const(node.id.name, func); + return [2, func]; + } + else { + return [2, createFunc(node, scope)]; + } + return [2]; + }); + } + function UnaryExpression$1(node, scope) { + var arg, _a, variable; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + arg = node.argument; + _a = node.operator; + switch (_a) { + case '+': return [3, 1]; + case '-': return [3, 3]; + case '!': return [3, 5]; + case '~': return [3, 7]; + case 'void': return [3, 9]; + case 'typeof': return [3, 11]; + case 'delete': return [3, 15]; + } + return [3, 20]; + case 1: return [5, __values(evaluate$1(arg, scope))]; + case 2: return [2, +(_b.sent())]; + case 3: return [5, __values(evaluate$1(arg, scope))]; + case 4: return [2, -(_b.sent())]; + case 5: return [5, __values(evaluate$1(arg, scope))]; + case 6: return [2, !(_b.sent())]; + case 7: return [5, __values(evaluate$1(arg, scope))]; + case 8: return [2, ~(_b.sent())]; + case 9: return [5, __values(evaluate$1(arg, scope))]; + case 10: return [2, void (_b.sent())]; + case 11: + if (!(arg.type === 'Identifier')) return [3, 13]; + return [5, __values(Identifier$1(arg, scope, { throwErr: false }))]; + case 12: return [2, typeof (_b.sent())]; + case 13: return [5, __values(evaluate$1(arg, scope))]; + case 14: return [2, typeof (_b.sent())]; + case 15: + if (!(arg.type === 'MemberExpression')) return [3, 17]; + return [5, __values(MemberExpression$1(arg, scope, { getVar: true }))]; + case 16: + variable = _b.sent(); + return [2, variable.del()]; + case 17: + if (!(arg.type === 'Identifier')) return [3, 18]; + throw new SyntaxError('Delete of an unqualified identifier in strict mode'); + case 18: return [5, __values(evaluate$1(arg, scope))]; + case 19: + _b.sent(); + return [2, true]; + case 20: throw new SyntaxError("Unexpected token " + node.operator); + } + }); + } + function UpdateExpression$1(node, scope) { + var arg, variable, value; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + arg = node.argument; + if (!(arg.type === 'Identifier')) return [3, 2]; + return [5, __values(Identifier$1(arg, scope, { getVar: true }))]; + case 1: + variable = _a.sent(); + return [3, 5]; + case 2: + if (!(arg.type === 'MemberExpression')) return [3, 4]; + return [5, __values(MemberExpression$1(arg, scope, { getVar: true }))]; + case 3: + variable = _a.sent(); + return [3, 5]; + case 4: throw new SyntaxError('Unexpected token'); + case 5: + value = variable.get(); + if (node.operator === '++') { + variable.set(value + 1); + return [2, node.prefix ? variable.get() : value]; + } + else if (node.operator === '--') { + variable.set(value - 1); + return [2, node.prefix ? variable.get() : value]; + } + else { + throw new SyntaxError("Unexpected token " + node.operator); + } + return [2]; + } + }); + } + function BinaryExpression$1(node, scope) { + var left, right; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.left, scope))]; + case 1: + left = _a.sent(); + return [5, __values(evaluate$1(node.right, scope))]; + case 2: + right = _a.sent(); + switch (node.operator) { + case '==': return [2, left == right]; + case '!=': return [2, left != right]; + case '===': return [2, left === right]; + case '!==': return [2, left !== right]; + case '<': return [2, left < right]; + case '<=': return [2, left <= right]; + case '>': return [2, left > right]; + case '>=': return [2, left >= right]; + case '<<': return [2, left << right]; + case '>>': return [2, left >> right]; + case '>>>': return [2, left >>> right]; + case '+': return [2, left + right]; + case '-': return [2, left - right]; + case '*': return [2, left * right]; + case '**': return [2, Math.pow(left, right)]; + case '/': return [2, left / right]; + case '%': return [2, left % right]; + case '|': return [2, left | right]; + case '^': return [2, left ^ right]; + case '&': return [2, left & right]; + case 'in': return [2, left in right]; + case 'instanceof': return [2, left instanceof right]; + default: throw new SyntaxError("Unexpected token " + node.operator); + } + return [2]; + } + }); + } + function AssignmentExpression$1(node, scope) { + var value, left, variable, win; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.right, scope))]; + case 1: + value = _a.sent(); + left = node.left; + if (!(left.type === 'Identifier')) return [3, 3]; + return [5, __values(Identifier$1(left, scope, { getVar: true, throwErr: false }))]; + case 2: + variable = _a.sent(); + if (!variable) { + win = scope.global().find('window').get(); + variable = new Prop(win, left.name); + } + return [3, 7]; + case 3: + if (!(left.type === 'MemberExpression')) return [3, 5]; + return [5, __values(MemberExpression$1(left, scope, { getVar: true }))]; + case 4: + variable = _a.sent(); + return [3, 7]; + case 5: return [5, __values(pattern$2(left, scope, { feed: value }))]; + case 6: return [2, _a.sent()]; + case 7: + switch (node.operator) { + case '=': + variable.set(value); + return [2, variable.get()]; + case '+=': + variable.set(variable.get() + value); + return [2, variable.get()]; + case '-=': + variable.set(variable.get() - value); + return [2, variable.get()]; + case '*=': + variable.set(variable.get() * value); + return [2, variable.get()]; + case '/=': + variable.set(variable.get() / value); + return [2, variable.get()]; + case '%=': + variable.set(variable.get() % value); + return [2, variable.get()]; + case '**=': + variable.set(Math.pow(variable.get(), value)); + return [2, variable.get()]; + case '<<=': + variable.set(variable.get() << value); + return [2, variable.get()]; + case '>>=': + variable.set(variable.get() >> value); + return [2, variable.get()]; + case '>>>=': + variable.set(variable.get() >>> value); + return [2, variable.get()]; + case '|=': + variable.set(variable.get() | value); + return [2, variable.get()]; + case '^=': + variable.set(variable.get() ^ value); + return [2, variable.get()]; + case '&=': + variable.set(variable.get() & value); + return [2, variable.get()]; + default: throw new SyntaxError("Unexpected token " + node.operator); + } + return [2]; + } + }); + } + function LogicalExpression$1(node, scope) { + var _a, _b, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _a = node.operator; + switch (_a) { + case '||': return [3, 1]; + case '&&': return [3, 5]; + } + return [3, 9]; + case 1: return [5, __values(evaluate$1(node.left, scope))]; + case 2: + _b = (_d.sent()); + if (_b) return [3, 4]; + return [5, __values(evaluate$1(node.right, scope))]; + case 3: + _b = (_d.sent()); + _d.label = 4; + case 4: return [2, _b]; + case 5: return [5, __values(evaluate$1(node.left, scope))]; + case 6: + _c = (_d.sent()); + if (!_c) return [3, 8]; + return [5, __values(evaluate$1(node.right, scope))]; + case 7: + _c = (_d.sent()); + _d.label = 8; + case 8: return [2, _c]; + case 9: throw new SyntaxError("Unexpected token " + node.operator); + } + }); + } + function MemberExpression$1(node, scope, options) { + var _a, getObj, _b, getVar, object, key, setter, thisObject, privateKey, getter, thisObject; + if (options === void 0) { options = {}; } + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _a = options.getObj, getObj = _a === void 0 ? false : _a, _b = options.getVar, getVar = _b === void 0 ? false : _b; + if (!(node.object.type === 'Super')) return [3, 2]; + return [5, __values(Super$1(node.object, scope, { getProto: true }))]; + case 1: + object = _c.sent(); + return [3, 4]; + case 2: return [5, __values(evaluate$1(node.object, scope))]; + case 3: + object = _c.sent(); + _c.label = 4; + case 4: + if (getObj) + return [2, object]; + if (!node.computed) return [3, 6]; + return [5, __values(evaluate$1(node.property, scope))]; + case 5: + key = _c.sent(); + return [3, 7]; + case 6: + key = node.property.name; + _c.label = 7; + case 7: + if (getVar) { + setter = getSetter(object, key); + if (node.object.type === 'Super' && setter) { + thisObject = scope.find('this').get(); + privateKey = createSymbol(key); + define(thisObject, privateKey, { set: setter }); + return [2, new Prop(thisObject, privateKey)]; + } + else { + return [2, new Prop(object, key)]; + } + } + else { + getter = getGetter(object, key); + if (node.object.type === 'Super' && getter) { + thisObject = scope.find('this').get(); + return [2, getter.call(thisObject)]; + } + else { + return [2, object[key]]; + } + } + return [2]; + } + }); + } + function ConditionalExpression$1(node, scope) { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [5, __values(evaluate$1(node.test, scope))]; + case 1: + if (!(_b.sent())) return [3, 3]; + return [5, __values(evaluate$1(node.consequent, scope))]; + case 2: + _a = (_b.sent()); + return [3, 5]; + case 3: return [5, __values(evaluate$1(node.alternate, scope))]; + case 4: + _a = (_b.sent()); + _b.label = 5; + case 5: return [2, _a]; + } + }); + } + function CallExpression$1(node, scope) { + var func, object, key, thisObject, name_1, args, i, arg, _a, _b, _c, _d, superCall; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + if (!(node.callee.type === 'MemberExpression')) return [3, 5]; + return [5, __values(MemberExpression$1(node.callee, scope, { getObj: true }))]; + case 1: + object = _e.sent(); + key = void 0; + if (!node.callee.computed) return [3, 3]; + return [5, __values(evaluate$1(node.callee.property, scope))]; + case 2: + key = _e.sent(); + return [3, 4]; + case 3: + key = node.callee.property.name; + _e.label = 4; + case 4: + if (node.callee.object.type === 'Super') { + thisObject = scope.find('this').get(); + func = object[key].bind(thisObject); + } + else { + func = object[key]; + } + if (typeof func !== 'function') { + throw new TypeError(key + " is not a function"); + } + else if (func[CLSCTOR]) { + throw new TypeError("Class constructor " + key + " cannot be invoked without 'new'"); + } + return [3, 7]; + case 5: + object = scope.find('this').get(); + return [5, __values(evaluate$1(node.callee, scope))]; + case 6: + func = _e.sent(); + if (typeof func !== 'function' || node.callee.type !== 'Super' && func[CLSCTOR]) { + if (node.callee.type === 'Identifier') { + name_1 = node.callee.name; + } + else { + try { + name_1 = JSON.stringify(func); + } + catch (err) { + name_1 = '' + func; + } + } + if (typeof func !== 'function') { + throw new TypeError(name_1 + " is not a function"); + } + else { + throw new TypeError("Class constructor " + name_1 + " cannot be invoked without 'new'"); + } + } + _e.label = 7; + case 7: + args = []; + i = 0; + _e.label = 8; + case 8: + if (!(i < node.arguments.length)) return [3, 13]; + arg = node.arguments[i]; + if (!(arg.type === 'SpreadElement')) return [3, 10]; + _b = (_a = args).concat; + return [5, __values(SpreadElement$1(arg, scope))]; + case 9: + args = _b.apply(_a, [_e.sent()]); + return [3, 12]; + case 10: + _d = (_c = args).push; + return [5, __values(evaluate$1(arg, scope))]; + case 11: + _d.apply(_c, [_e.sent()]); + _e.label = 12; + case 12: + i++; + return [3, 8]; + case 13: + if (node.callee.type === 'Super') { + superCall = scope.find(SUPERCALL); + if (superCall.get()) { + throw new ReferenceError('Super constructor may only be called once'); + } + else { + scope.find(SUPERCALL).set(true); + } + } + return [2, func.apply(object, args)]; + } + }); + } + function NewExpression$1(node, scope) { + var constructor, name_2, args, i, arg, _a, _b, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: return [5, __values(evaluate$1(node.callee, scope))]; + case 1: + constructor = _e.sent(); + if (typeof constructor !== 'function') { + if (node.callee.type === 'Identifier') { + name_2 = node.callee.name; + } + else { + try { + name_2 = JSON.stringify(constructor); + } + catch (err) { + name_2 = '' + constructor; + } + } + throw new TypeError(name_2 + " is not a constructor"); + } + else if (constructor[NOCTOR]) { + throw new TypeError((constructor.name || '(intermediate value)') + " is not a constructor"); + } + args = []; + i = 0; + _e.label = 2; + case 2: + if (!(i < node.arguments.length)) return [3, 7]; + arg = node.arguments[i]; + if (!(arg.type === 'SpreadElement')) return [3, 4]; + _b = (_a = args).concat; + return [5, __values(SpreadElement$1(arg, scope))]; + case 3: + args = _b.apply(_a, [_e.sent()]); + return [3, 6]; + case 4: + _d = (_c = args).push; + return [5, __values(evaluate$1(arg, scope))]; + case 5: + _d.apply(_c, [_e.sent()]); + _e.label = 6; + case 6: + i++; + return [3, 2]; + case 7: return [2, new (constructor.bind.apply(constructor, __spread([void 0], args)))()]; + } + }); + } + function MetaProperty$1(node, scope) { + return __generator(this, function (_a) { + return [2, scope.find(NEWTARGET).get()]; + }); + } + function SequenceExpression$1(node, scope) { + var result, i; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + i = 0; + _a.label = 1; + case 1: + if (!(i < node.expressions.length)) return [3, 4]; + return [5, __values(evaluate$1(node.expressions[i], scope))]; + case 2: + result = _a.sent(); + _a.label = 3; + case 3: + i++; + return [3, 1]; + case 4: return [2, result]; + } + }); + } + function ArrowFunctionExpression$1(node, scope) { + return __generator(this, function (_a) { + return [2, createFunc(node, scope)]; + }); + } + function TemplateLiteral$1(node, scope) { + var quasis, expressions, result, temEl, expr, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + quasis = node.quasis; + expressions = node.expressions; + result = ''; + _c.label = 1; + case 1: + if (!(temEl = quasis.shift())) return [3, 5]; + _a = result; + return [5, __values(TemplateElement$1(temEl))]; + case 2: + result = _a + _c.sent(); + expr = expressions.shift(); + if (!expr) return [3, 4]; + _b = result; + return [5, __values(evaluate$1(expr, scope))]; + case 3: + result = _b + _c.sent(); + _c.label = 4; + case 4: return [3, 1]; + case 5: return [2, result]; + } + }); + } + function TaggedTemplateExpression$1(node, scope) { + var tagFunc, quasis, str, raw, expressions, args, i, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [5, __values(evaluate$1(node.tag, scope))]; + case 1: + tagFunc = _c.sent(); + quasis = node.quasi.quasis; + str = quasis.map(function (v) { return v.value.cooked; }); + raw = quasis.map(function (v) { return v.value.raw; }); + define(str, 'raw', { + value: freeze(raw) + }); + expressions = node.quasi.expressions; + args = []; + if (!expressions) return [3, 5]; + i = 0; + _c.label = 2; + case 2: + if (!(i < expressions.length)) return [3, 5]; + _b = (_a = args).push; + return [5, __values(evaluate$1(expressions[i], scope))]; + case 3: + _b.apply(_a, [_c.sent()]); + _c.label = 4; + case 4: + i++; + return [3, 2]; + case 5: return [2, tagFunc.apply(void 0, __spread([freeze(str)], args))]; + } + }); + } + function TemplateElement$1(node, scope) { + return __generator(this, function (_a) { + return [2, node.value.raw]; + }); + } + function ClassExpression$1(node, scope) { + var tmpScope, klass; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(node.id && node.id.name)) return [3, 2]; + tmpScope = new Scope(scope); + return [5, __values(createClass(node, tmpScope))]; + case 1: + klass = _a.sent(); + tmpScope.const(node.id.name, klass); + return [2, klass]; + case 2: return [5, __values(createClass(node, scope))]; + case 3: return [2, _a.sent()]; + } + }); + } + function Super$1(node, scope, options) { + var _a, getProto, superClass; + if (options === void 0) { options = {}; } + return __generator(this, function (_b) { + _a = options.getProto, getProto = _a === void 0 ? false : _a; + superClass = scope.find(SUPER).get(); + return [2, getProto ? superClass.prototype : superClass]; + }); + } + function SpreadElement$1(node, scope) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.argument, scope))]; + case 1: return [2, _a.sent()]; + } + }); + } + function YieldExpression(node, scope) { + var res, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [5, __values(evaluate$1(node.argument, scope))]; + case 1: + res = _b.sent(); + if (!node.delegate) return [3, 3]; + return [5, __values(res)]; + case 2: + _a = _b.sent(); + return [3, 5]; + case 3: return [4, res]; + case 4: + _a = _b.sent(); + _b.label = 5; + case 5: return [2, _a]; + } + }); + } + function AwaitExpression(node, scope) { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = AWAIT; + return [5, __values(evaluate$1(node.argument, scope))]; + case 1: + _a.RES = _b.sent(); + return [4, AWAIT]; + case 2: return [2, _b.sent()]; + } + }); } var expression$1 = /*#__PURE__*/Object.freeze({ @@ -2535,433 +2424,434 @@ AwaitExpression: AwaitExpression }); - function ExpressionStatement$1(node, scope) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.expression, scope))]; - case 1: - _a.sent(); - return [2]; - } - }); - } - function BlockStatement$1(block, scope, options) { - var _a, invasived, _b, hoisted, subScope, i, result; - if (options === void 0) { options = {}; } - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _a = options.invasived, invasived = _a === void 0 ? false : _a, _b = options.hoisted, hoisted = _b === void 0 ? false : _b; - subScope = invasived ? scope : new Scope(scope); - if (!!hoisted) return [3, 2]; - return [5, __values(hoist(block, subScope, { onlyBlock: true }))]; - case 1: - _c.sent(); - _c.label = 2; - case 2: - i = 0; - _c.label = 3; - case 3: - if (!(i < block.body.length)) return [3, 6]; - return [5, __values(evaluate$1(block.body[i], subScope))]; - case 4: - result = _c.sent(); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return [2, result]; - } - _c.label = 5; - case 5: - i++; - return [3, 3]; - case 6: return [2]; - } - }); - } - function EmptyStatement$1() { - return __generator(this, function (_a) { - return [2]; - }); - } - function DebuggerStatement$1() { - return __generator(this, function (_a) { - debugger; - return [2]; - }); - } - function ReturnStatement$1(node, scope) { - var _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _a = RETURN; - if (!node.argument) return [3, 2]; - return [5, __values(evaluate$1(node.argument, scope))]; - case 1: - _b = (_c.sent()); - return [3, 3]; - case 2: - _b = undefined; - _c.label = 3; - case 3: - _a.RES = _b; - return [2, RETURN]; - } - }); - } - function BreakStatement$1() { - return __generator(this, function (_a) { - return [2, BREAK]; - }); - } - function ContinueStatement$1() { - return __generator(this, function (_a) { - return [2, CONTINUE]; - }); - } - function IfStatement$1(node, scope) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.test, scope))]; - case 1: - if (!_a.sent()) return [3, 3]; - return [5, __values(evaluate$1(node.consequent, scope))]; - case 2: return [2, _a.sent()]; - case 3: return [5, __values(evaluate$1(node.alternate, scope))]; - case 4: return [2, _a.sent()]; - } - }); - } - function SwitchStatement$1(node, scope) { - var discriminant, matched, i, eachCase, _a, _b, result; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [5, __values(evaluate$1(node.discriminant, scope))]; - case 1: - discriminant = _c.sent(); - matched = false; - i = 0; - _c.label = 2; - case 2: - if (!(i < node.cases.length)) return [3, 8]; - eachCase = node.cases[i]; - _a = !matched; - if (!_a) return [3, 5]; - _b = !eachCase.test; - if (_b) return [3, 4]; - return [5, __values(evaluate$1(eachCase.test, scope))]; - case 3: - _b = (_c.sent()) === discriminant; - _c.label = 4; - case 4: - _a = (_b); - _c.label = 5; - case 5: - if (_a) { - matched = true; - } - if (!matched) return [3, 7]; - return [5, __values(SwitchCase$1(eachCase, scope))]; - case 6: - result = _c.sent(); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return [2, result]; - } - _c.label = 7; - case 7: - i++; - return [3, 2]; - case 8: return [2]; - } - }); - } - function SwitchCase$1(node, scope) { - var i, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - i = 0; - _a.label = 1; - case 1: - if (!(i < node.consequent.length)) return [3, 4]; - return [5, __values(evaluate$1(node.consequent[i], scope))]; - case 2: - result = _a.sent(); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return [2, result]; - } - _a.label = 3; - case 3: - i++; - return [3, 1]; - case 4: return [2]; - } - }); - } - function ThrowStatement$1(node, scope) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.argument, scope))]; - case 1: throw _a.sent(); - } - }); - } - function TryStatement$1(node, scope) { - var err_1, subScope, param, name_1, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, 9, 12]); - return [5, __values(BlockStatement$1(node.block, scope))]; - case 1: return [2, _a.sent()]; - case 2: - err_1 = _a.sent(); - if (!node.handler) return [3, 7]; - subScope = new Scope(scope); - param = node.handler.param; - if (!param) return [3, 5]; - if (!(param.type === 'Identifier')) return [3, 3]; - name_1 = param.name; - subScope.let(name_1, err_1); - return [3, 5]; - case 3: return [5, __values(pattern$2(param, scope, { feed: err_1 }))]; - case 4: - _a.sent(); - _a.label = 5; - case 5: return [5, __values(CatchClause$1(node.handler, subScope))]; - case 6: return [2, _a.sent()]; - case 7: throw err_1; - case 8: return [3, 12]; - case 9: - if (!node.finalizer) return [3, 11]; - return [5, __values(BlockStatement$1(node.finalizer, scope))]; - case 10: - result = _a.sent(); - if (result === BREAK || result === CONTINUE || result === RETURN) { - return [2, result]; - } - _a.label = 11; - case 11: return [7]; - case 12: return [2]; - } - }); - } - function CatchClause$1(node, scope) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(BlockStatement$1(node.body, scope, { invasived: true }))]; - case 1: return [2, _a.sent()]; - } - }); - } - function WhileStatement$1(node, scope) { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.test, scope))]; - case 1: - if (!_a.sent()) return [3, 3]; - return [5, __values(evaluate$1(node.body, scope))]; - case 2: - result = _a.sent(); - if (result === BREAK) { - return [3, 3]; - } - else if (result === CONTINUE) { - return [3, 0]; - } - else if (result === RETURN) { - return [2, result]; - } - return [3, 0]; - case 3: return [2]; - } - }); - } - function DoWhileStatement$1(node, scope) { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.body, scope))]; - case 1: - result = _a.sent(); - if (result === BREAK) { - return [3, 4]; - } - else if (result === CONTINUE) { - return [3, 2]; - } - else if (result === RETURN) { - return [2, result]; - } - _a.label = 2; - case 2: return [5, __values(evaluate$1(node.test, scope))]; - case 3: - if (_a.sent()) return [3, 0]; - _a.label = 4; - case 4: return [2]; - } - }); - } - function ForStatement$1(node, scope) { - var forScope, _a, subScope, result; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - forScope = new Scope(scope); - return [5, __values(evaluate$1(node.init, forScope))]; - case 1: - _b.sent(); - _b.label = 2; - case 2: - if (!node.test) return [3, 4]; - return [5, __values(evaluate$1(node.test, forScope))]; - case 3: - _a = (_b.sent()); - return [3, 5]; - case 4: - _a = true; - _b.label = 5; - case 5: - if (!_a) return [3, 12]; - subScope = new Scope(forScope); - result = void 0; - if (!(node.body.type === 'BlockStatement')) return [3, 7]; - return [5, __values(BlockStatement$1(node.body, subScope, { invasived: true }))]; - case 6: - result = _b.sent(); - return [3, 9]; - case 7: return [5, __values(evaluate$1(node.body, subScope))]; - case 8: - result = _b.sent(); - _b.label = 9; - case 9: - if (result === BREAK) { - return [3, 12]; - } - else if (result === CONTINUE) { - return [3, 10]; - } - else if (result === RETURN) { - return [2, result]; - } - _b.label = 10; - case 10: return [5, __values(evaluate$1(node.update, forScope))]; - case 11: - _b.sent(); - return [3, 2]; - case 12: return [2]; - } - }); - } - function ForInStatement$1(node, scope) { - var _a, _b, _i, value, result; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _a = []; - return [5, __values(evaluate$1(node.right, scope))]; - case 1: - for (_b in _c.sent()) - _a.push(_b); - _i = 0; - _c.label = 2; - case 2: - if (!(_i < _a.length)) return [3, 5]; - value = _a[_i]; - return [5, __values(ForXHandler(node, scope, { value: value }))]; - case 3: - result = _c.sent(); - if (result === BREAK) { - return [3, 5]; - } - else if (result === CONTINUE) { - return [3, 4]; - } - else if (result === RETURN) { - return [2, result]; - } - _c.label = 4; - case 4: - _i++; - return [3, 2]; - case 5: return [2]; - } - }); - } - function ForOfStatement$1(node, scope) { - var e_1, _a, right, iterator, ret, result, right_1, right_1_1, value, result, e_1_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [5, __values(evaluate$1(node.right, scope))]; - case 1: - right = _b.sent(); - if (!node.await) return [3, 8]; - iterator = getAsyncIterator(right); - ret = void 0; - AWAIT.RES = iterator.next(); - return [4, AWAIT]; - case 2: - ret = _b.sent(); - _b.label = 3; - case 3: - if (!!ret.done) return [3, 7]; - return [5, __values(ForXHandler(node, scope, { value: ret.value }))]; - case 4: - result = _b.sent(); - if (result === BREAK) { - return [3, 7]; - } - else if (result === CONTINUE) { - return [3, 5]; - } - else if (result === RETURN) { - return [2, result]; - } - _b.label = 5; - case 5: - AWAIT.RES = iterator.next(); - return [4, AWAIT]; - case 6: - ret = _b.sent(); - return [3, 3]; - case 7: return [3, 15]; - case 8: - _b.trys.push([8, 13, 14, 15]); - right_1 = __values(right), right_1_1 = right_1.next(); - _b.label = 9; - case 9: - if (!!right_1_1.done) return [3, 12]; - value = right_1_1.value; - return [5, __values(ForXHandler(node, scope, { value: value }))]; - case 10: - result = _b.sent(); - if (result === BREAK) { - return [3, 12]; - } - else if (result === CONTINUE) { - return [3, 11]; - } - else if (result === RETURN) { - return [2, result]; - } - _b.label = 11; - case 11: - right_1_1 = right_1.next(); - return [3, 9]; - case 12: return [3, 15]; - case 13: - e_1_1 = _b.sent(); - e_1 = { error: e_1_1 }; - return [3, 15]; - case 14: - try { - if (right_1_1 && !right_1_1.done && (_a = right_1.return)) _a.call(right_1); - } - finally { if (e_1) throw e_1.error; } - return [7]; - case 15: return [2]; - } - }); + function ExpressionStatement$1(node, scope) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.expression, scope))]; + case 1: + _a.sent(); + return [2]; + } + }); + } + function BlockStatement$1(block, scope, options) { + var _a, invasived, _b, hoisted, subScope, i, result; + if (options === void 0) { options = {}; } + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _a = options.invasived, invasived = _a === void 0 ? false : _a, _b = options.hoisted, hoisted = _b === void 0 ? false : _b; + subScope = invasived ? scope : new Scope(scope); + if (!!hoisted) return [3, 2]; + return [5, __values(hoist(block, subScope, { onlyBlock: true }))]; + case 1: + _c.sent(); + _c.label = 2; + case 2: + i = 0; + _c.label = 3; + case 3: + if (!(i < block.body.length)) return [3, 6]; + return [5, __values(evaluate$1(block.body[i], subScope))]; + case 4: + result = _c.sent(); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return [2, result]; + } + _c.label = 5; + case 5: + i++; + return [3, 3]; + case 6: return [2]; + } + }); + } + function EmptyStatement$1() { + return __generator(this, function (_a) { + return [2]; + }); + } + function DebuggerStatement$1() { + return __generator(this, function (_a) { + debugger; + return [2]; + }); + } + function ReturnStatement$1(node, scope) { + var _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _a = RETURN; + if (!node.argument) return [3, 2]; + return [5, __values(evaluate$1(node.argument, scope))]; + case 1: + _b = (_c.sent()); + return [3, 3]; + case 2: + _b = undefined; + _c.label = 3; + case 3: + _a.RES = _b; + return [2, RETURN]; + } + }); + } + function BreakStatement$1() { + return __generator(this, function (_a) { + return [2, BREAK]; + }); + } + function ContinueStatement$1() { + return __generator(this, function (_a) { + return [2, CONTINUE]; + }); + } + function IfStatement$1(node, scope) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.test, scope))]; + case 1: + if (!_a.sent()) return [3, 3]; + return [5, __values(evaluate$1(node.consequent, scope))]; + case 2: return [2, _a.sent()]; + case 3: return [5, __values(evaluate$1(node.alternate, scope))]; + case 4: return [2, _a.sent()]; + } + }); + } + function SwitchStatement$1(node, scope) { + var discriminant, matched, i, eachCase, _a, _b, result; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [5, __values(evaluate$1(node.discriminant, scope))]; + case 1: + discriminant = _c.sent(); + matched = false; + i = 0; + _c.label = 2; + case 2: + if (!(i < node.cases.length)) return [3, 8]; + eachCase = node.cases[i]; + _a = !matched; + if (!_a) return [3, 5]; + _b = !eachCase.test; + if (_b) return [3, 4]; + return [5, __values(evaluate$1(eachCase.test, scope))]; + case 3: + _b = (_c.sent()) === discriminant; + _c.label = 4; + case 4: + _a = (_b); + _c.label = 5; + case 5: + if (_a) { + matched = true; + } + if (!matched) return [3, 7]; + return [5, __values(SwitchCase$1(eachCase, scope))]; + case 6: + result = _c.sent(); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return [2, result]; + } + _c.label = 7; + case 7: + i++; + return [3, 2]; + case 8: return [2]; + } + }); + } + function SwitchCase$1(node, scope) { + var i, result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + i = 0; + _a.label = 1; + case 1: + if (!(i < node.consequent.length)) return [3, 4]; + return [5, __values(evaluate$1(node.consequent[i], scope))]; + case 2: + result = _a.sent(); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return [2, result]; + } + _a.label = 3; + case 3: + i++; + return [3, 1]; + case 4: return [2]; + } + }); + } + function ThrowStatement$1(node, scope) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.argument, scope))]; + case 1: throw _a.sent(); + } + }); + } + function TryStatement$1(node, scope) { + var err_1, subScope, param, name_1, result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, 9, 12]); + return [5, __values(BlockStatement$1(node.block, scope))]; + case 1: return [2, _a.sent()]; + case 2: + err_1 = _a.sent(); + if (!node.handler) return [3, 7]; + subScope = new Scope(scope); + param = node.handler.param; + if (!param) return [3, 5]; + if (!(param.type === 'Identifier')) return [3, 3]; + name_1 = param.name; + subScope.let(name_1, err_1); + return [3, 5]; + case 3: return [5, __values(pattern$2(param, scope, { feed: err_1 }))]; + case 4: + _a.sent(); + _a.label = 5; + case 5: return [5, __values(CatchClause$1(node.handler, subScope))]; + case 6: return [2, _a.sent()]; + case 7: throw err_1; + case 8: return [3, 12]; + case 9: + if (!node.finalizer) return [3, 11]; + return [5, __values(BlockStatement$1(node.finalizer, scope))]; + case 10: + result = _a.sent(); + if (result === BREAK || result === CONTINUE || result === RETURN) { + return [2, result]; + } + _a.label = 11; + case 11: return [7]; + case 12: return [2]; + } + }); + } + function CatchClause$1(node, scope) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(BlockStatement$1(node.body, scope, { invasived: true }))]; + case 1: return [2, _a.sent()]; + } + }); + } + function WhileStatement$1(node, scope) { + var result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.test, scope))]; + case 1: + if (!_a.sent()) return [3, 3]; + return [5, __values(evaluate$1(node.body, scope))]; + case 2: + result = _a.sent(); + if (result === BREAK) { + return [3, 3]; + } + else if (result === CONTINUE) { + return [3, 0]; + } + else if (result === RETURN) { + return [2, result]; + } + return [3, 0]; + case 3: return [2]; + } + }); + } + function DoWhileStatement$1(node, scope) { + var result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.body, scope))]; + case 1: + result = _a.sent(); + if (result === BREAK) { + return [3, 4]; + } + else if (result === CONTINUE) { + return [3, 2]; + } + else if (result === RETURN) { + return [2, result]; + } + _a.label = 2; + case 2: return [5, __values(evaluate$1(node.test, scope))]; + case 3: + if (_a.sent()) return [3, 0]; + _a.label = 4; + case 4: return [2]; + } + }); + } + function ForStatement$1(node, scope) { + var forScope, _a, subScope, result; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + forScope = new Scope(scope); + return [5, __values(evaluate$1(node.init, forScope))]; + case 1: + _b.sent(); + _b.label = 2; + case 2: + if (!node.test) return [3, 4]; + return [5, __values(evaluate$1(node.test, forScope))]; + case 3: + _a = (_b.sent()); + return [3, 5]; + case 4: + _a = true; + _b.label = 5; + case 5: + if (!_a) return [3, 12]; + subScope = new Scope(forScope); + result = void 0; + if (!(node.body.type === 'BlockStatement')) return [3, 7]; + return [5, __values(BlockStatement$1(node.body, subScope, { invasived: true }))]; + case 6: + result = _b.sent(); + return [3, 9]; + case 7: return [5, __values(evaluate$1(node.body, subScope))]; + case 8: + result = _b.sent(); + _b.label = 9; + case 9: + if (result === BREAK) { + return [3, 12]; + } + else if (result === CONTINUE) { + return [3, 10]; + } + else if (result === RETURN) { + return [2, result]; + } + _b.label = 10; + case 10: return [5, __values(evaluate$1(node.update, forScope))]; + case 11: + _b.sent(); + return [3, 2]; + case 12: return [2]; + } + }); + } + function ForInStatement$1(node, scope) { + var _a, _b, _i, value, result; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _a = []; + return [5, __values(evaluate$1(node.right, scope))]; + case 1: + for (_b in _c.sent()) + _a.push(_b); + _i = 0; + _c.label = 2; + case 2: + if (!(_i < _a.length)) return [3, 5]; + value = _a[_i]; + return [5, __values(ForXHandler(node, scope, { value: value }))]; + case 3: + result = _c.sent(); + if (result === BREAK) { + return [3, 5]; + } + else if (result === CONTINUE) { + return [3, 4]; + } + else if (result === RETURN) { + return [2, result]; + } + _c.label = 4; + case 4: + _i++; + return [3, 2]; + case 5: return [2]; + } + }); + } + function ForOfStatement$1(node, scope) { + var right, iterator, ret, result, right_1, right_1_1, value, result, e_1_1; + var e_1, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [5, __values(evaluate$1(node.right, scope))]; + case 1: + right = _b.sent(); + if (!node.await) return [3, 8]; + iterator = getAsyncIterator(right); + ret = void 0; + AWAIT.RES = iterator.next(); + return [4, AWAIT]; + case 2: + ret = _b.sent(); + _b.label = 3; + case 3: + if (!!ret.done) return [3, 7]; + return [5, __values(ForXHandler(node, scope, { value: ret.value }))]; + case 4: + result = _b.sent(); + if (result === BREAK) { + return [3, 7]; + } + else if (result === CONTINUE) { + return [3, 5]; + } + else if (result === RETURN) { + return [2, result]; + } + _b.label = 5; + case 5: + AWAIT.RES = iterator.next(); + return [4, AWAIT]; + case 6: + ret = _b.sent(); + return [3, 3]; + case 7: return [3, 15]; + case 8: + _b.trys.push([8, 13, 14, 15]); + right_1 = __values(right), right_1_1 = right_1.next(); + _b.label = 9; + case 9: + if (!!right_1_1.done) return [3, 12]; + value = right_1_1.value; + return [5, __values(ForXHandler(node, scope, { value: value }))]; + case 10: + result = _b.sent(); + if (result === BREAK) { + return [3, 12]; + } + else if (result === CONTINUE) { + return [3, 11]; + } + else if (result === RETURN) { + return [2, result]; + } + _b.label = 11; + case 11: + right_1_1 = right_1.next(); + return [3, 9]; + case 12: return [3, 15]; + case 13: + e_1_1 = _b.sent(); + e_1 = { error: e_1_1 }; + return [3, 15]; + case 14: + try { + if (right_1_1 && !right_1_1.done && (_a = right_1.return)) _a.call(right_1); + } + finally { if (e_1) throw e_1.error; } + return [7]; + case 15: return [2]; + } + }); } var statement$1 = /*#__PURE__*/Object.freeze({ @@ -2985,207 +2875,207 @@ ForOfStatement: ForOfStatement$1 }); - function ObjectPattern$1(node, scope, options) { - var _a, kind, _b, hoist, _c, onlyBlock, _d, feed, fedKeys, i, property, value, key, value, rest, i_1; - if (options === void 0) { options = {}; } - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed, feed = _d === void 0 ? {} : _d; - fedKeys = []; - i = 0; - _e.label = 1; - case 1: - if (!(i < node.properties.length)) return [3, 18]; - property = node.properties[i]; - if (!hoist) return [3, 8]; - if (!(onlyBlock || kind === 'var')) return [3, 7]; - if (!(property.type === 'Property')) return [3, 5]; - value = property.value; - if (!(value.type === 'Identifier')) return [3, 2]; - scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); - return [3, 4]; - case 2: return [5, __values(pattern$2(value, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; - case 3: - _e.sent(); - _e.label = 4; - case 4: return [3, 7]; - case 5: return [5, __values(RestElement$1(property, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; - case 6: - _e.sent(); - _e.label = 7; - case 7: return [3, 17]; - case 8: - if (!(property.type === 'Property')) return [3, 15]; - key = void 0; - if (!property.computed) return [3, 10]; - return [5, __values(evaluate$1(property.key, scope))]; - case 9: - key = _e.sent(); - return [3, 11]; - case 10: - key = property.key.name; - _e.label = 11; - case 11: - fedKeys.push(key); - value = property.value; - if (!(value.type === 'Identifier')) return [3, 12]; - scope[kind](value.name, feed[key]); - return [3, 14]; - case 12: return [5, __values(pattern$2(value, scope, { kind: kind, feed: feed[key] }))]; - case 13: - _e.sent(); - _e.label = 14; - case 14: return [3, 17]; - case 15: - rest = assign({}, feed); - for (i_1 = 0; i_1 < fedKeys.length; i_1++) - delete rest[fedKeys[i_1]]; - return [5, __values(RestElement$1(property, scope, { kind: kind, feed: rest }))]; - case 16: - _e.sent(); - _e.label = 17; - case 17: - i++; - return [3, 1]; - case 18: return [2]; - } - }); - } - function ArrayPattern$1(node, scope, options) { - var kind, _a, hoist, _b, onlyBlock, _c, feed, result, i, element, variable; - if (options === void 0) { options = {}; } - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; - result = []; - i = 0; - _d.label = 1; - case 1: - if (!(i < node.elements.length)) return [3, 14]; - element = node.elements[i]; - if (!element) - return [3, 13]; - if (!hoist) return [3, 5]; - if (!(onlyBlock || kind === 'var')) return [3, 4]; - if (!(element.type === 'Identifier')) return [3, 2]; - scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); - return [3, 4]; - case 2: return [5, __values(pattern$2(element, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; - case 3: - _d.sent(); - _d.label = 4; - case 4: return [3, 13]; - case 5: - if (!(element.type === 'Identifier')) return [3, 9]; - if (!kind) return [3, 6]; - scope[kind](element.name, feed[i]); - return [3, 8]; - case 6: return [5, __values(Identifier$1(element, scope, { getVar: true }))]; - case 7: - variable = _d.sent(); - variable.set(feed[i]); - result.push(variable.get()); - _d.label = 8; - case 8: return [3, 13]; - case 9: - if (!(element.type === 'RestElement')) return [3, 11]; - return [5, __values(RestElement$1(element, scope, { kind: kind, feed: feed.slice(i) }))]; - case 10: - _d.sent(); - return [3, 13]; - case 11: return [5, __values(pattern$2(element, scope, { kind: kind, feed: feed[i] }))]; - case 12: - _d.sent(); - _d.label = 13; - case 13: - i++; - return [3, 1]; - case 14: - if (result.length) { - return [2, result]; - } - return [2]; - } - }); - } - function RestElement$1(node, scope, options) { - var kind, _a, hoist, _b, onlyBlock, _c, feed, arg, variable; - if (options === void 0) { options = {}; } - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; - arg = node.argument; - if (!hoist) return [3, 4]; - if (!(onlyBlock || kind === 'var')) return [3, 3]; - if (!(arg.type === 'Identifier')) return [3, 1]; - scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); - return [3, 3]; - case 1: return [5, __values(pattern$2(arg, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; - case 2: - _d.sent(); - _d.label = 3; - case 3: return [3, 10]; - case 4: - if (!(arg.type === 'Identifier')) return [3, 8]; - if (!kind) return [3, 5]; - scope[kind](arg.name, feed); - return [3, 7]; - case 5: return [5, __values(Identifier$1(arg, scope, { getVar: true }))]; - case 6: - variable = _d.sent(); - variable.set(feed); - _d.label = 7; - case 7: return [3, 10]; - case 8: return [5, __values(pattern$2(arg, scope, { kind: kind, feed: feed }))]; - case 9: - _d.sent(); - _d.label = 10; - case 10: return [2]; - } - }); - } - function AssignmentPattern$1(node, scope, options) { - var _a, kind, _b, hoist, _c, onlyBlock, _d, feed, _e, left; - if (options === void 0) { options = {}; } - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed; - if (!(_d === void 0)) return [3, 2]; - return [5, __values(evaluate$1(node.right, scope))]; - case 1: - _e = _f.sent(); - return [3, 3]; - case 2: - _e = _d; - _f.label = 3; - case 3: - feed = _e; - left = node.left; - if (!hoist) return [3, 7]; - if (!(onlyBlock || kind === 'var')) return [3, 6]; - if (!(left.type === 'Identifier')) return [3, 4]; - scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); - return [3, 6]; - case 4: return [5, __values(pattern$2(left, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; - case 5: - _f.sent(); - _f.label = 6; - case 6: return [3, 10]; - case 7: - if (!(left.type === 'Identifier')) return [3, 8]; - scope[kind](left.name, feed); - return [3, 10]; - case 8: return [5, __values(pattern$2(left, scope, { kind: kind, feed: feed }))]; - case 9: - _f.sent(); - _f.label = 10; - case 10: return [2]; - } - }); + function ObjectPattern$1(node, scope, options) { + var _a, kind, _b, hoist, _c, onlyBlock, _d, feed, fedKeys, i, property, value, key, value, rest, i_1; + if (options === void 0) { options = {}; } + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed, feed = _d === void 0 ? {} : _d; + fedKeys = []; + i = 0; + _e.label = 1; + case 1: + if (!(i < node.properties.length)) return [3, 18]; + property = node.properties[i]; + if (!hoist) return [3, 8]; + if (!(onlyBlock || kind === 'var')) return [3, 7]; + if (!(property.type === 'Property')) return [3, 5]; + value = property.value; + if (!(value.type === 'Identifier')) return [3, 2]; + scope[onlyBlock ? kind : 'var'](value.name, onlyBlock ? DEADZONE : undefined); + return [3, 4]; + case 2: return [5, __values(pattern$2(value, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; + case 3: + _e.sent(); + _e.label = 4; + case 4: return [3, 7]; + case 5: return [5, __values(RestElement$1(property, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; + case 6: + _e.sent(); + _e.label = 7; + case 7: return [3, 17]; + case 8: + if (!(property.type === 'Property')) return [3, 15]; + key = void 0; + if (!property.computed) return [3, 10]; + return [5, __values(evaluate$1(property.key, scope))]; + case 9: + key = _e.sent(); + return [3, 11]; + case 10: + key = property.key.name; + _e.label = 11; + case 11: + fedKeys.push(key); + value = property.value; + if (!(value.type === 'Identifier')) return [3, 12]; + scope[kind](value.name, feed[key]); + return [3, 14]; + case 12: return [5, __values(pattern$2(value, scope, { kind: kind, feed: feed[key] }))]; + case 13: + _e.sent(); + _e.label = 14; + case 14: return [3, 17]; + case 15: + rest = assign({}, feed); + for (i_1 = 0; i_1 < fedKeys.length; i_1++) + delete rest[fedKeys[i_1]]; + return [5, __values(RestElement$1(property, scope, { kind: kind, feed: rest }))]; + case 16: + _e.sent(); + _e.label = 17; + case 17: + i++; + return [3, 1]; + case 18: return [2]; + } + }); + } + function ArrayPattern$1(node, scope, options) { + var kind, _a, hoist, _b, onlyBlock, _c, feed, result, i, element, variable; + if (options === void 0) { options = {}; } + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; + result = []; + i = 0; + _d.label = 1; + case 1: + if (!(i < node.elements.length)) return [3, 14]; + element = node.elements[i]; + if (!element) + return [3, 13]; + if (!hoist) return [3, 5]; + if (!(onlyBlock || kind === 'var')) return [3, 4]; + if (!(element.type === 'Identifier')) return [3, 2]; + scope[onlyBlock ? kind : 'var'](element.name, onlyBlock ? DEADZONE : undefined); + return [3, 4]; + case 2: return [5, __values(pattern$2(element, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; + case 3: + _d.sent(); + _d.label = 4; + case 4: return [3, 13]; + case 5: + if (!(element.type === 'Identifier')) return [3, 9]; + if (!kind) return [3, 6]; + scope[kind](element.name, feed[i]); + return [3, 8]; + case 6: return [5, __values(Identifier$1(element, scope, { getVar: true }))]; + case 7: + variable = _d.sent(); + variable.set(feed[i]); + result.push(variable.get()); + _d.label = 8; + case 8: return [3, 13]; + case 9: + if (!(element.type === 'RestElement')) return [3, 11]; + return [5, __values(RestElement$1(element, scope, { kind: kind, feed: feed.slice(i) }))]; + case 10: + _d.sent(); + return [3, 13]; + case 11: return [5, __values(pattern$2(element, scope, { kind: kind, feed: feed[i] }))]; + case 12: + _d.sent(); + _d.label = 13; + case 13: + i++; + return [3, 1]; + case 14: + if (result.length) { + return [2, result]; + } + return [2]; + } + }); + } + function RestElement$1(node, scope, options) { + var kind, _a, hoist, _b, onlyBlock, _c, feed, arg, variable; + if (options === void 0) { options = {}; } + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + kind = options.kind, _a = options.hoist, hoist = _a === void 0 ? false : _a, _b = options.onlyBlock, onlyBlock = _b === void 0 ? false : _b, _c = options.feed, feed = _c === void 0 ? [] : _c; + arg = node.argument; + if (!hoist) return [3, 4]; + if (!(onlyBlock || kind === 'var')) return [3, 3]; + if (!(arg.type === 'Identifier')) return [3, 1]; + scope[onlyBlock ? kind : 'var'](arg.name, onlyBlock ? DEADZONE : undefined); + return [3, 3]; + case 1: return [5, __values(pattern$2(arg, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; + case 2: + _d.sent(); + _d.label = 3; + case 3: return [3, 10]; + case 4: + if (!(arg.type === 'Identifier')) return [3, 8]; + if (!kind) return [3, 5]; + scope[kind](arg.name, feed); + return [3, 7]; + case 5: return [5, __values(Identifier$1(arg, scope, { getVar: true }))]; + case 6: + variable = _d.sent(); + variable.set(feed); + _d.label = 7; + case 7: return [3, 10]; + case 8: return [5, __values(pattern$2(arg, scope, { kind: kind, feed: feed }))]; + case 9: + _d.sent(); + _d.label = 10; + case 10: return [2]; + } + }); + } + function AssignmentPattern$1(node, scope, options) { + var _a, kind, _b, hoist, _c, onlyBlock, _d, feed, _e, left; + if (options === void 0) { options = {}; } + return __generator(this, function (_f) { + switch (_f.label) { + case 0: + _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, _d = options.feed; + if (!(_d === void 0)) return [3, 2]; + return [5, __values(evaluate$1(node.right, scope))]; + case 1: + _e = _f.sent(); + return [3, 3]; + case 2: + _e = _d; + _f.label = 3; + case 3: + feed = _e; + left = node.left; + if (!hoist) return [3, 7]; + if (!(onlyBlock || kind === 'var')) return [3, 6]; + if (!(left.type === 'Identifier')) return [3, 4]; + scope[onlyBlock ? kind : 'var'](left.name, onlyBlock ? DEADZONE : undefined); + return [3, 6]; + case 4: return [5, __values(pattern$2(left, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; + case 5: + _f.sent(); + _f.label = 6; + case 6: return [3, 10]; + case 7: + if (!(left.type === 'Identifier')) return [3, 8]; + scope[kind](left.name, feed); + return [3, 10]; + case 8: return [5, __values(pattern$2(left, scope, { kind: kind, feed: feed }))]; + case 9: + _f.sent(); + _f.label = 10; + case 10: return [2]; + } + }); } var pattern$1 = /*#__PURE__*/Object.freeze({ @@ -3195,862 +3085,872 @@ AssignmentPattern: AssignmentPattern$1 }); - var evaluateOps$1; - function evaluate$1(node, scope) { - var handler; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!node) - return [2]; - if (!evaluateOps$1) { - evaluateOps$1 = assign({}, declaration$1, expression$1, identifier$1, statement$1, literal$1, pattern$1); - } - handler = evaluateOps$1[node.type]; - if (!handler) return [3, 2]; - return [5, __values(handler(node, scope))]; - case 1: return [2, _a.sent()]; - case 2: throw new Error(node.type + " isn't implemented"); - } - }); + var evaluateOps$1; + function evaluate$1(node, scope) { + var handler; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!node) + return [2]; + if (!evaluateOps$1) { + evaluateOps$1 = assign({}, declaration$1, expression$1, identifier$1, statement$1, literal$1, pattern$1); + } + handler = evaluateOps$1[node.type]; + if (!handler) return [3, 2]; + return [5, __values(handler(node, scope))]; + case 1: return [2, _a.sent()]; + case 2: throw new Error(node.type + " isn't implemented"); + } + }); } - function FunctionDeclaration$1(node, scope) { - return __generator(this, function (_a) { - scope.func(node.id.name, createFunc(node, scope)); - return [2]; - }); - } - function VariableDeclaration$1(node, scope, options) { - var i; - if (options === void 0) { options = {}; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - i = 0; - _a.label = 1; - case 1: - if (!(i < node.declarations.length)) return [3, 4]; - return [5, __values(VariableDeclarator$1(node.declarations[i], scope, assign({ kind: node.kind }, options)))]; - case 2: - _a.sent(); - _a.label = 3; - case 3: - i++; - return [3, 1]; - case 4: return [2]; - } - }); - } - function VariableDeclarator$1(node, scope, options) { - var _a, kind, _b, hoist, _c, onlyBlock, feed, hasFeed, value, _d, name_1; - if (options === void 0) { options = {}; } - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, feed = options.feed; - if (!hoist) return [3, 4]; - if (!(onlyBlock || kind === 'var')) return [3, 3]; - if (!(node.id.type === 'Identifier')) return [3, 1]; - scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); - return [3, 3]; - case 1: return [5, __values(pattern$2(node.id, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; - case 2: - _e.sent(); - _e.label = 3; - case 3: return [3, 10]; - case 4: - hasFeed = 'feed' in options; - if (!hasFeed) return [3, 5]; - _d = feed; - return [3, 7]; - case 5: return [5, __values(evaluate$1(node.init, scope))]; - case 6: - _d = _e.sent(); - _e.label = 7; - case 7: - value = _d; - if (!(node.id.type === 'Identifier')) return [3, 8]; - name_1 = node.id.name; - if (kind === 'var' && !node.init && !hasFeed) { - scope.var(name_1, NOINIT); - } - else { - scope[kind](name_1, value); - } - if (node.init - && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] - .indexOf(node.init.type) !== -1 - && !value.name) { - define(value, 'name', { - value: name_1, - configurable: true - }); - } - return [3, 10]; - case 8: return [5, __values(pattern$2(node.id, scope, { kind: kind, feed: value }))]; - case 9: - _e.sent(); - _e.label = 10; - case 10: return [2]; - } - }); - } - function ClassDeclaration$1(node, scope) { - var _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - _b = (_a = scope).func; - _c = [node.id.name]; - return [5, __values(createClass(node, scope))]; - case 1: - _b.apply(_a, _c.concat([_d.sent()])); - return [2]; - } - }); - } - function ClassBody$1(node, scope, options) { - var klass, superClass, i; - if (options === void 0) { options = {}; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - klass = options.klass, superClass = options.superClass; - i = 0; - _a.label = 1; - case 1: - if (!(i < node.body.length)) return [3, 4]; - return [5, __values(MethodDefinition$1(node.body[i], scope, { klass: klass, superClass: superClass }))]; - case 2: - _a.sent(); - _a.label = 3; - case 3: - i++; - return [3, 1]; - case 4: return [2]; - } - }); - } - function MethodDefinition$1(node, scope, options) { - var klass, superClass, key, obj, value, oriDptor, oriDptor; - if (options === void 0) { options = {}; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - klass = options.klass, superClass = options.superClass; - if (!node.computed) return [3, 2]; - return [5, __values(evaluate$1(node.key, scope))]; - case 1: - key = _a.sent(); - return [3, 3]; - case 2: - if (node.key.type === 'Identifier') { - key = node.key.name; - } - else { - throw new SyntaxError('Unexpected token'); - } - _a.label = 3; - case 3: - obj = node.static ? klass : klass.prototype; - value = createFunc(node.value, scope, { superClass: superClass }); - switch (node.kind) { - case 'constructor': - break; - case 'method': - define(obj, key, { - value: value, - writable: true, - configurable: true, - }); - break; - case 'get': { - oriDptor = getDptor(obj, key); - define(obj, key, { - get: value, - set: oriDptor && oriDptor.set, - configurable: true, - }); - break; - } - case 'set': { - oriDptor = getDptor(obj, key); - define(obj, key, { - get: oriDptor && oriDptor.get, - set: value, - configurable: true, - }); - break; - } - default: - throw new SyntaxError('Unexpected token'); - } - return [2]; - } - }); + function FunctionDeclaration$1(node, scope) { + return __generator(this, function (_a) { + scope.func(node.id.name, createFunc(node, scope)); + return [2]; + }); + } + function VariableDeclaration$1(node, scope, options) { + var i; + if (options === void 0) { options = {}; } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + i = 0; + _a.label = 1; + case 1: + if (!(i < node.declarations.length)) return [3, 4]; + return [5, __values(VariableDeclarator$1(node.declarations[i], scope, assign({ kind: node.kind }, options)))]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + i++; + return [3, 1]; + case 4: return [2]; + } + }); + } + function VariableDeclarator$1(node, scope, options) { + var _a, kind, _b, hoist, _c, onlyBlock, feed, hasFeed, value, _d, name_1; + if (options === void 0) { options = {}; } + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + _a = options.kind, kind = _a === void 0 ? 'let' : _a, _b = options.hoist, hoist = _b === void 0 ? false : _b, _c = options.onlyBlock, onlyBlock = _c === void 0 ? false : _c, feed = options.feed; + if (!hoist) return [3, 4]; + if (!(onlyBlock || kind === 'var')) return [3, 3]; + if (!(node.id.type === 'Identifier')) return [3, 1]; + scope[onlyBlock ? kind : 'var'](node.id.name, onlyBlock ? DEADZONE : undefined); + return [3, 3]; + case 1: return [5, __values(pattern$2(node.id, scope, { kind: kind, hoist: hoist, onlyBlock: onlyBlock }))]; + case 2: + _e.sent(); + _e.label = 3; + case 3: return [3, 10]; + case 4: + hasFeed = 'feed' in options; + if (!hasFeed) return [3, 5]; + _d = feed; + return [3, 7]; + case 5: return [5, __values(evaluate$1(node.init, scope))]; + case 6: + _d = _e.sent(); + _e.label = 7; + case 7: + value = _d; + if (!(node.id.type === 'Identifier')) return [3, 8]; + name_1 = node.id.name; + if (kind === 'var' && !node.init && !hasFeed) { + scope.var(name_1, NOINIT); + } + else { + scope[kind](name_1, value); + } + if (node.init + && ['ClassExpression', 'FunctionExpression', 'ArrowFunctionExpression'] + .indexOf(node.init.type) !== -1 + && !value.name) { + define(value, 'name', { + value: name_1, + configurable: true + }); + } + return [3, 10]; + case 8: return [5, __values(pattern$2(node.id, scope, { kind: kind, feed: value }))]; + case 9: + _e.sent(); + _e.label = 10; + case 10: return [2]; + } + }); + } + function ClassDeclaration$1(node, scope) { + var _a, _b, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _b = (_a = scope).func; + _c = [node.id.name]; + return [5, __values(createClass(node, scope))]; + case 1: + _b.apply(_a, _c.concat([_d.sent()])); + return [2]; + } + }); + } + function ClassBody$1(node, scope, options) { + var klass, superClass, i; + if (options === void 0) { options = {}; } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + klass = options.klass, superClass = options.superClass; + i = 0; + _a.label = 1; + case 1: + if (!(i < node.body.length)) return [3, 4]; + return [5, __values(MethodDefinition$1(node.body[i], scope, { klass: klass, superClass: superClass }))]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + i++; + return [3, 1]; + case 4: return [2]; + } + }); + } + function MethodDefinition$1(node, scope, options) { + var klass, superClass, key, obj, value, oriDptor, oriDptor; + if (options === void 0) { options = {}; } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + klass = options.klass, superClass = options.superClass; + if (!node.computed) return [3, 2]; + return [5, __values(evaluate$1(node.key, scope))]; + case 1: + key = _a.sent(); + return [3, 3]; + case 2: + if (node.key.type === 'Identifier') { + key = node.key.name; + } + else { + throw new SyntaxError('Unexpected token'); + } + _a.label = 3; + case 3: + obj = node.static ? klass : klass.prototype; + value = createFunc(node.value, scope, { superClass: superClass }); + switch (node.kind) { + case 'constructor': + break; + case 'method': + define(obj, key, { + value: value, + writable: true, + configurable: true, + }); + break; + case 'get': { + oriDptor = getDptor(obj, key); + define(obj, key, { + get: value, + set: oriDptor && oriDptor.set, + configurable: true, + }); + break; + } + case 'set': { + oriDptor = getDptor(obj, key); + define(obj, key, { + get: oriDptor && oriDptor.get, + set: value, + configurable: true, + }); + break; + } + default: + throw new SyntaxError('Unexpected token'); + } + return [2]; + } + }); } - function runAsync(iterator, options) { - if (options === void 0) { options = {}; } - var res = options.res, err = options.err, ret = options.ret, fullRet = options.fullRet; - return new Promise(function (resolve, reject) { - if ('ret' in options) { - return resolve(iterator.return(ret)); - } - if ('err' in options) { - onRejected(err); - } - else { - onFulfilled(res); - } - function onFulfilled(res) { - var ret; - try { - ret = iterator.next(res); - } - catch (e) { - return reject(e); - } - next(ret); - return null; - } - function onRejected(err) { - var ret; - try { - ret = iterator.throw(err); - } - catch (e) { - return reject(e); - } - next(ret); - } - function next(ret) { - if (ret.done) - return resolve(fullRet ? ret : ret.value); - if (ret.value !== AWAIT) - return resolve(ret); - var awaitValue = ret.value.RES; - var value = awaitValue && awaitValue.then === 'function' - ? awaitValue : Promise.resolve(awaitValue); - return value.then(onFulfilled, onRejected); - } - }); + function runAsync(iterator, options) { + if (options === void 0) { options = {}; } + var res = options.res, err = options.err, ret = options.ret, fullRet = options.fullRet; + return new Promise(function (resolve, reject) { + if ('ret' in options) { + return resolve(iterator.return(ret)); + } + if ('err' in options) { + onRejected(err); + } + else { + onFulfilled(res); + } + function onFulfilled(res) { + var ret; + try { + ret = iterator.next(res); + } + catch (e) { + return reject(e); + } + next(ret); + return null; + } + function onRejected(err) { + var ret; + try { + ret = iterator.throw(err); + } + catch (e) { + return reject(e); + } + next(ret); + } + function next(ret) { + if (ret.done) + return resolve(fullRet ? ret : ret.value); + if (ret.value !== AWAIT) + return resolve(ret); + var awaitValue = ret.value.RES; + var value = awaitValue && awaitValue.then === 'function' + ? awaitValue : Promise.resolve(awaitValue); + return value.then(onFulfilled, onRejected); + } + }); } - function hoist(block, scope, options) { - var _a, onlyBlock, funcDclrList, funcDclrIdxs, i, statement, i; - if (options === void 0) { options = {}; } - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = options.onlyBlock, onlyBlock = _a === void 0 ? false : _a; - funcDclrList = []; - funcDclrIdxs = []; - i = 0; - _b.label = 1; - case 1: - if (!(i < block.body.length)) return [3, 7]; - statement = block.body[i]; - if (!(statement.type === 'FunctionDeclaration')) return [3, 2]; - funcDclrList.push(statement); - funcDclrIdxs.push(i); - return [3, 6]; - case 2: - if (!(statement.type === 'VariableDeclaration' - && ['const', 'let'].indexOf(statement.kind) !== -1)) return [3, 4]; - return [5, __values(VariableDeclaration$1(statement, scope, { hoist: true, onlyBlock: true }))]; - case 3: - _b.sent(); - return [3, 6]; - case 4: - if (!!onlyBlock) return [3, 6]; - return [5, __values(hoistVarRecursion(statement, scope))]; - case 5: - _b.sent(); - _b.label = 6; - case 6: - i++; - return [3, 1]; - case 7: - if (funcDclrIdxs.length) { - for (i = funcDclrIdxs.length - 1; i > -1; i--) { - block.body.splice(funcDclrIdxs[i], 1); - } - block.body = funcDclrList.concat(block.body); - } - return [2]; - } - }); - } - function hoistVarRecursion(statement, scope) { - var _a, i, i, j, tryBlock, i, catchBlock, i, finalBlock, i; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = statement.type; - switch (_a) { - case 'VariableDeclaration': return [3, 1]; - case 'WhileStatement': return [3, 3]; - case 'DoWhileStatement': return [3, 3]; - case 'ForStatement': return [3, 3]; - case 'ForInStatement': return [3, 3]; - case 'ForOfStatement': return [3, 3]; - case 'BlockStatement': return [3, 5]; - case 'SwitchStatement': return [3, 10]; - case 'TryStatement': return [3, 17]; - } - return [3, 30]; - case 1: return [5, __values(VariableDeclaration$1(statement, scope, { hoist: true }))]; - case 2: - _b.sent(); - return [3, 30]; - case 3: return [5, __values(hoistVarRecursion(statement.body, scope))]; - case 4: - _b.sent(); - return [3, 30]; - case 5: - i = 0; - _b.label = 6; - case 6: - if (!(i < statement.body.length)) return [3, 9]; - return [5, __values(hoistVarRecursion(statement.body[i], scope))]; - case 7: - _b.sent(); - _b.label = 8; - case 8: - i++; - return [3, 6]; - case 9: return [3, 30]; - case 10: - i = 0; - _b.label = 11; - case 11: - if (!(i < statement.cases.length)) return [3, 16]; - j = 0; - _b.label = 12; - case 12: - if (!(j < statement.cases[i].consequent.length)) return [3, 15]; - return [5, __values(hoistVarRecursion(statement.cases[i].consequent[j], scope))]; - case 13: - _b.sent(); - _b.label = 14; - case 14: - j++; - return [3, 12]; - case 15: - i++; - return [3, 11]; - case 16: return [3, 30]; - case 17: - tryBlock = statement.block.body; - i = 0; - _b.label = 18; - case 18: - if (!(i < tryBlock.length)) return [3, 21]; - return [5, __values(hoistVarRecursion(tryBlock[i], scope))]; - case 19: - _b.sent(); - _b.label = 20; - case 20: - i++; - return [3, 18]; - case 21: - catchBlock = statement.handler && statement.handler.body.body; - if (!catchBlock) return [3, 25]; - i = 0; - _b.label = 22; - case 22: - if (!(i < catchBlock.length)) return [3, 25]; - return [5, __values(hoistVarRecursion(catchBlock[i], scope))]; - case 23: - _b.sent(); - _b.label = 24; - case 24: - i++; - return [3, 22]; - case 25: - finalBlock = statement.finalizer && statement.finalizer.body; - if (!finalBlock) return [3, 29]; - i = 0; - _b.label = 26; - case 26: - if (!(i < finalBlock.length)) return [3, 29]; - return [5, __values(hoistVarRecursion(finalBlock[i], scope))]; - case 27: - _b.sent(); - _b.label = 28; - case 28: - i++; - return [3, 26]; - case 29: return [3, 30]; - case 30: return [2]; - } - }); - } - function pattern$2(node, scope, options) { - var _a; - if (options === void 0) { options = {}; } - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = node.type; - switch (_a) { - case 'ObjectPattern': return [3, 1]; - case 'ArrayPattern': return [3, 3]; - case 'RestElement': return [3, 5]; - case 'AssignmentPattern': return [3, 7]; - } - return [3, 9]; - case 1: return [5, __values(ObjectPattern$1(node, scope, options))]; - case 2: return [2, _b.sent()]; - case 3: return [5, __values(ArrayPattern$1(node, scope, options))]; - case 4: return [2, _b.sent()]; - case 5: return [5, __values(RestElement$1(node, scope, options))]; - case 6: return [2, _b.sent()]; - case 7: return [5, __values(AssignmentPattern$1(node, scope, options))]; - case 8: return [2, _b.sent()]; - case 9: throw new SyntaxError('Unexpected token'); - } - }); - } - function createFunc(node, scope, options) { - if (options === void 0) { options = {}; } - if (!node.generator && !node.async) { - return createFunc$1(node, scope, options); - } - var superClass = options.superClass; - var params = node.params; - var tmpFunc = function _a() { - var _i, subScope, i, param, result; - var _newTarget = this && this instanceof _a ? this.constructor : void 0; - var args = []; - for (_i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - subScope = new Scope(scope, true); - if (node.type !== 'ArrowFunctionExpression') { - subScope.const('this', this); - subScope.let('arguments', arguments); - subScope.const(NEWTARGET, _newTarget); - if (superClass) { - subScope.const(SUPER, superClass); - subScope.let(SUPERCALL, false); - } - } - i = 0; - _a.label = 1; - case 1: - if (!(i < params.length)) return [3, 7]; - param = params[i]; - if (!(param.type === 'Identifier')) return [3, 2]; - subScope.let(param.name, args[i]); - return [3, 6]; - case 2: - if (!(param.type === 'RestElement')) return [3, 4]; - return [5, __values(RestElement$1(param, subScope, { kind: 'let', feed: args.slice(i) }))]; - case 3: - _a.sent(); - return [3, 6]; - case 4: return [5, __values(pattern$2(param, subScope, { feed: args[i] }))]; - case 5: - _a.sent(); - _a.label = 6; - case 6: - i++; - return [3, 1]; - case 7: - if (!(node.body.type === 'BlockStatement')) return [3, 10]; - return [5, __values(hoist(node.body, subScope))]; - case 8: - _a.sent(); - return [5, __values(BlockStatement$1(node.body, subScope, { - invasived: true, - hoisted: true - }))]; - case 9: - result = _a.sent(); - return [3, 12]; - case 10: return [5, __values(evaluate$1(node.body, subScope))]; - case 11: - result = _a.sent(); - if (node.type === 'ArrowFunctionExpression') { - RETURN.RES = result; - result = RETURN; - } - _a.label = 12; - case 12: - if (result === RETURN) { - return [2, result.RES]; - } - return [2]; - } - }); - }; - var func; - if (node.async && node.generator) { - func = function () { - var iterator = tmpFunc.apply(void 0, arguments); - var last = Promise.resolve(); - var run = function (opts) { - return last = last.then(function () { return runAsync(iterator, assign({ fullRet: true }, opts)); }); - }; - var asyncIterator = { - next: function (res) { return run({ res: res }); }, - throw: function (err) { return run({ err: err }); }, - return: function (ret) { return run({ ret: ret }); } - }; - if (typeof Symbol === 'function') { - asyncIterator[Symbol.iterator] = function () { return this; }; - } - return asyncIterator; - }; - } - else if (node.async) { - func = function () { return runAsync(tmpFunc.apply(void 0, arguments)); }; - } - else { - func = tmpFunc; - } - define(func, NOCTOR, { value: true }); - define(func, 'name', { - value: node.id - && node.id.name - || '', - configurable: true - }); - define(func, 'length', { - value: params.length, - configurable: true - }); - return func; - } - function createClass(node, scope) { - var superClass, klass, methodBody, i, method; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [5, __values(evaluate$1(node.superClass, scope))]; - case 1: - superClass = _a.sent(); - klass = function () { - if (superClass) { - superClass.apply(this); - } - }; - methodBody = node.body.body; - for (i = 0; i < methodBody.length; i++) { - method = methodBody[i]; - if (method.kind === 'constructor') { - klass = createFunc(method.value, scope, { superClass: superClass }); - break; - } - } - if (superClass) { - inherits(klass, superClass); - } - return [5, __values(ClassBody$1(node.body, scope, { klass: klass, superClass: superClass }))]; - case 2: - _a.sent(); - define(klass, CLSCTOR, { value: true }); - define(klass, 'name', { - value: node.id && node.id.name || '', - configurable: true - }); - return [2, klass]; - } - }); - } - function ForXHandler(node, scope, options) { - var value, left, subScope, variable, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - value = options.value; - left = node.left; - subScope = new Scope(scope); - if (!(left.type === 'VariableDeclaration')) return [3, 2]; - return [5, __values(VariableDeclaration$1(left, subScope, { feed: value }))]; - case 1: - _a.sent(); - return [3, 6]; - case 2: - if (!(left.type === 'Identifier')) return [3, 4]; - return [5, __values(Identifier(left, scope, { getVar: true }))]; - case 3: - variable = _a.sent(); - variable.set(value); - return [3, 6]; - case 4: return [5, __values(pattern$2(left, scope, { feed: value }))]; - case 5: - _a.sent(); - _a.label = 6; - case 6: - if (!(node.body.type === 'BlockStatement')) return [3, 8]; - return [5, __values(BlockStatement$1(node.body, subScope, { invasived: true }))]; - case 7: - result = _a.sent(); - return [3, 10]; - case 8: return [5, __values(evaluate$1(node.body, subScope))]; - case 9: - result = _a.sent(); - _a.label = 10; - case 10: return [2, result]; - } - }); + function hoist(block, scope, options) { + var _a, onlyBlock, funcDclrList, funcDclrIdxs, i, statement, i; + if (options === void 0) { options = {}; } + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = options.onlyBlock, onlyBlock = _a === void 0 ? false : _a; + funcDclrList = []; + funcDclrIdxs = []; + i = 0; + _b.label = 1; + case 1: + if (!(i < block.body.length)) return [3, 7]; + statement = block.body[i]; + if (!(statement.type === 'FunctionDeclaration')) return [3, 2]; + funcDclrList.push(statement); + funcDclrIdxs.push(i); + return [3, 6]; + case 2: + if (!(statement.type === 'VariableDeclaration' + && ['const', 'let'].indexOf(statement.kind) !== -1)) return [3, 4]; + return [5, __values(VariableDeclaration$1(statement, scope, { hoist: true, onlyBlock: true }))]; + case 3: + _b.sent(); + return [3, 6]; + case 4: + if (!!onlyBlock) return [3, 6]; + return [5, __values(hoistVarRecursion(statement, scope))]; + case 5: + _b.sent(); + _b.label = 6; + case 6: + i++; + return [3, 1]; + case 7: + if (funcDclrIdxs.length) { + for (i = funcDclrIdxs.length - 1; i > -1; i--) { + block.body.splice(funcDclrIdxs[i], 1); + } + block.body = funcDclrList.concat(block.body); + } + return [2]; + } + }); + } + function hoistVarRecursion(statement, scope) { + var _a, i, i, j, tryBlock, i, catchBlock, i, finalBlock, i; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = statement.type; + switch (_a) { + case 'VariableDeclaration': return [3, 1]; + case 'WhileStatement': return [3, 3]; + case 'DoWhileStatement': return [3, 3]; + case 'ForStatement': return [3, 3]; + case 'ForInStatement': return [3, 3]; + case 'ForOfStatement': return [3, 3]; + case 'BlockStatement': return [3, 5]; + case 'SwitchStatement': return [3, 10]; + case 'TryStatement': return [3, 17]; + } + return [3, 30]; + case 1: return [5, __values(VariableDeclaration$1(statement, scope, { hoist: true }))]; + case 2: + _b.sent(); + return [3, 30]; + case 3: return [5, __values(hoistVarRecursion(statement.body, scope))]; + case 4: + _b.sent(); + return [3, 30]; + case 5: + i = 0; + _b.label = 6; + case 6: + if (!(i < statement.body.length)) return [3, 9]; + return [5, __values(hoistVarRecursion(statement.body[i], scope))]; + case 7: + _b.sent(); + _b.label = 8; + case 8: + i++; + return [3, 6]; + case 9: return [3, 30]; + case 10: + i = 0; + _b.label = 11; + case 11: + if (!(i < statement.cases.length)) return [3, 16]; + j = 0; + _b.label = 12; + case 12: + if (!(j < statement.cases[i].consequent.length)) return [3, 15]; + return [5, __values(hoistVarRecursion(statement.cases[i].consequent[j], scope))]; + case 13: + _b.sent(); + _b.label = 14; + case 14: + j++; + return [3, 12]; + case 15: + i++; + return [3, 11]; + case 16: return [3, 30]; + case 17: + tryBlock = statement.block.body; + i = 0; + _b.label = 18; + case 18: + if (!(i < tryBlock.length)) return [3, 21]; + return [5, __values(hoistVarRecursion(tryBlock[i], scope))]; + case 19: + _b.sent(); + _b.label = 20; + case 20: + i++; + return [3, 18]; + case 21: + catchBlock = statement.handler && statement.handler.body.body; + if (!catchBlock) return [3, 25]; + i = 0; + _b.label = 22; + case 22: + if (!(i < catchBlock.length)) return [3, 25]; + return [5, __values(hoistVarRecursion(catchBlock[i], scope))]; + case 23: + _b.sent(); + _b.label = 24; + case 24: + i++; + return [3, 22]; + case 25: + finalBlock = statement.finalizer && statement.finalizer.body; + if (!finalBlock) return [3, 29]; + i = 0; + _b.label = 26; + case 26: + if (!(i < finalBlock.length)) return [3, 29]; + return [5, __values(hoistVarRecursion(finalBlock[i], scope))]; + case 27: + _b.sent(); + _b.label = 28; + case 28: + i++; + return [3, 26]; + case 29: return [3, 30]; + case 30: return [2]; + } + }); + } + function pattern$2(node, scope, options) { + var _a; + if (options === void 0) { options = {}; } + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = node.type; + switch (_a) { + case 'ObjectPattern': return [3, 1]; + case 'ArrayPattern': return [3, 3]; + case 'RestElement': return [3, 5]; + case 'AssignmentPattern': return [3, 7]; + } + return [3, 9]; + case 1: return [5, __values(ObjectPattern$1(node, scope, options))]; + case 2: return [2, _b.sent()]; + case 3: return [5, __values(ArrayPattern$1(node, scope, options))]; + case 4: return [2, _b.sent()]; + case 5: return [5, __values(RestElement$1(node, scope, options))]; + case 6: return [2, _b.sent()]; + case 7: return [5, __values(AssignmentPattern$1(node, scope, options))]; + case 8: return [2, _b.sent()]; + case 9: throw new SyntaxError('Unexpected token'); + } + }); + } + function createFunc(node, scope, options) { + if (options === void 0) { options = {}; } + if (!node.generator && !node.async) { + return createFunc$1(node, scope, options); + } + var superClass = options.superClass, isCtor = options.isCtor; + var params = node.params; + var tmpFunc = function _a() { + var _i, subScope, i, param, result; + var _newTarget = this && this instanceof _a ? this.constructor : void 0; + var args = []; + for (_i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + subScope = new Scope(scope, true); + if (node.type !== 'ArrowFunctionExpression') { + subScope.const('this', this); + subScope.let('arguments', arguments); + subScope.const(NEWTARGET, _newTarget); + if (superClass) { + subScope.const(SUPER, superClass); + if (isCtor) + subScope.let(SUPERCALL, false); + } + } + i = 0; + _a.label = 1; + case 1: + if (!(i < params.length)) return [3, 7]; + param = params[i]; + if (!(param.type === 'Identifier')) return [3, 2]; + subScope.let(param.name, args[i]); + return [3, 6]; + case 2: + if (!(param.type === 'RestElement')) return [3, 4]; + return [5, __values(RestElement$1(param, subScope, { kind: 'let', feed: args.slice(i) }))]; + case 3: + _a.sent(); + return [3, 6]; + case 4: return [5, __values(pattern$2(param, subScope, { feed: args[i] }))]; + case 5: + _a.sent(); + _a.label = 6; + case 6: + i++; + return [3, 1]; + case 7: + if (!(node.body.type === 'BlockStatement')) return [3, 10]; + return [5, __values(hoist(node.body, subScope))]; + case 8: + _a.sent(); + return [5, __values(BlockStatement$1(node.body, subScope, { + invasived: true, + hoisted: true + }))]; + case 9: + result = _a.sent(); + return [3, 12]; + case 10: return [5, __values(evaluate$1(node.body, subScope))]; + case 11: + result = _a.sent(); + if (node.type === 'ArrowFunctionExpression') { + RETURN.RES = result; + result = RETURN; + } + _a.label = 12; + case 12: + if (result === RETURN) { + return [2, result.RES]; + } + return [2]; + } + }); + }; + var func; + if (node.async && node.generator) { + func = function () { + var iterator = tmpFunc.apply(void 0, arguments); + var last = Promise.resolve(); + var hasCatch = false; + var run = function (opts) { + return last = last + .then(function () { return runAsync(iterator, assign({ fullRet: true }, opts)); }) + .catch(function (err) { + if (!hasCatch) { + hasCatch = true; + return Promise.reject(err); + } + }); + }; + var asyncIterator = { + next: function (res) { return run({ res: res }); }, + throw: function (err) { return run({ err: err }); }, + return: function (ret) { return run({ ret: ret }); } + }; + if (typeof Symbol === 'function') { + asyncIterator[Symbol.iterator] = function () { return this; }; + } + return asyncIterator; + }; + } + else if (node.async) { + func = function () { return runAsync(tmpFunc.apply(void 0, arguments)); }; + } + else { + func = tmpFunc; + } + define(func, NOCTOR, { value: true }); + define(func, 'name', { + value: node.id + && node.id.name + || '', + configurable: true + }); + define(func, 'length', { + value: params.length, + configurable: true + }); + return func; + } + function createClass(node, scope) { + var superClass, klass, methodBody, i, method; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5, __values(evaluate$1(node.superClass, scope))]; + case 1: + superClass = _a.sent(); + klass = function () { + if (superClass) { + superClass.apply(this); + } + }; + methodBody = node.body.body; + for (i = 0; i < methodBody.length; i++) { + method = methodBody[i]; + if (method.kind === 'constructor') { + klass = createFunc(method.value, scope, { superClass: superClass, isCtor: true }); + break; + } + } + if (superClass) { + inherits(klass, superClass); + } + return [5, __values(ClassBody$1(node.body, scope, { klass: klass, superClass: superClass }))]; + case 2: + _a.sent(); + define(klass, CLSCTOR, { value: true }); + define(klass, 'name', { + value: node.id && node.id.name || '', + configurable: true + }); + return [2, klass]; + } + }); + } + function ForXHandler(node, scope, options) { + var value, left, subScope, variable, result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + value = options.value; + left = node.left; + subScope = new Scope(scope); + if (!(left.type === 'VariableDeclaration')) return [3, 2]; + return [5, __values(VariableDeclaration$1(left, subScope, { feed: value }))]; + case 1: + _a.sent(); + return [3, 6]; + case 2: + if (!(left.type === 'Identifier')) return [3, 4]; + return [5, __values(Identifier(left, scope, { getVar: true }))]; + case 3: + variable = _a.sent(); + variable.set(value); + return [3, 6]; + case 4: return [5, __values(pattern$2(left, scope, { feed: value }))]; + case 5: + _a.sent(); + _a.label = 6; + case 6: + if (!(node.body.type === 'BlockStatement')) return [3, 8]; + return [5, __values(BlockStatement$1(node.body, subScope, { invasived: true }))]; + case 7: + result = _a.sent(); + return [3, 10]; + case 8: return [5, __values(evaluate$1(node.body, subScope))]; + case 9: + result = _a.sent(); + _a.label = 10; + case 10: return [2, result]; + } + }); } - function hoist$1(block, scope, options) { - if (options === void 0) { options = {}; } - var _a = options.onlyBlock, onlyBlock = _a === void 0 ? false : _a; - var funcDclrList = []; - var funcDclrIdxs = []; - for (var i = 0; i < block.body.length; i++) { - var statement = block.body[i]; - if (statement.type === 'FunctionDeclaration') { - funcDclrList.push(statement); - funcDclrIdxs.push(i); - } - else if (statement.type === 'VariableDeclaration' - && ['const', 'let'].indexOf(statement.kind) !== -1) { - VariableDeclaration(statement, scope, { hoist: true, onlyBlock: true }); - } - else if (!onlyBlock) { - hoistVarRecursion$1(statement, scope); - } - } - if (funcDclrIdxs.length) { - for (var i = funcDclrIdxs.length - 1; i > -1; i--) { - block.body.splice(funcDclrIdxs[i], 1); - } - block.body = funcDclrList.concat(block.body); - } - } - function hoistVarRecursion$1(statement, scope) { - switch (statement.type) { - case 'VariableDeclaration': - VariableDeclaration(statement, scope, { hoist: true }); - break; - case 'WhileStatement': - case 'DoWhileStatement': - case 'ForStatement': - case 'ForInStatement': - case 'ForOfStatement': - hoistVarRecursion$1(statement.body, scope); - break; - case 'BlockStatement': - for (var i = 0; i < statement.body.length; i++) { - hoistVarRecursion$1(statement.body[i], scope); - } - break; - case 'SwitchStatement': - for (var i = 0; i < statement.cases.length; i++) { - for (var j = 0; j < statement.cases[i].consequent.length; j++) { - hoistVarRecursion$1(statement.cases[i].consequent[j], scope); - } - } - break; - case 'TryStatement': { - var tryBlock = statement.block.body; - for (var i = 0; i < tryBlock.length; i++) { - hoistVarRecursion$1(tryBlock[i], scope); - } - var catchBlock = statement.handler && statement.handler.body.body; - if (catchBlock) { - for (var i = 0; i < catchBlock.length; i++) { - hoistVarRecursion$1(catchBlock[i], scope); - } - } - var finalBlock = statement.finalizer && statement.finalizer.body; - if (finalBlock) { - for (var i = 0; i < finalBlock.length; i++) { - hoistVarRecursion$1(finalBlock[i], scope); - } - } - break; - } - } - } - function pattern$3(node, scope, options) { - if (options === void 0) { options = {}; } - switch (node.type) { - case 'ObjectPattern': - return ObjectPattern(node, scope, options); - case 'ArrayPattern': - return ArrayPattern(node, scope, options); - case 'RestElement': - return RestElement(node, scope, options); - case 'AssignmentPattern': - return AssignmentPattern(node, scope, options); - default: - throw new SyntaxError('Unexpected token'); - } - } - function createFunc$1(node, scope, options) { - if (options === void 0) { options = {}; } - if (node.generator || node.async) { - return createFunc(node, scope, options); - } - var superClass = options.superClass; - var params = node.params; - var tmpFunc = function _a() { - var _newTarget = this && this instanceof _a ? this.constructor : void 0; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var subScope = new Scope(scope, true); - if (node.type !== 'ArrowFunctionExpression') { - subScope.const('this', this); - subScope.let('arguments', arguments); - subScope.const(NEWTARGET, _newTarget); - if (superClass) { - subScope.const(SUPER, superClass); - subScope.let(SUPERCALL, false); - } - } - for (var i = 0; i < params.length; i++) { - var param = params[i]; - if (param.type === 'Identifier') { - subScope.let(param.name, args[i]); - } - else if (param.type === 'RestElement') { - RestElement(param, subScope, { kind: 'let', feed: args.slice(i) }); - } - else { - pattern$3(param, subScope, { feed: args[i] }); - } - } - var result; - if (node.body.type === 'BlockStatement') { - hoist$1(node.body, subScope); - result = BlockStatement(node.body, subScope, { - invasived: true, - hoisted: true - }); - } - else { - result = evaluate(node.body, subScope); - if (node.type === 'ArrowFunctionExpression') { - RETURN.RES = result; - result = RETURN; - } - } - if (result === RETURN) { - return result.RES; - } - }; - var func = tmpFunc; - if (node.type === 'ArrowFunctionExpression') { - define(func, NOCTOR, { value: true }); - } - define(func, 'name', { - value: node.id - && node.id.name - || '', - configurable: true - }); - define(func, 'length', { - value: params.length, - configurable: true - }); - return func; - } - function createClass$1(node, scope) { - var superClass = evaluate(node.superClass, scope); - var klass = function () { - if (superClass) { - superClass.apply(this); - } - }; - var methodBody = node.body.body; - for (var i = 0; i < methodBody.length; i++) { - var method = methodBody[i]; - if (method.kind === 'constructor') { - klass = createFunc$1(method.value, scope, { superClass: superClass }); - break; - } - } - if (superClass) { - inherits(klass, superClass); - } - ClassBody(node.body, scope, { klass: klass, superClass: superClass }); - define(klass, CLSCTOR, { value: true }); - define(klass, 'name', { - value: node.id && node.id.name || '', - configurable: true - }); - return klass; - } - function ForXHandler$1(node, scope, options) { - var value = options.value; - var left = node.left; - var subScope = new Scope(scope); - if (left.type === 'VariableDeclaration') { - VariableDeclaration(left, subScope, { feed: value }); - } - else if (left.type === 'Identifier') { - var variable = Identifier(left, scope, { getVar: true }); - variable.set(value); - } - else { - pattern$3(left, scope, { feed: value }); - } - var result; - if (node.body.type === 'BlockStatement') { - result = BlockStatement(node.body, subScope, { invasived: true }); - } - else { - result = evaluate(node.body, subScope); - } - return result; + function hoist$1(block, scope, options) { + if (options === void 0) { options = {}; } + var _a = options.onlyBlock, onlyBlock = _a === void 0 ? false : _a; + var funcDclrList = []; + var funcDclrIdxs = []; + for (var i = 0; i < block.body.length; i++) { + var statement = block.body[i]; + if (statement.type === 'FunctionDeclaration') { + funcDclrList.push(statement); + funcDclrIdxs.push(i); + } + else if (statement.type === 'VariableDeclaration' + && ['const', 'let'].indexOf(statement.kind) !== -1) { + VariableDeclaration(statement, scope, { hoist: true, onlyBlock: true }); + } + else if (!onlyBlock) { + hoistVarRecursion$1(statement, scope); + } + } + if (funcDclrIdxs.length) { + for (var i = funcDclrIdxs.length - 1; i > -1; i--) { + block.body.splice(funcDclrIdxs[i], 1); + } + block.body = funcDclrList.concat(block.body); + } + } + function hoistVarRecursion$1(statement, scope) { + switch (statement.type) { + case 'VariableDeclaration': + VariableDeclaration(statement, scope, { hoist: true }); + break; + case 'WhileStatement': + case 'DoWhileStatement': + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + hoistVarRecursion$1(statement.body, scope); + break; + case 'BlockStatement': + for (var i = 0; i < statement.body.length; i++) { + hoistVarRecursion$1(statement.body[i], scope); + } + break; + case 'SwitchStatement': + for (var i = 0; i < statement.cases.length; i++) { + for (var j = 0; j < statement.cases[i].consequent.length; j++) { + hoistVarRecursion$1(statement.cases[i].consequent[j], scope); + } + } + break; + case 'TryStatement': { + var tryBlock = statement.block.body; + for (var i = 0; i < tryBlock.length; i++) { + hoistVarRecursion$1(tryBlock[i], scope); + } + var catchBlock = statement.handler && statement.handler.body.body; + if (catchBlock) { + for (var i = 0; i < catchBlock.length; i++) { + hoistVarRecursion$1(catchBlock[i], scope); + } + } + var finalBlock = statement.finalizer && statement.finalizer.body; + if (finalBlock) { + for (var i = 0; i < finalBlock.length; i++) { + hoistVarRecursion$1(finalBlock[i], scope); + } + } + break; + } + } + } + function pattern$3(node, scope, options) { + if (options === void 0) { options = {}; } + switch (node.type) { + case 'ObjectPattern': + return ObjectPattern(node, scope, options); + case 'ArrayPattern': + return ArrayPattern(node, scope, options); + case 'RestElement': + return RestElement(node, scope, options); + case 'AssignmentPattern': + return AssignmentPattern(node, scope, options); + default: + throw new SyntaxError('Unexpected token'); + } + } + function createFunc$1(node, scope, options) { + if (options === void 0) { options = {}; } + if (node.generator || node.async) { + return createFunc(node, scope, options); + } + var superClass = options.superClass, isCtor = options.isCtor; + var params = node.params; + var tmpFunc = function _a() { + var _newTarget = this && this instanceof _a ? this.constructor : void 0; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var subScope = new Scope(scope, true); + if (node.type !== 'ArrowFunctionExpression') { + subScope.const('this', this); + subScope.let('arguments', arguments); + subScope.const(NEWTARGET, _newTarget); + if (superClass) { + subScope.const(SUPER, superClass); + if (isCtor) + subScope.let(SUPERCALL, false); + } + } + for (var i = 0; i < params.length; i++) { + var param = params[i]; + if (param.type === 'Identifier') { + subScope.let(param.name, args[i]); + } + else if (param.type === 'RestElement') { + RestElement(param, subScope, { kind: 'let', feed: args.slice(i) }); + } + else { + pattern$3(param, subScope, { feed: args[i] }); + } + } + var result; + if (node.body.type === 'BlockStatement') { + hoist$1(node.body, subScope); + result = BlockStatement(node.body, subScope, { + invasived: true, + hoisted: true + }); + } + else { + result = evaluate(node.body, subScope); + if (node.type === 'ArrowFunctionExpression') { + RETURN.RES = result; + result = RETURN; + } + } + if (result === RETURN) { + return result.RES; + } + }; + var func = tmpFunc; + if (node.type === 'ArrowFunctionExpression') { + define(func, NOCTOR, { value: true }); + } + define(func, 'name', { + value: node.id + && node.id.name + || '', + configurable: true + }); + define(func, 'length', { + value: params.length, + configurable: true + }); + return func; + } + function createClass$1(node, scope) { + var superClass = evaluate(node.superClass, scope); + var klass = function () { + if (superClass) { + superClass.apply(this); + } + }; + var methodBody = node.body.body; + for (var i = 0; i < methodBody.length; i++) { + var method = methodBody[i]; + if (method.kind === 'constructor') { + klass = createFunc$1(method.value, scope, { superClass: superClass, isCtor: true }); + break; + } + } + if (superClass) { + inherits(klass, superClass); + } + ClassBody(node.body, scope, { klass: klass, superClass: superClass }); + define(klass, CLSCTOR, { value: true }); + define(klass, 'name', { + value: node.id && node.id.name || '', + configurable: true + }); + return klass; + } + function ForXHandler$1(node, scope, options) { + var value = options.value; + var left = node.left; + var subScope = new Scope(scope); + if (left.type === 'VariableDeclaration') { + VariableDeclaration(left, subScope, { feed: value }); + } + else if (left.type === 'Identifier') { + var variable = Identifier(left, scope, { getVar: true }); + variable.set(value); + } + else { + pattern$3(left, scope, { feed: value }); + } + var result; + if (node.body.type === 'BlockStatement') { + result = BlockStatement(node.body, subScope, { invasived: true }); + } + else { + result = evaluate(node.body, subScope); + } + return result; } - var Sval = (function () { - function Sval(options) { - if (options === void 0) { options = {}; } - this.options = {}; - this.scope = new Scope(null, true); - this.exports = {}; - var _a = options.ecmaVer, ecmaVer = _a === void 0 ? 9 : _a, _b = options.sandBox, sandBox = _b === void 0 ? true : _b; - ecmaVer -= ecmaVer < 2015 ? 0 : 2009; - if ([3, 5, 6, 7, 8, 9, 10].indexOf(ecmaVer) === -1) { - throw new Error("unsupported ecmaVer"); - } - this.options.ecmaVersion = ecmaVer; - if (sandBox) { - var win = createSandBox(); - this.scope.let('window', win); - this.scope.let('this', win); - } - else { - this.scope.let('window', globalObj); - this.scope.let('this', globalObj); - } - this.scope.const('exports', this.exports = {}); - } - Sval.prototype.import = function (nameOrModules, mod) { - var _a; - if (typeof nameOrModules === 'string') { - nameOrModules = (_a = {}, _a[nameOrModules] = mod, _a); - } - if (typeof nameOrModules !== 'object') - return; - var names = getOwnNames(nameOrModules); - for (var i = 0; i < names.length; i++) { - var name_1 = names[i]; - this.scope.var(name_1, nameOrModules[name_1]); - } - }; - Sval.prototype.run = function (code) { - var ast = acorn.parse(code, this.options); - hoist$1(ast, this.scope); - evaluate(ast, this.scope); - }; - Sval.version = version; - return Sval; + var Sval = (function () { + function Sval(options) { + if (options === void 0) { options = {}; } + this.options = {}; + this.scope = new Scope(null, true); + this.exports = {}; + var _a = options.ecmaVer, ecmaVer = _a === void 0 ? 9 : _a, _b = options.sandBox, sandBox = _b === void 0 ? true : _b; + ecmaVer -= ecmaVer < 2015 ? 0 : 2009; + if ([3, 5, 6, 7, 8, 9, 10].indexOf(ecmaVer) === -1) { + throw new Error("unsupported ecmaVer"); + } + this.options.ecmaVersion = ecmaVer; + if (sandBox) { + var win = createSandBox(); + this.scope.let('window', win); + this.scope.let('this', win); + } + else { + this.scope.let('window', globalObj); + this.scope.let('this', globalObj); + } + this.scope.const('exports', this.exports = {}); + } + Sval.prototype.import = function (nameOrModules, mod) { + var _a; + if (typeof nameOrModules === 'string') { + nameOrModules = (_a = {}, _a[nameOrModules] = mod, _a); + } + if (typeof nameOrModules !== 'object') + return; + var names = getOwnNames(nameOrModules); + for (var i = 0; i < names.length; i++) { + var name_1 = names[i]; + this.scope.var(name_1, nameOrModules[name_1]); + } + }; + Sval.prototype.run = function (code) { + var ast = acorn.parse(code, this.options); + hoist$1(ast, this.scope); + evaluate(ast, this.scope); + }; + Sval.version = version; + return Sval; }()); return Sval; diff --git a/dist/sval.min.js b/dist/sval.min.js index 45dd77d..fef4f20 100644 --- a/dist/sval.min.js +++ b/dist/sval.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Sval=t()}(this,function(){"use strict";var n=Object.freeze({get FunctionDeclaration(){return Lt},get VariableDeclaration(){return Rt},get VariableDeclarator(){return Ot},get ClassDeclaration(){return Bt},get ClassBody(){return Dt},get MethodDefinition(){return Mt}}),i=Object.freeze({get FunctionDeclaration(){return sr},get VariableDeclaration(){return ar},get VariableDeclarator(){return or},get ClassDeclaration(){return cr},get ClassBody(){return ur},get MethodDefinition(){return hr}}),l=Object.freeze,m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,a=Object.prototype.hasOwnProperty;var o=Object.getOwnPropertyNames,r=Object.setPrototypeOf;var c=Object.getPrototypeOf;var u=Object.getOwnPropertyDescriptor;function s(e,t,r){for(;t;){var n=u(t,r),i=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(i)return i;s=t,t=c?c(s):s.__proto__}var s}function y(e,t){return s("get",e,t)}function f(e,t){return s("set",e,t)}var p=Object.create;function d(e,t){!function(e,t){r?r(e,t):e.__proto__=t}(e,t),e.prototype=p(t.prototype,{constructor:{value:e,writable:!0}})}var x=Object.assign||function(e){for(var t=1;t",D),template:new O("template"),invalidTemplate:new O("invalidTemplate"),ellipsis:new O("...",D),backQuote:new O("`",M),dollarBraceL:new O("${",{beforeExpr:!0,startsExpr:!0}),eq:new O("=",{beforeExpr:!0,isAssign:!0}),assign:new O("_=",{beforeExpr:!0,isAssign:!0}),incDec:new O("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new O("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:B("||",1),logicalAND:B("&&",2),bitwiseOR:B("|",3),bitwiseXOR:B("^",4),bitwiseAND:B("&",5),equality:B("==/!=/===/!==",6),relational:B("/<=/>=",7),bitShift:B("<>/>>>",8),plusMin:new O("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:B("%",10),star:B("*",10),slash:B("/",10),starstar:new O("**",{beforeExpr:!0}),_break:F("break"),_case:F("case",D),_catch:F("catch"),_continue:F("continue"),_debugger:F("debugger"),_default:F("default",D),_do:F("do",{isLoop:!0,beforeExpr:!0}),_else:F("else",D),_finally:F("finally"),_for:F("for",{isLoop:!0}),_function:F("function",M),_if:F("if"),_return:F("return",D),_switch:F("switch"),_throw:F("throw",D),_try:F("try"),_var:F("var"),_const:F("const"),_while:F("while",{isLoop:!0}),_with:F("with"),_new:F("new",{beforeExpr:!0,startsExpr:!0}),_this:F("this",M),_super:F("super",M),_class:F("class",M),_extends:F("extends",D),_export:F("export"),_import:F("import"),_null:F("null",M),_true:F("true",M),_false:F("false",M),_in:F("in",{beforeExpr:!0,binop:7}),_instanceof:F("instanceof",{beforeExpr:!0,binop:7}),_typeof:F("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:F("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:F("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},q=/\r\n?|\n|\u2028|\u2029/,z=new RegExp(q.source,"g");function W(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var G=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,H=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Q=Object.prototype,K=Q.hasOwnProperty,X=Q.toString;function Y(e,t){return K.call(e,t)}var J=Array.isArray||function(e){return"[object Array]"===X.call(e)};function Z(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function $(e,t){this.line=e,this.column=t}var ee=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};var te={ecmaVersion:9,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!($.prototype.offset=function(e){return new $(this.line,this.column+e)}),allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function re(e){var t={};for(var r in te)t[r]=e&&Y(e,r)?e[r]:te[r];if(2015<=t.ecmaVersion&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),J(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return J(t.onComment)&&(t.onComment=function(o,c){return function(e,t,r,n,i,s){var a={type:e?"Block":"Line",value:t,start:r,end:n};o.locations&&(a.loc=new ee(this,i,s)),o.ranges&&(a.range=[r,n]),c.push(a)}}(t,t.onComment)),t}function ne(e,t){return 2|(e?4:0)|(t?8:0)}function ie(e,t,r){this.options=e=re(e),this.sourceFile=e.sourceFile,this.keywords=Z(E[6<=e.ecmaVersion?6:5]);var n="";if(!e.allowReserved){for(var i=e.ecmaVersion;!(n=k[i]);i--);"module"===e.sourceType&&(n+=" await")}this.reservedWords=Z(n);var s=(n?n+" ":"")+k.strict;this.reservedWordsStrict=Z(s),this.reservedWordsStrictBind=Z(s+" "+k.strictBind),this.input=String(t),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf("\n",r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(q).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=j.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null}var se={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};ie.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},se.inFunction.get=function(){return 0<(2&this.currentVarScope().flags)},se.inGenerator.get=function(){return 0<(8&this.currentVarScope().flags)},se.inAsync.get=function(){return 0<(4&this.currentVarScope().flags)},se.allowSuper.get=function(){return 0<(64&this.currentThisScope().flags)},se.allowDirectSuper.get=function(){return 0<(128&this.currentThisScope().flags)},se.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ie.prototype.inNonArrowFunction=function(){return 0<(2&this.currentThisScope().flags)},ie.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,n=0;n>10),56320+(1023&e)))}function De(e){return 36===e||40<=e&&e<=43||46===e||63===e||91<=e&&e<=94||123<=e&&e<=125}function Me(e){return 65<=e&&e<=90||97<=e&&e<=122}function Ue(e){return Me(e)||95===e}function Fe(e){return 48<=e&&e<=57}function je(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function qe(e){return 65<=e&&e<=70?e-65+10:97<=e&&e<=102?e-97+10:e-48}function ze(e){return 48<=e&&e<=55}Re.prototype.reset=function(e,t,r){var n=-1!==r.indexOf("u");this.start=0|e,this.source=t+"",this.flags=r,this.switchU=n&&6<=this.parser.options.ecmaVersion,this.switchN=n&&9<=this.parser.options.ecmaVersion},Re.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Re.prototype.at=function(e){var t=this.source,r=t.length;if(r<=e)return-1;var n=t.charCodeAt(e);return!this.switchU||n<=55295||57344<=n||r<=e+1?n:(n<<10)+t.charCodeAt(e+1)-56613888},Re.prototype.nextIndex=function(e){var t=this.source,r=t.length;if(r<=e)return r;var n=t.charCodeAt(e);return!this.switchU||n<=55295||57344<=n||r<=e+1?e+1:e+2},Re.prototype.current=function(){return this.at(this.pos)},Re.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},Re.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},Re.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},Oe.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,n=0;ne.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;te.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},Oe.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Oe.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Oe.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Oe.regexp_eatZero=function(e){return 48===e.current()&&!Fe(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Oe.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Oe.regexp_eatControlLetter=function(e){var t=e.current();return!!Me(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Oe.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(e.switchU&&55296<=r&&r<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(56320<=i&&i<=57343)return e.lastIntValue=1024*(r-55296)+(i-56320)+65536,!0}e.pos=n,e.lastIntValue=r}return!0}if(e.switchU&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&function(e){return 0<=e&&e<=1114111}(e.lastIntValue))return!0;e.switchU&&e.raise("Invalid unicode escape"),e.pos=t}return!1},Oe.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Oe.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(49<=t&&t<=57){for(;e.lastIntValue=10*e.lastIntValue+(t-48),e.advance(),48<=(t=e.current())&&t<=57;);return!0}return!1},Oe.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&9<=this.options.ecmaVersion&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},Oe.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},Oe.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){Y(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},Oe.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},Oe.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ue(t=e.current());)e.lastStringValue+=Be(t),e.advance();return""!==e.lastStringValue},Oe.regexp_eatUnicodePropertyValue=function(e){var t,r=0;for(e.lastStringValue="";Ue(t=r=e.current())||Fe(t);)e.lastStringValue+=Be(r),e.advance();return""!==e.lastStringValue},Oe.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Oe.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},Oe.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;!e.switchU||-1!==t&&-1!==r||e.raise("Invalid character class"),-1!==t&&-1!==r&&r>10),56320+(1023&e)))}Ge.next=function(){this.options.onToken&&this.options.onToken(new We(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ge.getToken=function(){return this.next(),new We(this)},"undefined"!=typeof Symbol&&(Ge[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===j.eof,value:e}}}}),Ge.curContext=function(){return this.context[this.context.length-1]},Ge.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(j.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ge.readToken=function(e){return L(e,6<=this.options.ecmaVersion)||92===e?this.readWord():this.getTokenFromCode(e)},Ge.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||57344<=e?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Ge.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),r=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(z.lastIndex=r;(e=z.exec(this.input))&&e.index=r.input.length&&r.raise(n,"Unterminated regular expression");var i=r.input.charAt(r.pos);if(q.test(i)&&r.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++r.pos}var s=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var c=this.regexpState||(this.regexpState=new Re(this));c.reset(n,s,o),this.validateRegExpFlags(c),this.validateRegExpPattern(c);var u=null;try{u=new RegExp(s,o)}catch(e){}return this.finishToken(j.regexp,{pattern:s,flags:o,value:u})},Ge.readInt=function(e,t){for(var r=this.pos,n=0,i=0,s=null==t?1/0:t;i=t.input.length&&t.raise(t.start,"Unterminated string constant");var i=t.input.charCodeAt(t.pos);if(i===e)break;92===i?(r+=t.input.slice(n,t.pos),r+=t.readEscapedChar(!1),n=t.pos):(W(i,10<=t.options.ecmaVersion)&&t.raise(t.start,"Unterminated string constant"),++t.pos)}return r+=this.input.slice(n,this.pos++),this.finishToken(j.string,r)};var Qe={};Ge.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Qe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ge.invalidStringToken=function(e,t){if(this.inTemplateElement&&9<=this.options.ecmaVersion)throw Qe;this.raise(e,t)},Ge.readTmplToken=function(){for(var e=this,t="",r=this.pos;;){e.pos>=e.input.length&&e.raise(e.start,"Unterminated template");var n=e.input.charCodeAt(e.pos);if(96===n||36===n&&123===e.input.charCodeAt(e.pos+1))return e.pos!==e.start||e.type!==j.template&&e.type!==j.invalidTemplate?(t+=e.input.slice(r,e.pos),e.finishToken(j.template,t)):36===n?(e.pos+=2,e.finishToken(j.dollarBraceL)):(++e.pos,e.finishToken(j.backQuote));if(92===n)t+=e.input.slice(r,e.pos),t+=e.readEscapedChar(!0),r=e.pos;else if(W(n)){switch(t+=e.input.slice(r,e.pos),++e.pos,n){case 13:10===e.input.charCodeAt(e.pos)&&++e.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(n)}e.options.locations&&(++e.curLine,e.lineStart=e.pos),r=e.pos}else++e.pos}},Ge.readInvalidTemplateToken=function(){for(var e=this;this.posa[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function ht(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(void 0===t||0":return n=":return n<=r;case"<<":return r<>":return r>>n;case">>>":return r>>>n;case"+":return r+n;case"-":return r-n;case"*":return r*n;case"**":return Math.pow(r,n);case"/":return r/n;case"%":return r%n;case"|":return r|n;case"^":return r^n;case"&":return r&n;case"in":return r in n;case"instanceof":return r instanceof n;default:throw new SyntaxError("Unexpected token "+e.operator)}},AssignmentExpression:function(e,t){var r,n=Nt(e.right,t),i=e.left;if("Identifier"===i.type){if(!(r=lt(i,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();r=new at(s,i.name)}}else{if("MemberExpression"!==i.type)return xr(i,t,{feed:n});r=yt(i,t,{getVar:!0})}switch(e.operator){case"=":return r.set(n),r.get();case"+=":return r.set(r.get()+n),r.get();case"-=":return r.set(r.get()-n),r.get();case"*=":return r.set(r.get()*n),r.get();case"/=":return r.set(r.get()/n),r.get();case"%=":return r.set(r.get()%n),r.get();case"**=":return r.set(Math.pow(r.get(),n)),r.get();case"<<=":return r.set(r.get()<>=":return r.set(r.get()>>n),r.get();case">>>=":return r.set(r.get()>>>n),r.get();case"|=":return r.set(r.get()|n),r.get();case"^=":return r.set(r.get()^n),r.get();case"&=":return r.set(r.get()&n),r.get();default:throw new SyntaxError("Unexpected token "+e.operator)}},LogicalExpression:function(e,t){switch(e.operator){case"||":return Nt(e.left,t)||Nt(e.right,t);case"&&":return Nt(e.left,t)&&Nt(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}},MemberExpression:yt,ConditionalExpression:function(e,t){return Nt(e.test,t)?Nt(e.consequent,t):Nt(e.alternate,t)},CallExpression:function(e,t){var r,n;if("MemberExpression"===e.callee.type){var i=void 0,s=y(n=yt(e.callee,t,{getObj:!0}),i=e.callee.computed?Nt(e.callee.property,t):e.callee.property.name);if("Super"===e.callee.object.type&&s){var a=t.find("this").get();r=s.call(a)}else r=n[i];if("function"!=typeof r)throw new TypeError(i+" is not a function");if(r[tt])throw new TypeError("Class constructor "+i+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(r=Nt(e.callee,t))||"Super"!==e.callee.type&&r[tt]){var o;if("Identifier"===e.callee.type)o=e.callee.name;else try{o=JSON.stringify(r)}catch(e){o=""+r}throw"function"!=typeof r?new TypeError(o+" is not a function"):new TypeError("Class constructor "+o+" cannot be invoked without 'new'")}for(var c=[],u=0;u":return[2,i=":return[2,i<=n];case"<<":return[2,n<>":return[2,n>>i];case">>>":return[2,n>>>i];case"+":return[2,n+i];case"-":return[2,n-i];case"*":return[2,n*i];case"**":return[2,Math.pow(n,i)];case"/":return[2,n/i];case"%":return[2,n%i];case"|":return[2,n|i];case"^":return[2,n^i];case"&":return[2,n&i];case"in":return[2,n in i];case"instanceof":return[2,n instanceof i];default:throw new SyntaxError("Unexpected token "+t.operator)}return[2]}})},AssignmentExpression:function(t,r){var n,i,s,a;return ct(this,function(e){switch(e.label){case 0:return[5,ut(ir(t.right,r))];case 1:return n=e.sent(),"Identifier"!==(i=t.left).type?[3,3]:[5,ut(Ut(i,r,{getVar:!0,throwErr:!1}))];case 2:return(s=e.sent())||(a=r.global().find("window").get(),s=new at(a,i.name)),[3,7];case 3:return"MemberExpression"!==i.type?[3,5]:[5,ut(zt(i,r,{getVar:!0}))];case 4:return s=e.sent(),[3,7];case 5:return[5,ut(dr(i,r,{feed:n}))];case 6:return[2,e.sent()];case 7:switch(t.operator){case"=":return s.set(n),[2,s.get()];case"+=":return s.set(s.get()+n),[2,s.get()];case"-=":return s.set(s.get()-n),[2,s.get()];case"*=":return s.set(s.get()*n),[2,s.get()];case"/=":return s.set(s.get()/n),[2,s.get()];case"%=":return s.set(s.get()%n),[2,s.get()];case"**=":return s.set(Math.pow(s.get(),n)),[2,s.get()];case"<<=":return s.set(s.get()<>=":return s.set(s.get()>>n),[2,s.get()];case">>>=":return s.set(s.get()>>>n),[2,s.get()];case"|=":return s.set(s.get()|n),[2,s.get()];case"^=":return s.set(s.get()^n),[2,s.get()];case"&=":return s.set(s.get()&n),[2,s.get()];default:throw new SyntaxError("Unexpected token "+t.operator)}return[2]}})},LogicalExpression:function(t,r){var n,i;return ct(this,function(e){switch(e.label){case 0:switch(t.operator){case"||":return[3,1];case"&&":return[3,5]}return[3,9];case 1:return[5,ut(ir(t.left,r))];case 2:return(n=e.sent())?[3,4]:[5,ut(ir(t.right,r))];case 3:n=e.sent(),e.label=4;case 4:return[2,n];case 5:return[5,ut(ir(t.left,r))];case 6:return(i=e.sent())?[5,ut(ir(t.right,r))]:[3,8];case 7:i=e.sent(),e.label=8;case 8:return[2,i];case 9:throw new SyntaxError("Unexpected token "+t.operator)}})},MemberExpression:zt,ConditionalExpression:function(t,r){var n;return ct(this,function(e){switch(e.label){case 0:return[5,ut(ir(t.test,r))];case 1:return e.sent()?[5,ut(ir(t.consequent,r))]:[3,3];case 2:return n=e.sent(),[3,5];case 3:return[5,ut(ir(t.alternate,r))];case 4:n=e.sent(),e.label=5;case 5:return[2,n]}})},CallExpression:function(t,r){var n,i,s,a,o,c,u,h,p,l,d,f,m;return ct(this,function(e){switch(e.label){case 0:return"MemberExpression"!==t.callee.type?[3,5]:[5,ut(zt(t.callee,r,{getObj:!0}))];case 1:return i=e.sent(),s=void 0,t.callee.computed?[5,ut(ir(t.callee.property,r))]:[3,3];case 2:return s=e.sent(),[3,4];case 3:s=t.callee.property.name,e.label=4;case 4:if(a=y(i,s),"function"!=typeof(n="Super"===t.callee.object.type&&a?(o=r.find("this").get(),a.call(o)):i[s]))throw new TypeError(s+" is not a function");if(n[tt])throw new TypeError("Class constructor "+s+" cannot be invoked without 'new'");return[3,7];case 5:return i=r.find("this").get(),[5,ut(ir(t.callee,r))];case 6:if("function"!=typeof(n=e.sent())||"Super"!==t.callee.type&&n[tt]){if("Identifier"===t.callee.type)c=t.callee.name;else try{c=JSON.stringify(n)}catch(e){c=""+n}throw"function"!=typeof n?new TypeError(c+" is not a function"):new TypeError("Class constructor "+c+" cannot be invoked without 'new'")}e.label=7;case 7:u=[],h=0,e.label=8;case 8:return h=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(s),o=void 0,Ke.RES=a.next(),[4,Ke]):[3,8];case 2:o=e.sent(),e.label=3;case 3:return o.done?[3,7]:[5,ut(yr(t,r,{value:o.value}))];case 4:if((p=e.sent())===Je)return[3,7];if(p===Ye)return[3,5];if(p===Xe)return[2,p];e.label=5;case 5:return Ke.RES=a.next(),[4,Ke];case 6:return o=e.sent(),[3,3];case 7:return[3,15];case 8:e.trys.push([8,13,14,15]),c=ut(s),u=c.next(),e.label=9;case 9:return u.done?[3,12]:(h=u.value,[5,ut(yr(t,r,{value:h}))]);case 10:if((p=e.sent())===Je)return[3,12];if(p===Ye)return[3,11];if(p===Xe)return[2,p];e.label=11;case 11:return u=c.next(),[3,9];case 12:return[3,15];case 13:return l=e.sent(),n={error:l},[3,15];case 14:try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}return[7];case 15:return[2]}})}});function Zt(t,r,n){var i,s,a,o,c,u,h,p,l,d,f,m,y,g,v;return void 0===n&&(n={}),ct(this,function(e){switch(e.label){case 0:i=n.kind,s=void 0===i?"let":i,a=n.hoist,o=void 0!==a&&a,c=n.onlyBlock,u=void 0!==c&&c,h=n.feed,p=void 0===h?{}:h,l=[],d=0,e.label=1;case 1:return d",D),template:new O("template"),invalidTemplate:new O("invalidTemplate"),ellipsis:new O("...",D),backQuote:new O("`",M),dollarBraceL:new O("${",{beforeExpr:!0,startsExpr:!0}),eq:new O("=",{beforeExpr:!0,isAssign:!0}),assign:new O("_=",{beforeExpr:!0,isAssign:!0}),incDec:new O("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new O("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:B("||",1),logicalAND:B("&&",2),bitwiseOR:B("|",3),bitwiseXOR:B("^",4),bitwiseAND:B("&",5),equality:B("==/!=/===/!==",6),relational:B("/<=/>=",7),bitShift:B("<>/>>>",8),plusMin:new O("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:B("%",10),star:B("*",10),slash:B("/",10),starstar:new O("**",{beforeExpr:!0}),_break:U("break"),_case:U("case",D),_catch:U("catch"),_continue:U("continue"),_debugger:U("debugger"),_default:U("default",D),_do:U("do",{isLoop:!0,beforeExpr:!0}),_else:U("else",D),_finally:U("finally"),_for:U("for",{isLoop:!0}),_function:U("function",M),_if:U("if"),_return:U("return",D),_switch:U("switch"),_throw:U("throw",D),_try:U("try"),_var:U("var"),_const:U("const"),_while:U("while",{isLoop:!0}),_with:U("with"),_new:U("new",{beforeExpr:!0,startsExpr:!0}),_this:U("this",M),_super:U("super",M),_class:U("class",M),_extends:U("extends",D),_export:U("export"),_import:U("import"),_null:U("null",M),_true:U("true",M),_false:U("false",M),_in:U("in",{beforeExpr:!0,binop:7}),_instanceof:U("instanceof",{beforeExpr:!0,binop:7}),_typeof:U("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:U("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:U("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},q=/\r\n?|\n|\u2028|\u2029/,z=new RegExp(q.source,"g");function W(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var G=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,H=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Q=Object.prototype,K=Q.hasOwnProperty,X=Q.toString;function Y(e,t){return K.call(e,t)}var J=Array.isArray||function(e){return"[object Array]"===X.call(e)};function Z(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function $(e,t){this.line=e,this.column=t}var ee=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};var te={ecmaVersion:9,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!($.prototype.offset=function(e){return new $(this.line,this.column+e)}),allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function re(e){var t={};for(var r in te)t[r]=e&&Y(e,r)?e[r]:te[r];if(2015<=t.ecmaVersion&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),J(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return J(t.onComment)&&(t.onComment=function(o,c){return function(e,t,r,n,i,s){var a={type:e?"Block":"Line",value:t,start:r,end:n};o.locations&&(a.loc=new ee(this,i,s)),o.ranges&&(a.range=[r,n]),c.push(a)}}(t,t.onComment)),t}function ne(e,t){return 2|(e?4:0)|(t?8:0)}function ie(e,t,r){this.options=e=re(e),this.sourceFile=e.sourceFile,this.keywords=Z(E[6<=e.ecmaVersion?6:5]);var n="";if(!e.allowReserved){for(var i=e.ecmaVersion;!(n=k[i]);i--);"module"===e.sourceType&&(n+=" await")}this.reservedWords=Z(n);var s=(n?n+" ":"")+k.strict;this.reservedWordsStrict=Z(s),this.reservedWordsStrictBind=Z(s+" "+k.strictBind),this.input=String(t),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf("\n",r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(q).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=j.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null}var se={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};ie.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},se.inFunction.get=function(){return 0<(2&this.currentVarScope().flags)},se.inGenerator.get=function(){return 0<(8&this.currentVarScope().flags)},se.inAsync.get=function(){return 0<(4&this.currentVarScope().flags)},se.allowSuper.get=function(){return 0<(64&this.currentThisScope().flags)},se.allowDirectSuper.get=function(){return 0<(128&this.currentThisScope().flags)},se.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ie.prototype.inNonArrowFunction=function(){return 0<(2&this.currentThisScope().flags)},ie.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,n=0;n>10),56320+(1023&e)))}function De(e){return 36===e||40<=e&&e<=43||46===e||63===e||91<=e&&e<=94||123<=e&&e<=125}function Me(e){return 65<=e&&e<=90||97<=e&&e<=122}function Fe(e){return Me(e)||95===e}function Ue(e){return 48<=e&&e<=57}function je(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function qe(e){return 65<=e&&e<=70?e-65+10:97<=e&&e<=102?e-97+10:e-48}function ze(e){return 48<=e&&e<=55}Re.prototype.reset=function(e,t,r){var n=-1!==r.indexOf("u");this.start=0|e,this.source=t+"",this.flags=r,this.switchU=n&&6<=this.parser.options.ecmaVersion,this.switchN=n&&9<=this.parser.options.ecmaVersion},Re.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Re.prototype.at=function(e){var t=this.source,r=t.length;if(r<=e)return-1;var n=t.charCodeAt(e);return!this.switchU||n<=55295||57344<=n||r<=e+1?n:(n<<10)+t.charCodeAt(e+1)-56613888},Re.prototype.nextIndex=function(e){var t=this.source,r=t.length;if(r<=e)return r;var n=t.charCodeAt(e);return!this.switchU||n<=55295||57344<=n||r<=e+1?e+1:e+2},Re.prototype.current=function(){return this.at(this.pos)},Re.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},Re.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},Re.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},Oe.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,n=0;ne.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;te.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},Oe.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Oe.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Oe.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Oe.regexp_eatZero=function(e){return 48===e.current()&&!Ue(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Oe.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Oe.regexp_eatControlLetter=function(e){var t=e.current();return!!Me(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Oe.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(e.switchU&&55296<=r&&r<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(56320<=i&&i<=57343)return e.lastIntValue=1024*(r-55296)+(i-56320)+65536,!0}e.pos=n,e.lastIntValue=r}return!0}if(e.switchU&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&function(e){return 0<=e&&e<=1114111}(e.lastIntValue))return!0;e.switchU&&e.raise("Invalid unicode escape"),e.pos=t}return!1},Oe.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Oe.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(49<=t&&t<=57){for(;e.lastIntValue=10*e.lastIntValue+(t-48),e.advance(),48<=(t=e.current())&&t<=57;);return!0}return!1},Oe.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&9<=this.options.ecmaVersion&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},Oe.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},Oe.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){Y(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},Oe.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},Oe.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Fe(t=e.current());)e.lastStringValue+=Be(t),e.advance();return""!==e.lastStringValue},Oe.regexp_eatUnicodePropertyValue=function(e){var t,r=0;for(e.lastStringValue="";Fe(t=r=e.current())||Ue(t);)e.lastStringValue+=Be(r),e.advance();return""!==e.lastStringValue},Oe.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Oe.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},Oe.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;!e.switchU||-1!==t&&-1!==r||e.raise("Invalid character class"),-1!==t&&-1!==r&&r>10),56320+(1023&e)))}Ge.next=function(){this.options.onToken&&this.options.onToken(new We(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ge.getToken=function(){return this.next(),new We(this)},"undefined"!=typeof Symbol&&(Ge[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===j.eof,value:e}}}}),Ge.curContext=function(){return this.context[this.context.length-1]},Ge.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(j.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ge.readToken=function(e){return L(e,6<=this.options.ecmaVersion)||92===e?this.readWord():this.getTokenFromCode(e)},Ge.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||57344<=e?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Ge.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),r=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(z.lastIndex=r;(e=z.exec(this.input))&&e.index=r.input.length&&r.raise(n,"Unterminated regular expression");var i=r.input.charAt(r.pos);if(q.test(i)&&r.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++r.pos}var s=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var c=this.regexpState||(this.regexpState=new Re(this));c.reset(n,s,o),this.validateRegExpFlags(c),this.validateRegExpPattern(c);var u=null;try{u=new RegExp(s,o)}catch(e){}return this.finishToken(j.regexp,{pattern:s,flags:o,value:u})},Ge.readInt=function(e,t){for(var r=this.pos,n=0,i=0,s=null==t?1/0:t;i=t.input.length&&t.raise(t.start,"Unterminated string constant");var i=t.input.charCodeAt(t.pos);if(i===e)break;92===i?(r+=t.input.slice(n,t.pos),r+=t.readEscapedChar(!1),n=t.pos):(W(i,10<=t.options.ecmaVersion)&&t.raise(t.start,"Unterminated string constant"),++t.pos)}return r+=this.input.slice(n,this.pos++),this.finishToken(j.string,r)};var Qe={};Ge.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Qe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ge.invalidStringToken=function(e,t){if(this.inTemplateElement&&9<=this.options.ecmaVersion)throw Qe;this.raise(e,t)},Ge.readTmplToken=function(){for(var e=this,t="",r=this.pos;;){e.pos>=e.input.length&&e.raise(e.start,"Unterminated template");var n=e.input.charCodeAt(e.pos);if(96===n||36===n&&123===e.input.charCodeAt(e.pos+1))return e.pos!==e.start||e.type!==j.template&&e.type!==j.invalidTemplate?(t+=e.input.slice(r,e.pos),e.finishToken(j.template,t)):36===n?(e.pos+=2,e.finishToken(j.dollarBraceL)):(++e.pos,e.finishToken(j.backQuote));if(92===n)t+=e.input.slice(r,e.pos),t+=e.readEscapedChar(!0),r=e.pos;else if(W(n)){switch(t+=e.input.slice(r,e.pos),++e.pos,n){case 13:10===e.input.charCodeAt(e.pos)&&++e.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(n)}e.options.locations&&(++e.curLine,e.lineStart=e.pos),r=e.pos}else++e.pos}},Ge.readInvalidTemplateToken=function(){for(var e=this;this.posa[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function ht(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(void 0===t||0":return n=":return n<=r;case"<<":return r<>":return r>>n;case">>>":return r>>>n;case"+":return r+n;case"-":return r-n;case"*":return r*n;case"**":return Math.pow(r,n);case"/":return r/n;case"%":return r%n;case"|":return r|n;case"^":return r^n;case"&":return r&n;case"in":return r in n;case"instanceof":return r instanceof n;default:throw new SyntaxError("Unexpected token "+e.operator)}},AssignmentExpression:function(e,t){var r,n=Nt(e.right,t),i=e.left;if("Identifier"===i.type){if(!(r=lt(i,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();r=new at(s,i.name)}}else{if("MemberExpression"!==i.type)return xr(i,t,{feed:n});r=yt(i,t,{getVar:!0})}switch(e.operator){case"=":return r.set(n),r.get();case"+=":return r.set(r.get()+n),r.get();case"-=":return r.set(r.get()-n),r.get();case"*=":return r.set(r.get()*n),r.get();case"/=":return r.set(r.get()/n),r.get();case"%=":return r.set(r.get()%n),r.get();case"**=":return r.set(Math.pow(r.get(),n)),r.get();case"<<=":return r.set(r.get()<>=":return r.set(r.get()>>n),r.get();case">>>=":return r.set(r.get()>>>n),r.get();case"|=":return r.set(r.get()|n),r.get();case"^=":return r.set(r.get()^n),r.get();case"&=":return r.set(r.get()&n),r.get();default:throw new SyntaxError("Unexpected token "+e.operator)}},LogicalExpression:function(e,t){switch(e.operator){case"||":return Nt(e.left,t)||Nt(e.right,t);case"&&":return Nt(e.left,t)&&Nt(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}},MemberExpression:yt,ConditionalExpression:function(e,t){return Nt(e.test,t)?Nt(e.consequent,t):Nt(e.alternate,t)},CallExpression:function(e,t){var r,n;if("MemberExpression"===e.callee.type){n=yt(e.callee,t,{getObj:!0});var i=void 0;if(i=e.callee.computed?Nt(e.callee.property,t):e.callee.property.name,"Super"===e.callee.object.type){var s=t.find("this").get();r=n[i].bind(s)}else r=n[i];if("function"!=typeof r)throw new TypeError(i+" is not a function");if(r[tt])throw new TypeError("Class constructor "+i+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(r=Nt(e.callee,t))||"Super"!==e.callee.type&&r[tt]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(r)}catch(e){a=""+r}throw"function"!=typeof r?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}for(var o=[],c=0;c":return[2,i=":return[2,i<=n];case"<<":return[2,n<>":return[2,n>>i];case">>>":return[2,n>>>i];case"+":return[2,n+i];case"-":return[2,n-i];case"*":return[2,n*i];case"**":return[2,Math.pow(n,i)];case"/":return[2,n/i];case"%":return[2,n%i];case"|":return[2,n|i];case"^":return[2,n^i];case"&":return[2,n&i];case"in":return[2,n in i];case"instanceof":return[2,n instanceof i];default:throw new SyntaxError("Unexpected token "+t.operator)}return[2]}})},AssignmentExpression:function(t,r){var n,i,s,a;return ct(this,function(e){switch(e.label){case 0:return[5,ut(ir(t.right,r))];case 1:return n=e.sent(),"Identifier"!==(i=t.left).type?[3,3]:[5,ut(Ft(i,r,{getVar:!0,throwErr:!1}))];case 2:return(s=e.sent())||(a=r.global().find("window").get(),s=new at(a,i.name)),[3,7];case 3:return"MemberExpression"!==i.type?[3,5]:[5,ut(zt(i,r,{getVar:!0}))];case 4:return s=e.sent(),[3,7];case 5:return[5,ut(dr(i,r,{feed:n}))];case 6:return[2,e.sent()];case 7:switch(t.operator){case"=":return s.set(n),[2,s.get()];case"+=":return s.set(s.get()+n),[2,s.get()];case"-=":return s.set(s.get()-n),[2,s.get()];case"*=":return s.set(s.get()*n),[2,s.get()];case"/=":return s.set(s.get()/n),[2,s.get()];case"%=":return s.set(s.get()%n),[2,s.get()];case"**=":return s.set(Math.pow(s.get(),n)),[2,s.get()];case"<<=":return s.set(s.get()<>=":return s.set(s.get()>>n),[2,s.get()];case">>>=":return s.set(s.get()>>>n),[2,s.get()];case"|=":return s.set(s.get()|n),[2,s.get()];case"^=":return s.set(s.get()^n),[2,s.get()];case"&=":return s.set(s.get()&n),[2,s.get()];default:throw new SyntaxError("Unexpected token "+t.operator)}return[2]}})},LogicalExpression:function(t,r){var n,i;return ct(this,function(e){switch(e.label){case 0:switch(t.operator){case"||":return[3,1];case"&&":return[3,5]}return[3,9];case 1:return[5,ut(ir(t.left,r))];case 2:return(n=e.sent())?[3,4]:[5,ut(ir(t.right,r))];case 3:n=e.sent(),e.label=4;case 4:return[2,n];case 5:return[5,ut(ir(t.left,r))];case 6:return(i=e.sent())?[5,ut(ir(t.right,r))]:[3,8];case 7:i=e.sent(),e.label=8;case 8:return[2,i];case 9:throw new SyntaxError("Unexpected token "+t.operator)}})},MemberExpression:zt,ConditionalExpression:function(t,r){var n;return ct(this,function(e){switch(e.label){case 0:return[5,ut(ir(t.test,r))];case 1:return e.sent()?[5,ut(ir(t.consequent,r))]:[3,3];case 2:return n=e.sent(),[3,5];case 3:return[5,ut(ir(t.alternate,r))];case 4:n=e.sent(),e.label=5;case 5:return[2,n]}})},CallExpression:function(t,r){var n,i,s,a,o,c,u,h,p,l,d,f;return ct(this,function(e){switch(e.label){case 0:return"MemberExpression"!==t.callee.type?[3,5]:[5,ut(zt(t.callee,r,{getObj:!0}))];case 1:return i=e.sent(),s=void 0,t.callee.computed?[5,ut(ir(t.callee.property,r))]:[3,3];case 2:return s=e.sent(),[3,4];case 3:s=t.callee.property.name,e.label=4;case 4:if("function"!=typeof(n="Super"===t.callee.object.type?(a=r.find("this").get(),i[s].bind(a)):i[s]))throw new TypeError(s+" is not a function");if(n[tt])throw new TypeError("Class constructor "+s+" cannot be invoked without 'new'");return[3,7];case 5:return i=r.find("this").get(),[5,ut(ir(t.callee,r))];case 6:if("function"!=typeof(n=e.sent())||"Super"!==t.callee.type&&n[tt]){if("Identifier"===t.callee.type)o=t.callee.name;else try{o=JSON.stringify(n)}catch(e){o=""+n}throw"function"!=typeof n?new TypeError(o+" is not a function"):new TypeError("Class constructor "+o+" cannot be invoked without 'new'")}e.label=7;case 7:c=[],u=0,e.label=8;case 8:return u=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(n),s=void 0,Ke.RES=i.next(),[4,Ke]):[3,8];case 2:s=e.sent(),e.label=3;case 3:return s.done?[3,7]:[5,ut(yr(t,r,{value:s.value}))];case 4:if((u=e.sent())===Je)return[3,7];if(u===Ye)return[3,5];if(u===Xe)return[2,u];e.label=5;case 5:return Ke.RES=i.next(),[4,Ke];case 6:return s=e.sent(),[3,3];case 7:return[3,15];case 8:e.trys.push([8,13,14,15]),a=ut(n),o=a.next(),e.label=9;case 9:return o.done?[3,12]:(c=o.value,[5,ut(yr(t,r,{value:c}))]);case 10:if((u=e.sent())===Je)return[3,12];if(u===Ye)return[3,11];if(u===Xe)return[2,u];e.label=11;case 11:return o=a.next(),[3,9];case 12:return[3,15];case 13:return h=e.sent(),p={error:h},[3,15];case 14:try{o&&!o.done&&(l=a.return)&&l.call(a)}finally{if(p)throw p.error}return[7];case 15:return[2]}})}});function Zt(t,r,n){var i,s,a,o,c,u,h,p,l,d,f,m,y,g,v;return void 0===n&&(n={}),ct(this,function(e){switch(e.label){case 0:i=n.kind,s=void 0===i?"let":i,a=n.hoist,o=void 0!==a&&a,c=n.onlyBlock,u=void 0!==c&&c,h=n.feed,p=void 0===h?{}:h,l=[],d=0,e.label=1;case 1:return d= 2.1.2 < 3" @@ -3692,8 +3689,8 @@ }, "import-local": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "resolved": "https://registry.npm.taobao.org/import-local/download/import-local-2.0.0.tgz", + "integrity": "sha1-VQcL44pZk88Y72236WH1vuXFoJ0=", "dev": true, "requires": { "pkg-dir": "^3.0.0", @@ -3724,8 +3721,8 @@ }, "invariant": { "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "resolved": "https://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz", + "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -3733,8 +3730,8 @@ }, "invert-kv": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "resolved": "https://registry.npm.taobao.org/invert-kv/download/invert-kv-2.0.0.tgz", + "integrity": "sha1-c5P1r6Weyf9fZ6J2INEcIm4+7AI=", "dev": true }, "is-accessor-descriptor": { @@ -3777,14 +3774,14 @@ }, "is-callable": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "resolved": "https://registry.npm.taobao.org/is-callable/download/is-callable-1.1.4.tgz", + "integrity": "sha1-HhrfIZ4e62hNaR+dagX/DTCiTXU=", "dev": true }, "is-ci": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "resolved": "https://registry.npm.taobao.org/is-ci/download/is-ci-2.0.0.tgz", + "integrity": "sha1-a8YzQYGBDgS1wis9WJ/cpVAmQEw=", "dev": true, "requires": { "ci-info": "^2.0.0" @@ -3855,8 +3852,8 @@ }, "is-generator-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "resolved": "https://registry.npm.taobao.org/is-generator-fn/download/is-generator-fn-2.1.0.tgz", + "integrity": "sha1-fRQK3DiarzARqPKipM+m+q3/sRg=", "dev": true }, "is-module": { @@ -3929,8 +3926,8 @@ }, "is-symbol": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "resolved": "https://registry.npm.taobao.org/is-symbol/download/is-symbol-1.0.2.tgz", + "integrity": "sha1-oFX2rlcZLK7jKeeoYBGLSXqVDzg=", "dev": true, "requires": { "has-symbols": "^1.0.0" @@ -3944,8 +3941,8 @@ }, "is-url": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "resolved": "https://registry.npm.taobao.org/is-url/download/is-url-1.2.4.tgz", + "integrity": "sha1-BKTfRtKMTP89c9Af8Gq+sxihqlI=", "dev": true }, "is-windows": { @@ -3984,80 +3981,50 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "istanbul-api": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.5.tgz", - "integrity": "sha512-meYk1BwDp59Pfse1TvPrkKYgVqAufbdBLEVoqvu/hLLKSaQ054ZTksbNepyc223tMnWdm6AdK2URIJJRqdP87g==", - "dev": true, - "requires": { - "async": "^2.6.1", - "compare-versions": "^3.2.1", - "fileset": "^2.0.3", - "istanbul-lib-coverage": "^2.0.4", - "istanbul-lib-hook": "^2.0.6", - "istanbul-lib-instrument": "^3.2.0", - "istanbul-lib-report": "^2.0.7", - "istanbul-lib-source-maps": "^3.0.5", - "istanbul-reports": "^2.2.3", - "js-yaml": "^3.13.0", - "make-dir": "^2.1.0", - "minimatch": "^3.0.4", - "once": "^1.4.0" - } - }, "istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-LXTBICkMARVgo579kWDm8SqfB6nvSDKNqIOBEjmJRnL04JvoMHCYGWaMddQnseJYtkEuEvO/sIcOxPLk9gERug==", + "version": "2.0.5", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-coverage/download/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha1-Z18KtpUD+tSx2En3NrqsqAM0T0k=", "dev": true }, - "istanbul-lib-hook": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.6.tgz", - "integrity": "sha512-829DKONApZ7UCiPXcOYWSgkFXa4+vNYoNOt3F+4uDJLKL1OotAoVwvThoEj1i8jmOj7odbYcR3rnaHu+QroaXg==", - "dev": true, - "requires": { - "append-transform": "^1.0.0" - } - }, "istanbul-lib-instrument": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.2.0.tgz", - "integrity": "sha512-06IM3xShbNW4NgZv5AP4QH0oHqf1/ivFo8eFys0ZjPXHGldHJQWb3riYOKXqmOqfxXBfxu4B+g/iuhOPZH0RJg==", + "version": "3.3.0", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-instrument/download/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha1-pfY9kfC7wMPkee9MXeAnM17G1jA=", "dev": true, "requires": { - "@babel/generator": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/template": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.4", + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", "semver": "^6.0.0" }, "dependencies": { "semver": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", - "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "version": "6.1.1", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.1.1.tgz", + "integrity": "sha1-U/U9qbMLIQPNTxXqs6GOy8shDJs=", "dev": true } } }, "istanbul-lib-report": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.7.tgz", - "integrity": "sha512-wLH6beJBFbRBLiTlMOBxmb85cnVM1Vyl36N48e4e/aTKSM3WbOx7zbVIH1SQ537fhhsPbX0/C5JB4qsmyRXXyA==", + "version": "2.0.8", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-report/download/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha1-WoETzXRtQ8SInro2qxDn1QybTzM=", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.4", + "istanbul-lib-coverage": "^2.0.5", "make-dir": "^2.1.0", - "supports-color": "^6.0.0" + "supports-color": "^6.1.0" }, "dependencies": { "supports-color": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-6.1.0.tgz", + "integrity": "sha1-B2Srxpxj1ayELdSGfo0CXogN+PM=", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -4066,54 +4033,54 @@ } }, "istanbul-lib-source-maps": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.5.tgz", - "integrity": "sha512-eDhZ7r6r1d1zQPVZehLc3D0K14vRba/eBYkz3rw16DLOrrTzve9RmnkcwrrkWVgO1FL3EK5knujVe5S8QHE9xw==", + "version": "3.0.6", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-source-maps/download/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha1-KEmXxIIRdS7EhiU9qX44ed77qMg=", "dev": true, "requires": { "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.4", + "istanbul-lib-coverage": "^2.0.5", "make-dir": "^2.1.0", - "rimraf": "^2.6.2", + "rimraf": "^2.6.3", "source-map": "^0.6.1" }, "dependencies": { "debug": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", "dev": true, "requires": { "ms": "^2.1.1" } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", "dev": true }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } }, "istanbul-reports": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.3.tgz", - "integrity": "sha512-T6EbPuc8Cb620LWAYyZ4D8SSn06dY9i1+IgUX2lTH8gbwflMc9Obd33zHTyNX653ybjpamAHS9toKS3E6cGhTw==", + "version": "2.2.6", + "resolved": "https://registry.npm.taobao.org/istanbul-reports/download/istanbul-reports-2.2.6.tgz", + "integrity": "sha1-e08mYNgrKTA6j+YJH4ykvwWNoa8=", "dev": true, "requires": { - "handlebars": "^4.1.0" + "handlebars": "^4.1.2" } }, "jest": { "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-24.1.0.tgz", - "integrity": "sha512-+q91L65kypqklvlRFfXfdzUKyngQLOcwGhXQaLmVHv+d09LkNXuBuGxlofTFW42XMzu3giIcChchTsCNUjQ78A==", + "resolved": "https://registry.npm.taobao.org/jest/download/jest-24.1.0.tgz", + "integrity": "sha1-seETXK788jl5UOz3+Q45X96Gb9I=", "dev": true, "requires": { "import-local": "^2.0.0", @@ -4121,21 +4088,21 @@ }, "dependencies": { "jest-cli": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.7.1.tgz", - "integrity": "sha512-32OBoSCVPzcTslGFl6yVCMzB2SqX3IrWwZCY5mZYkb0D2WsogmU3eV2o8z7+gRQa4o4sZPX/k7GU+II7CxM6WQ==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-cli/download/jest-cli-24.8.0.tgz", + "integrity": "sha1-sHWskUSS7RFPozit5zYqMBaT6Yk=", "dev": true, "requires": { - "@jest/core": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/core": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", "exit": "^0.1.2", "import-local": "^2.0.0", "is-ci": "^2.0.0", - "jest-config": "^24.7.1", - "jest-util": "^24.7.1", - "jest-validate": "^24.7.0", + "jest-config": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "prompts": "^2.0.1", "realpath-native": "^1.1.0", "yargs": "^12.0.2" @@ -4144,49 +4111,49 @@ } }, "jest-changed-files": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.7.0.tgz", - "integrity": "sha512-33BgewurnwSfJrW7T5/ZAXGE44o7swLslwh8aUckzq2e17/2Os1V0QU506ZNik3hjs8MgnEMKNkcud442NCDTw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-changed-files/download/jest-changed-files-24.8.0.tgz", + "integrity": "sha1-fn6yHPaHWHqF5Q89JJ0TJ+FbFXs=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "execa": "^1.0.0", "throat": "^4.0.0" } }, "jest-config": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.7.1.tgz", - "integrity": "sha512-8FlJNLI+X+MU37j7j8RE4DnJkvAghXmBWdArVzypW6WxfGuxiL/CCkzBg0gHtXhD2rxla3IMOSUAHylSKYJ83g==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-config/download/jest-config-24.8.0.tgz", + "integrity": "sha1-d9s9JlpvcmKUaHy7zMNvinbuD08=", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^24.7.1", - "@jest/types": "^24.7.0", - "babel-jest": "^24.7.1", + "@jest/test-sequencer": "^24.8.0", + "@jest/types": "^24.8.0", + "babel-jest": "^24.8.0", "chalk": "^2.0.1", "glob": "^7.1.1", - "jest-environment-jsdom": "^24.7.1", - "jest-environment-node": "^24.7.1", - "jest-get-type": "^24.3.0", - "jest-jasmine2": "^24.7.1", + "jest-environment-jsdom": "^24.8.0", + "jest-environment-node": "^24.8.0", + "jest-get-type": "^24.8.0", + "jest-jasmine2": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.7.1", - "jest-util": "^24.7.1", - "jest-validate": "^24.7.0", + "jest-resolve": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "micromatch": "^3.1.10", - "pretty-format": "^24.7.0", + "pretty-format": "^24.8.0", "realpath-native": "^1.1.0" }, "dependencies": { "babel-jest": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.7.1.tgz", - "integrity": "sha512-GPnLqfk8Mtt0i4OemjWkChi73A3ALs4w2/QbG64uAj8b5mmwzxc7jbJVRZt8NJkxi6FopVHog9S3xX6UJKb2qg==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/babel-jest/download/babel-jest-24.8.0.tgz", + "integrity": "sha1-XBX/KyjiCw9F30P+a38qrpPbpYk=", "dev": true, "requires": { - "@jest/transform": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", "@types/babel__core": "^7.1.0", "babel-plugin-istanbul": "^5.1.0", "babel-preset-jest": "^24.6.0", @@ -4196,17 +4163,17 @@ }, "jest-pnp-resolver": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", - "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", + "resolved": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha1-7NrmBMB3p/vHDe+21RfDwciYkjo=", "dev": true }, "jest-resolve": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.7.1.tgz", - "integrity": "sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-24.8.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-resolve%2Fdownload%2Fjest-resolve-24.8.0.tgz", + "integrity": "sha1-hLjlQIwfahFTl5Pitf6xtuciQ58=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "browser-resolve": "^1.11.3", "chalk": "^2.0.1", "jest-pnp-resolver": "^1.2.1", @@ -4216,86 +4183,86 @@ } }, "jest-diff": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.7.0.tgz", - "integrity": "sha512-ULQZ5B1lWpH70O4xsANC4tf4Ko6RrpwhE3PtG6ERjMg1TiYTC2Wp4IntJVGro6a8HG9luYHhhmF4grF0Pltckg==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-diff/download/jest-diff-24.8.0.tgz", + "integrity": "sha1-FGQ159Hj/98pPVP/l+GT8dFUYXI=", "dev": true, "requires": { "chalk": "^2.0.1", "diff-sequences": "^24.3.0", - "jest-get-type": "^24.3.0", - "pretty-format": "^24.7.0" + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" } }, "jest-docblock": { "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.3.0.tgz", - "integrity": "sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg==", + "resolved": "https://registry.npm.taobao.org/jest-docblock/download/jest-docblock-24.3.0.tgz", + "integrity": "sha1-ucMtrHD3LkRkUg0rpK7AKrFNtd0=", "dev": true, "requires": { "detect-newline": "^2.1.0" } }, "jest-each": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.7.1.tgz", - "integrity": "sha512-4fsS8fEfLa3lfnI1Jw6NxjhyRTgfpuOVTeUZZFyVYqeTa4hPhr2YkToUhouuLTrL2eMGOfpbdMyRx0GQ/VooKA==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-each/download/jest-each-24.8.0.tgz", + "integrity": "sha1-oF/Sv5TdwLHaZsbRPsJFfzXlJ3U=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", - "jest-get-type": "^24.3.0", - "jest-util": "^24.7.1", - "pretty-format": "^24.7.0" + "jest-get-type": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0" } }, "jest-environment-jsdom": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.7.1.tgz", - "integrity": "sha512-Gnhb+RqE2JuQGb3kJsLF8vfqjt3PHKSstq4Xc8ic+ax7QKo4Z0RWGucU3YV+DwKR3T9SYc+3YCUQEJs8r7+Jxg==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-environment-jsdom/download/jest-environment-jsdom-24.8.0.tgz", + "integrity": "sha1-MA9pSaFGyr4ck1etnp7Pn0PziFc=", "dev": true, "requires": { - "@jest/environment": "^24.7.1", - "@jest/fake-timers": "^24.7.1", - "@jest/types": "^24.7.0", - "jest-mock": "^24.7.0", - "jest-util": "^24.7.1", + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0", "jsdom": "^11.5.1" } }, "jest-environment-node": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.7.1.tgz", - "integrity": "sha512-GJJQt1p9/C6aj6yNZMvovZuxTUd+BEJprETdvTKSb4kHcw4mFj8777USQV0FJoJ4V3djpOwA5eWyPwfq//PFBA==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-environment-node/download/jest-environment-node-24.8.0.tgz", + "integrity": "sha1-0/cmuovFMIemDnqEygiIOkyJIjE=", "dev": true, "requires": { - "@jest/environment": "^24.7.1", - "@jest/fake-timers": "^24.7.1", - "@jest/types": "^24.7.0", - "jest-mock": "^24.7.0", - "jest-util": "^24.7.1" + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0" } }, "jest-get-type": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.3.0.tgz", - "integrity": "sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-get-type/download/jest-get-type-24.8.0.tgz", + "integrity": "sha1-p0QN4wtlH1pw6j7X/wc6Mt/mRvw=", "dev": true }, "jest-haste-map": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.7.1.tgz", - "integrity": "sha512-g0tWkzjpHD2qa03mTKhlydbmmYiA2KdcJe762SbfFo/7NIMgBWAA0XqQlApPwkWOF7Cxoi/gUqL0i6DIoLpMBw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-haste-map/download/jest-haste-map-24.8.0.tgz", + "integrity": "sha1-UXlBgth3s939bm0jkg4/5y8wWAA=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", "jest-serializer": "^24.4.0", - "jest-util": "^24.7.1", + "jest-util": "^24.8.0", "jest-worker": "^24.6.0", "micromatch": "^3.1.10", "sane": "^4.0.3", @@ -4303,59 +4270,59 @@ } }, "jest-jasmine2": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.7.1.tgz", - "integrity": "sha512-Y/9AOJDV1XS44wNwCaThq4Pw3gBPiOv/s6NcbOAkVRRUEPu+36L2xoPsqQXsDrxoBerqeyslpn2TpCI8Zr6J2w==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-jasmine2/download/jest-jasmine2-24.8.0.tgz", + "integrity": "sha1-qcfhTIPdd9ixXoIFSc6Jh8yM2Jg=", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", "co": "^4.6.0", - "expect": "^24.7.1", + "expect": "^24.8.0", "is-generator-fn": "^2.0.0", - "jest-each": "^24.7.1", - "jest-matcher-utils": "^24.7.0", - "jest-message-util": "^24.7.1", - "jest-runtime": "^24.7.1", - "jest-snapshot": "^24.7.1", - "jest-util": "^24.7.1", - "pretty-format": "^24.7.0", + "jest-each": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0", "throat": "^4.0.0" } }, "jest-leak-detector": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.7.0.tgz", - "integrity": "sha512-zV0qHKZGXtmPVVzT99CVEcHE9XDf+8LwiE0Ob7jjezERiGVljmqKFWpV2IkG+rkFIEUHFEkMiICu7wnoPM/RoQ==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-leak-detector/download/jest-leak-detector-24.8.0.tgz", + "integrity": "sha1-wAhjhOH2UMLYNICV33afKbSOaYA=", "dev": true, "requires": { - "pretty-format": "^24.7.0" + "pretty-format": "^24.8.0" } }, "jest-matcher-utils": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.7.0.tgz", - "integrity": "sha512-158ieSgk3LNXeUhbVJYRXyTPSCqNgVXOp/GT7O94mYd3pk/8+odKTyR1JLtNOQSPzNi8NFYVONtvSWA/e1RDXg==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-matcher-utils/download/jest-matcher-utils-24.8.0.tgz", + "integrity": "sha1-K85CIEya8SveRvg9yDnv6L6DJJU=", "dev": true, "requires": { "chalk": "^2.0.1", - "jest-diff": "^24.7.0", - "jest-get-type": "^24.3.0", - "pretty-format": "^24.7.0" + "jest-diff": "^24.8.0", + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" } }, "jest-message-util": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.7.1.tgz", - "integrity": "sha512-dk0gqVtyqezCHbcbk60CdIf+8UHgD+lmRHifeH3JRcnAqh4nEyPytSc9/L1+cQyxC+ceaeP696N4ATe7L+omcg==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-message-util/download/jest-message-util-24.8.0.tgz", + "integrity": "sha1-DWiR5ypL6swCkrY4aF30LijWIYs=", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "@types/stack-utils": "^1.0.1", "chalk": "^2.0.1", "micromatch": "^3.1.10", @@ -4364,30 +4331,30 @@ } }, "jest-mock": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.7.0.tgz", - "integrity": "sha512-6taW4B4WUcEiT2V9BbOmwyGuwuAFT2G8yghF7nyNW1/2gq5+6aTqSPcS9lS6ArvEkX55vbPAS/Jarx5LSm4Fng==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-mock/download/jest-mock-24.8.0.tgz", + "integrity": "sha1-L50U03aZ6GPx/r9OTVozt/273lY=", "dev": true, "requires": { - "@jest/types": "^24.7.0" + "@jest/types": "^24.8.0" } }, "jest-pnp-resolver": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.1.0.tgz", - "integrity": "sha512-/tuTb5um2nQvybL7Scxy6oJF5cbWWawugurVIMnnXhBSlUjNEwKpPeaYT7K/f/EZupmrKfiwQ95f3J7kShAZEA==", + "resolved": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.1.0.tgz", + "integrity": "sha1-tuLrFPbO3f0c3kARm+Z92uFzjCs=", "dev": true }, "jest-regex-util": { "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.3.0.tgz", - "integrity": "sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg==", + "resolved": "https://registry.npm.taobao.org/jest-regex-util/download/jest-regex-util-24.3.0.tgz", + "integrity": "sha1-1aZfYL4a4+MQ1SFKAwdYGZUiezY=", "dev": true }, "jest-resolve": { "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.1.0.tgz", - "integrity": "sha512-TPiAIVp3TG6zAxH28u/6eogbwrvZjBMWroSLBDkwkHKrqxB/RIdwkWDye4uqPlZIXWIaHtifY3L0/eO5Z0f2wg==", + "resolved": "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-24.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-resolve%2Fdownload%2Fjest-resolve-24.1.0.tgz", + "integrity": "sha1-Qv8BabDqR7/b0MUqAGfKfQIsdog=", "dev": true, "requires": { "browser-resolve": "^1.11.3", @@ -4396,38 +4363,38 @@ } }, "jest-resolve-dependencies": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.7.1.tgz", - "integrity": "sha512-2Eyh5LJB2liNzfk4eo7bD1ZyBbqEJIyyrFtZG555cSWW9xVHxII2NuOkSl1yUYTAYCAmM2f2aIT5A7HzNmubyg==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-resolve-dependencies/download/jest-resolve-dependencies-24.8.0.tgz", + "integrity": "sha1-Ge7DJB8gRdP5kNujMdDXUmrP+OA=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-snapshot": "^24.7.1" + "jest-snapshot": "^24.8.0" } }, "jest-runner": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.7.1.tgz", - "integrity": "sha512-aNFc9liWU/xt+G9pobdKZ4qTeG/wnJrJna3VqunziDNsWT3EBpmxXZRBMKCsNMyfy+A/XHiV+tsMLufdsNdgCw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-runner/download/jest-runner-24.8.0.tgz", + "integrity": "sha1-T5rge3Z9snt0DX3v+tDPZ8y0xbs=", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/environment": "^24.7.1", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.4.2", "exit": "^0.1.2", "graceful-fs": "^4.1.15", - "jest-config": "^24.7.1", + "jest-config": "^24.8.0", "jest-docblock": "^24.3.0", - "jest-haste-map": "^24.7.1", - "jest-jasmine2": "^24.7.1", - "jest-leak-detector": "^24.7.0", - "jest-message-util": "^24.7.1", - "jest-resolve": "^24.7.1", - "jest-runtime": "^24.7.1", - "jest-util": "^24.7.1", + "jest-haste-map": "^24.8.0", + "jest-jasmine2": "^24.8.0", + "jest-leak-detector": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-util": "^24.8.0", "jest-worker": "^24.6.0", "source-map-support": "^0.5.6", "throat": "^4.0.0" @@ -4435,17 +4402,17 @@ "dependencies": { "jest-pnp-resolver": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", - "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", + "resolved": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha1-7NrmBMB3p/vHDe+21RfDwciYkjo=", "dev": true }, "jest-resolve": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.7.1.tgz", - "integrity": "sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-24.8.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-resolve%2Fdownload%2Fjest-resolve-24.8.0.tgz", + "integrity": "sha1-hLjlQIwfahFTl5Pitf6xtuciQ58=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "browser-resolve": "^1.11.3", "chalk": "^2.0.1", "jest-pnp-resolver": "^1.2.1", @@ -4455,30 +4422,30 @@ } }, "jest-runtime": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.7.1.tgz", - "integrity": "sha512-0VAbyBy7tll3R+82IPJpf6QZkokzXPIS71aDeqh+WzPRXRCNz6StQ45otFariPdJ4FmXpDiArdhZrzNAC3sj6A==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-runtime/download/jest-runtime-24.8.0.tgz", + "integrity": "sha1-BflNWwXCH23FTkJ80uSYCSM1BiA=", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/environment": "^24.7.1", + "@jest/environment": "^24.8.0", "@jest/source-map": "^24.3.0", - "@jest/transform": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", "@types/yargs": "^12.0.2", "chalk": "^2.0.1", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.1.15", - "jest-config": "^24.7.1", - "jest-haste-map": "^24.7.1", - "jest-message-util": "^24.7.1", - "jest-mock": "^24.7.0", + "jest-config": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-mock": "^24.8.0", "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.7.1", - "jest-snapshot": "^24.7.1", - "jest-util": "^24.7.1", - "jest-validate": "^24.7.0", + "jest-resolve": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "realpath-native": "^1.1.0", "slash": "^2.0.0", "strip-bom": "^3.0.0", @@ -4487,17 +4454,17 @@ "dependencies": { "jest-pnp-resolver": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", - "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", + "resolved": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha1-7NrmBMB3p/vHDe+21RfDwciYkjo=", "dev": true }, "jest-resolve": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.7.1.tgz", - "integrity": "sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-24.8.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-resolve%2Fdownload%2Fjest-resolve-24.8.0.tgz", + "integrity": "sha1-hLjlQIwfahFTl5Pitf6xtuciQ58=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "browser-resolve": "^1.11.3", "chalk": "^2.0.1", "jest-pnp-resolver": "^1.2.1", @@ -4508,43 +4475,43 @@ }, "jest-serializer": { "version": "24.4.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.4.0.tgz", - "integrity": "sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==", + "resolved": "https://registry.npm.taobao.org/jest-serializer/download/jest-serializer-24.4.0.tgz", + "integrity": "sha1-9wxZGMjqkjXMsSdtIy5FkIBYjbM=", "dev": true }, "jest-snapshot": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.7.1.tgz", - "integrity": "sha512-8Xk5O4p+JsZZn4RCNUS3pxA+ORKpEKepE+a5ejIKrId9CwrVN0NY+vkqEkXqlstA5NMBkNahXkR/4qEBy0t5yA==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-snapshot/download/jest-snapshot-24.8.0.tgz", + "integrity": "sha1-O+xqWdov97x9CXqFP7Z/nUFct8Y=", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", - "expect": "^24.7.1", - "jest-diff": "^24.7.0", - "jest-matcher-utils": "^24.7.0", - "jest-message-util": "^24.7.1", - "jest-resolve": "^24.7.1", + "expect": "^24.8.0", + "jest-diff": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "pretty-format": "^24.7.0", + "pretty-format": "^24.8.0", "semver": "^5.5.0" }, "dependencies": { "jest-pnp-resolver": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", - "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", + "resolved": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha1-7NrmBMB3p/vHDe+21RfDwciYkjo=", "dev": true }, "jest-resolve": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.7.1.tgz", - "integrity": "sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-24.8.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-resolve%2Fdownload%2Fjest-resolve-24.8.0.tgz", + "integrity": "sha1-hLjlQIwfahFTl5Pitf6xtuciQ58=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "browser-resolve": "^1.11.3", "chalk": "^2.0.1", "jest-pnp-resolver": "^1.2.1", @@ -4554,16 +4521,16 @@ } }, "jest-util": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.7.1.tgz", - "integrity": "sha512-/KilOue2n2rZ5AnEBYoxOXkeTu6vi7cjgQ8MXEkih0oeAXT6JkS3fr7/j8+engCjciOU1Nq5loMSKe0A1oeX0A==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-util/download/jest-util-24.8.0.tgz", + "integrity": "sha1-QfDpRdoR30TMdtZP+5FdBxb0bNE=", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/fake-timers": "^24.7.1", + "@jest/fake-timers": "^24.8.0", "@jest/source-map": "^24.3.0", - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "callsites": "^3.0.0", "chalk": "^2.0.1", "graceful-fs": "^4.1.15", @@ -4575,44 +4542,44 @@ "dependencies": { "callsites": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "resolved": "https://registry.npm.taobao.org/callsites/download/callsites-3.1.0.tgz", + "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", "dev": true }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } }, "jest-validate": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.7.0.tgz", - "integrity": "sha512-cgai/gts9B2chz1rqVdmLhzYxQbgQurh1PEQSvSgPZ8KGa1AqXsqC45W5wKEwzxKrWqypuQrQxnF4+G9VejJJA==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-validate/download/jest-validate-24.8.0.tgz", + "integrity": "sha1-YkxBUz5t/jVv+txuJCOjXC07SEk=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "camelcase": "^5.0.0", "chalk": "^2.0.1", - "jest-get-type": "^24.3.0", + "jest-get-type": "^24.8.0", "leven": "^2.1.0", - "pretty-format": "^24.7.0" + "pretty-format": "^24.8.0" } }, "jest-watcher": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.7.1.tgz", - "integrity": "sha512-Wd6TepHLRHVKLNPacEsBwlp9raeBIO+01xrN24Dek4ggTS8HHnOzYSFnvp+6MtkkJ3KfMzy220KTi95e2rRkrw==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/jest-watcher/download/jest-watcher-24.8.0.tgz", + "integrity": "sha1-WNSZFc7d0t6F4jj2ITzvHJNxXeQ=", "dev": true, "requires": { - "@jest/test-result": "^24.7.1", - "@jest/types": "^24.7.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "@types/yargs": "^12.0.9", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", - "jest-util": "^24.7.1", + "jest-util": "^24.8.0", "string-length": "^2.0.0" } }, @@ -4639,8 +4606,8 @@ }, "js-levenshtein": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", - "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "resolved": "https://registry.npm.taobao.org/js-levenshtein/download/js-levenshtein-1.1.6.tgz", + "integrity": "sha1-xs7ljrNVA3LfjeuF+tXOZs4B1Z0=", "dev": true }, "js-tokens": { @@ -4651,8 +4618,8 @@ }, "js-yaml": { "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "resolved": "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.13.1.tgz", + "integrity": "sha1-r/FRswv9+o5J4F2iLnQV6d+jeEc=", "dev": true, "requires": { "argparse": "^1.0.7", @@ -4667,8 +4634,8 @@ }, "jsdom": { "version": "11.12.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "resolved": "https://registry.npm.taobao.org/jsdom/download/jsdom-11.12.0.tgz", + "integrity": "sha1-GoDUDd03ih3lllbp5txaO6hle8g=", "dev": true, "requires": { "abab": "^2.0.0", @@ -4701,28 +4668,28 @@ "dependencies": { "acorn": { "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "resolved": "https://registry.npm.taobao.org/acorn/download/acorn-5.7.3.tgz", + "integrity": "sha1-Z6ojG/iBKXS4UjWpZ3Hra9B+onk=", "dev": true }, "parse5": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "resolved": "https://registry.npm.taobao.org/parse5/download/parse5-4.0.0.tgz", + "integrity": "sha1-bXhlbj2o14tOwLkG98CO8d/j9gg=", "dev": true } } }, "jsesc": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "resolved": "https://registry.npm.taobao.org/jsesc/download/jsesc-2.5.2.tgz", + "integrity": "sha1-gFZNLkg9rPbo7yCWUKZ98/DCg6Q=", "dev": true }, "json-parse-better-errors": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "resolved": "https://registry.npm.taobao.org/json-parse-better-errors/download/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha1-u4Z8+zRQ5pEHwTHRxRS6s9yLyqk=", "dev": true }, "json-schema": { @@ -4733,8 +4700,8 @@ }, "json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz", + "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", "dev": true }, "json-stringify-safe": { @@ -4745,8 +4712,8 @@ }, "json5": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "resolved": "https://registry.npm.taobao.org/json5/download/json5-2.1.0.tgz", + "integrity": "sha1-56DGLEgoXGKNIKELhcibuAfDKFA=", "dev": true, "requires": { "minimist": "^1.2.0" @@ -4781,14 +4748,14 @@ }, "kleur": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "resolved": "https://registry.npm.taobao.org/kleur/download/kleur-3.0.3.tgz", + "integrity": "sha1-p5yezIbuHOP6YgbRIWxQHxR/wH4=", "dev": true }, "lcid": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "resolved": "https://registry.npm.taobao.org/lcid/download/lcid-2.0.0.tgz", + "integrity": "sha1-bvXS32DlL4LrIopMNz6NHzlyU88=", "dev": true, "requires": { "invert-kv": "^2.0.0" @@ -4796,8 +4763,8 @@ }, "left-pad": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "resolved": "https://registry.npm.taobao.org/left-pad/download/left-pad-1.3.0.tgz", + "integrity": "sha1-W4o6d2Xf4AEmHd6RVYnngvjJTR4=", "dev": true }, "leven": { @@ -4830,8 +4797,8 @@ }, "locate-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz", + "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -4840,8 +4807,8 @@ }, "lodash": { "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.11.tgz", + "integrity": "sha1-s56mIp72B+zYniyN8SU2iRysm40=", "dev": true }, "lodash.escape": { @@ -4870,8 +4837,8 @@ }, "loose-envify": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "resolved": "https://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz", + "integrity": "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=", "dev": true, "requires": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -4879,8 +4846,8 @@ }, "make-dir": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-2.1.0.tgz", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { "pify": "^4.0.1", @@ -4889,8 +4856,8 @@ "dependencies": { "pify": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-4.0.1.tgz", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true } } @@ -4906,8 +4873,8 @@ }, "map-age-cleaner": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "resolved": "https://registry.npm.taobao.org/map-age-cleaner/download/map-age-cleaner-0.1.3.tgz", + "integrity": "sha1-fVg6cwZDTAVf5HSw9FB45uG0uSo=", "dev": true, "requires": { "p-defer": "^1.0.0" @@ -4930,8 +4897,8 @@ }, "mem": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "resolved": "https://registry.npm.taobao.org/mem/download/mem-4.3.0.tgz", + "integrity": "sha1-Rhr0l7xK4JYIzbLmDu+2m/90QXg=", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", @@ -4971,14 +4938,14 @@ }, "mime-db": { "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.40.0.tgz", + "integrity": "sha1-plBX6ZjbCQ9zKmj2wnbTh9QSbDI=", "dev": true }, "mime-types": { "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.24.tgz", + "integrity": "sha1-tvjQs+lR77d97eyhlM/20W9nb4E=", "dev": true, "requires": { "mime-db": "1.40.0" @@ -4986,14 +4953,14 @@ }, "mimic-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "resolved": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-2.1.0.tgz", + "integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=", "dev": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "resolved": "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -5045,8 +5012,8 @@ }, "moo": { "version": "0.4.3", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.4.3.tgz", - "integrity": "sha512-gFD2xGCl8YFgGHsqJ9NKRVdwlioeW3mI1iqfLNYQOv0+6JRwG58Zk9DIGQgyIaffSYaO1xsKnMaYzzNr1KyIAw==", + "resolved": "https://registry.npm.taobao.org/moo/download/moo-0.4.3.tgz", + "integrity": "sha1-P4R6JvMc9iWpVqh/KxD7wBO/0Q4=", "dev": true }, "ms": { @@ -5057,8 +5024,8 @@ }, "nan": { "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "resolved": "https://registry.npm.taobao.org/nan/download/nan-2.14.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnan%2Fdownload%2Fnan-2.14.0.tgz", + "integrity": "sha1-eBj3IgJ7JFmobwKV1DTR/CM2xSw=", "dev": true, "optional": true }, @@ -5089,8 +5056,8 @@ }, "nearley": { "version": "2.16.0", - "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.16.0.tgz", - "integrity": "sha512-Tr9XD3Vt/EujXbZBv6UAHYoLUSMQAxSsTnm9K3koXzjzNWY195NqALeyrzLZBKzAkL3gl92BcSogqrHjD8QuUg==", + "resolved": "https://registry.npm.taobao.org/nearley/download/nearley-2.16.0.tgz", + "integrity": "sha1-d8KX0EGUHSaCkOyEtznQ7il+g6c=", "dev": true, "requires": { "commander": "^2.19.0", @@ -5101,15 +5068,15 @@ } }, "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "version": "2.6.1", + "resolved": "https://registry.npm.taobao.org/neo-async/download/neo-async-2.6.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fneo-async%2Fdownload%2Fneo-async-2.6.1.tgz", + "integrity": "sha1-rCetpmFn+ohJpq3dg39rGJrSCBw=", "dev": true }, "nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "resolved": "https://registry.npm.taobao.org/nice-try/download/nice-try-1.0.5.tgz", + "integrity": "sha1-ozeKdpbOfSI+iPybdkvX7xCJ42Y=", "dev": true }, "node-int64": { @@ -5126,8 +5093,8 @@ }, "node-notifier": { "version": "5.4.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.0.tgz", - "integrity": "sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ==", + "resolved": "https://registry.npm.taobao.org/node-notifier/download/node-notifier-5.4.0.tgz", + "integrity": "sha1-e0Vf3On33gxjU4KXNU89tGhCbmo=", "dev": true, "requires": { "growly": "^1.3.0", @@ -5138,9 +5105,9 @@ } }, "node-releases": { - "version": "1.1.17", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.17.tgz", - "integrity": "sha512-/SCjetyta1m7YXLgtACZGDYJdCSIBAWorDWkGCGZlydP2Ll7J48l7j/JxNYZ+xsgSPbWfdulVS/aY+GdjUsQ7Q==", + "version": "1.1.23", + "resolved": "https://registry.npm.taobao.org/node-releases/download/node-releases-1.1.23.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-releases%2Fdownload%2Fnode-releases-1.1.23.tgz", + "integrity": "sha1-3nQJ9y3gRKL6WcCX9Da6icOZl/A=", "dev": true, "requires": { "semver": "^5.3.0" @@ -5148,8 +5115,8 @@ }, "normalize-package-data": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "resolved": "https://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.5.0.tgz", + "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -5178,8 +5145,8 @@ }, "nth-check": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "resolved": "https://registry.npm.taobao.org/nth-check/download/nth-check-1.0.2.tgz", + "integrity": "sha1-sr0pXDfj3VijvwcAN2Zjuk2c8Fw=", "dev": true, "requires": { "boolbase": "~1.0.0" @@ -5192,15 +5159,15 @@ "dev": true }, "nwsapi": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.3.tgz", - "integrity": "sha512-RowAaJGEgYXEZfQ7tvvdtAQUKPyTR6T6wNu0fwlNsGQYr/h3yQc6oI8WnVZh3Y/Sylwc+dtAlvPqfFZjhTyk3A==", + "version": "2.1.4", + "resolved": "https://registry.npm.taobao.org/nwsapi/download/nwsapi-2.1.4.tgz", + "integrity": "sha1-4AaoeNsjY2+OimfTPKDk7fYahC8=", "dev": true }, "oauth-sign": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", + "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=", "dev": true }, "object-assign": { @@ -5242,8 +5209,8 @@ }, "object-inspect": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "resolved": "https://registry.npm.taobao.org/object-inspect/download/object-inspect-1.6.0.tgz", + "integrity": "sha1-xwtsv3LydKq0w0wMgvUWe/gs8Vs=", "dev": true }, "object-is": { @@ -5254,8 +5221,8 @@ }, "object-keys": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz", + "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=", "dev": true }, "object-visit": { @@ -5269,8 +5236,8 @@ }, "object.assign": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.0.tgz", + "integrity": "sha1-lovxEA15Vrs8oIbwBvhGs7xACNo=", "dev": true, "requires": { "define-properties": "^1.1.2", @@ -5281,8 +5248,8 @@ }, "object.entries": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz", - "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==", + "resolved": "https://registry.npm.taobao.org/object.entries/download/object.entries-1.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.entries%2Fdownload%2Fobject.entries-1.1.0.tgz", + "integrity": "sha1-ICT8bWuiRq7ji9sP/Vz7zzcbdRk=", "dev": true, "requires": { "define-properties": "^1.1.3", @@ -5293,8 +5260,8 @@ }, "object.fromentries": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", - "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", + "resolved": "https://registry.npm.taobao.org/object.fromentries/download/object.fromentries-2.0.0.tgz", + "integrity": "sha1-SaVD2SFR+Cd7OslgDx6TCxidMKs=", "dev": true, "requires": { "define-properties": "^1.1.2", @@ -5324,8 +5291,8 @@ }, "object.values": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", - "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "resolved": "https://registry.npm.taobao.org/object.values/download/object.values-1.1.0.tgz", + "integrity": "sha1-v2gQ712j5TJXkOqqK+IT6oRiTak=", "dev": true, "requires": { "define-properties": "^1.1.3", @@ -5385,8 +5352,8 @@ }, "os-locale": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "resolved": "https://registry.npm.taobao.org/os-locale/download/os-locale-3.1.0.tgz", + "integrity": "sha1-qAKm7hfyTBBIOrmTVxnO9O0Wvxo=", "dev": true, "requires": { "execa": "^1.0.0", @@ -5417,14 +5384,14 @@ }, "p-is-promise": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "resolved": "https://registry.npm.taobao.org/p-is-promise/download/p-is-promise-2.1.0.tgz", + "integrity": "sha1-kYzrrqJIpiz3/6uOO8qMX4gvxC4=", "dev": true }, "p-limit": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.2.0.tgz", + "integrity": "sha1-QXyZQeYCepq8ulCS3SkE4lW1+8I=", "dev": true, "requires": { "p-try": "^2.0.0" @@ -5432,8 +5399,8 @@ }, "p-locate": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-3.0.0.tgz", + "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", "dev": true, "requires": { "p-limit": "^2.0.0" @@ -5447,8 +5414,8 @@ }, "p-try": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, "parse-json": { @@ -5463,8 +5430,8 @@ }, "parse5": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", - "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", + "resolved": "https://registry.npm.taobao.org/parse5/download/parse5-3.0.3.tgz", + "integrity": "sha1-BC95L/3TaFFVHPTp4Gazh0q0W1w=", "dev": true, "requires": { "@types/node": "*" @@ -5496,14 +5463,14 @@ }, "path-parse": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "resolved": "https://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz", + "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", "dev": true }, "path-type": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "resolved": "https://registry.npm.taobao.org/path-type/download/path-type-3.0.0.tgz", + "integrity": "sha1-zvMdyOCho7sNEFwM2Xzzv0f0428=", "dev": true, "requires": { "pify": "^3.0.0" @@ -5523,8 +5490,8 @@ }, "pirates": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "resolved": "https://registry.npm.taobao.org/pirates/download/pirates-4.0.1.tgz", + "integrity": "sha1-ZDqSyviUVm+RsrmG0sZpUKji+4c=", "dev": true, "requires": { "node-modules-regexp": "^1.0.0" @@ -5532,8 +5499,8 @@ }, "pkg-dir": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-3.0.0.tgz", + "integrity": "sha1-J0kCDyOe2ZCIGx9xIQ1R62UjvqM=", "dev": true, "requires": { "find-up": "^3.0.0" @@ -5569,8 +5536,8 @@ }, "p-limit": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-1.3.0.tgz", + "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", "dev": true, "requires": { "p-try": "^1.0.0" @@ -5595,8 +5562,8 @@ }, "pn": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "resolved": "https://registry.npm.taobao.org/pn/download/pn-1.1.0.tgz", + "integrity": "sha1-4vTO8OIZ9GPBeas3Rj5OHs3Muvs=", "dev": true }, "posix-character-classes": { @@ -5612,12 +5579,12 @@ "dev": true }, "pretty-format": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.7.0.tgz", - "integrity": "sha512-apen5cjf/U4dj7tHetpC7UEFCvtAgnNZnBDkfPv3fokzIqyOJckAG9OlAPC1BlFALnqT/lGB2tl9EJjlK6eCsA==", + "version": "24.8.0", + "resolved": "https://registry.npm.taobao.org/pretty-format/download/pretty-format-24.8.0.tgz", + "integrity": "sha1-ja5wRPWNt8uL4kU4O1Zalj48J/I=", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.8.0", "ansi-regex": "^4.0.0", "ansi-styles": "^3.2.0", "react-is": "^16.8.4" @@ -5625,8 +5592,8 @@ }, "private": { "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "resolved": "https://registry.npm.taobao.org/private/download/private-0.1.8.tgz", + "integrity": "sha1-I4Hts2ifelPWUxkAYPz4ItLzaP8=", "dev": true }, "process-nextick-args": { @@ -5636,9 +5603,9 @@ "dev": true }, "prompts": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.4.tgz", - "integrity": "sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA==", + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/prompts/download/prompts-2.1.0.tgz", + "integrity": "sha1-v5C8cfYGXSVeor3A/mUgSFwbRds=", "dev": true, "requires": { "kleur": "^3.0.2", @@ -5647,8 +5614,8 @@ }, "prop-types": { "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "resolved": "https://registry.npm.taobao.org/prop-types/download/prop-types-15.7.2.tgz", + "integrity": "sha1-UsQedbjIfnK52TYOAga5ncv/psU=", "dev": true, "requires": { "loose-envify": "^1.4.0", @@ -5658,8 +5625,8 @@ }, "prop-types-exact": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/prop-types-exact/-/prop-types-exact-1.2.0.tgz", - "integrity": "sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==", + "resolved": "https://registry.npm.taobao.org/prop-types-exact/download/prop-types-exact-1.2.0.tgz", + "integrity": "sha1-gl1r5GCUZjhII345JamMbpROmGk=", "dev": true, "requires": { "has": "^1.0.3", @@ -5668,15 +5635,15 @@ } }, "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", + "version": "1.1.32", + "resolved": "https://registry.npm.taobao.org/psl/download/psl-1.1.32.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpsl%2Fdownload%2Fpsl-1.1.32.tgz", + "integrity": "sha1-PxMnF88vnBaXJLK2yvNzz2lBmNs=", "dev": true }, "pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "resolved": "https://registry.npm.taobao.org/pump/download/pump-3.0.0.tgz", + "integrity": "sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ=", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -5685,20 +5652,20 @@ }, "punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz", + "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", "dev": true }, "qs": { "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz", + "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=", "dev": true }, "raf": { "version": "3.4.1", - "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", - "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "resolved": "https://registry.npm.taobao.org/raf/download/raf-3.4.1.tgz", + "integrity": "sha1-B0LpmkplUvRF1z4+4DKK8P8e3jk=", "dev": true, "requires": { "performance-now": "^2.1.0" @@ -5712,8 +5679,8 @@ }, "randexp": { "version": "0.4.6", - "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", - "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", + "resolved": "https://registry.npm.taobao.org/randexp/download/randexp-0.4.6.tgz", + "integrity": "sha1-6YatXl4x2uE93W97MBmqfIf2DKM=", "dev": true, "requires": { "discontinuous-range": "1.0.0", @@ -5722,8 +5689,8 @@ }, "react": { "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react/-/react-16.8.3.tgz", - "integrity": "sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA==", + "resolved": "https://registry.npm.taobao.org/react/download/react-16.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact%2Fdownload%2Freact-16.8.3.tgz", + "integrity": "sha1-xvmIos6JU3XeIW7c+u3WuadkUdk=", "dev": true, "requires": { "loose-envify": "^1.1.0", @@ -5734,8 +5701,8 @@ }, "react-dom": { "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.3.tgz", - "integrity": "sha512-ttMem9yJL4/lpItZAQ2NTFAbV7frotHk5DZEHXUOws2rMmrsvh1Na7ThGT0dTzUIl6pqTOi5tYREfL8AEna3lA==", + "resolved": "https://registry.npm.taobao.org/react-dom/download/react-dom-16.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact-dom%2Fdownload%2Freact-dom-16.8.3.tgz", + "integrity": "sha1-riNgKeZiEHg6yBmZ0wFd/EdbnDI=", "dev": true, "requires": { "loose-envify": "^1.1.0", @@ -5746,14 +5713,14 @@ }, "react-is": { "version": "16.8.6", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", - "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "resolved": "https://registry.npm.taobao.org/react-is/download/react-is-16.8.6.tgz", + "integrity": "sha1-W7weLSkUHJ+9/tRWND/ivEMKahY=", "dev": true }, "react-test-renderer": { "version": "16.8.6", - "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.8.6.tgz", - "integrity": "sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw==", + "resolved": "https://registry.npm.taobao.org/react-test-renderer/download/react-test-renderer-16.8.6.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact-test-renderer%2Fdownload%2Freact-test-renderer-16.8.6.tgz", + "integrity": "sha1-GI2AKbjDnHhvmYqj79P/52QtW6E=", "dev": true, "requires": { "object-assign": "^4.1.1", @@ -5775,8 +5742,8 @@ }, "read-pkg-up": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "resolved": "https://registry.npm.taobao.org/read-pkg-up/download/read-pkg-up-4.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fread-pkg-up%2Fdownload%2Fread-pkg-up-4.0.0.tgz", + "integrity": "sha1-GyIcYIi6d5lgHICPkRYcZuWPiXg=", "dev": true, "requires": { "find-up": "^3.0.0", @@ -5800,8 +5767,8 @@ }, "realpath-native": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", - "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==", + "resolved": "https://registry.npm.taobao.org/realpath-native/download/realpath-native-1.1.0.tgz", + "integrity": "sha1-IAMpT+oj+wZy8kduviL89Jii1lw=", "dev": true, "requires": { "util.promisify": "^1.0.0" @@ -5815,14 +5782,14 @@ }, "regenerate": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "resolved": "https://registry.npm.taobao.org/regenerate/download/regenerate-1.4.0.tgz", + "integrity": "sha1-SoVuxLVuQHfFV1icroXnpMiGmhE=", "dev": true }, "regenerate-unicode-properties": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz", - "integrity": "sha512-SbA/iNrBUf6Pv2zU8Ekv1Qbhv92yxL4hiDa2siuxs4KKn4oOoMDHXjAf7+Nz9qinUQ46B1LcWEi/PhJfPWpZWQ==", + "version": "8.1.0", + "resolved": "https://registry.npm.taobao.org/regenerate-unicode-properties/download/regenerate-unicode-properties-8.1.0.tgz", + "integrity": "sha1-71Hg8OpK1CS3e/fLQfPgFccKPw4=", "dev": true, "requires": { "regenerate": "^1.4.0" @@ -5830,14 +5797,14 @@ }, "regenerator-runtime": { "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.12.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.12.1.tgz", + "integrity": "sha1-+hpxVEdkwDb4xJsToIsllMn4oN4=", "dev": true }, "regenerator-transform": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", - "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", + "version": "0.14.0", + "resolved": "https://registry.npm.taobao.org/regenerator-transform/download/regenerator-transform-0.14.0.tgz", + "integrity": "sha1-LKmq96LCOd0y5HYSGEJbjHqG7K8=", "dev": true, "requires": { "private": "^0.1.6" @@ -5854,15 +5821,15 @@ } }, "regexp-tree": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.5.tgz", - "integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==", + "version": "0.1.10", + "resolved": "https://registry.npm.taobao.org/regexp-tree/download/regexp-tree-0.1.10.tgz", + "integrity": "sha1-2DeBagOcevio1k16fDz2odk0ULw=", "dev": true }, "regexpu-core": { "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "resolved": "https://registry.npm.taobao.org/regexpu-core/download/regexpu-core-4.5.4.tgz", + "integrity": "sha1-CA2dAiiaqH/hZnpPUTa8mKauuq4=", "dev": true, "requires": { "regenerate": "^1.4.0", @@ -5875,14 +5842,14 @@ }, "regjsgen": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", - "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", + "resolved": "https://registry.npm.taobao.org/regjsgen/download/regjsgen-0.5.0.tgz", + "integrity": "sha1-p2NNwI+JIJwgSa3aNSVxH7lyZd0=", "dev": true }, "regjsparser": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "resolved": "https://registry.npm.taobao.org/regjsparser/download/regjsparser-0.6.0.tgz", + "integrity": "sha1-8eaui32iuulsmTmbhozWyTOiupw=", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -5916,8 +5883,8 @@ }, "request": { "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.0.tgz", + "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -5950,8 +5917,8 @@ }, "tough-cookie": { "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.4.3.tgz", + "integrity": "sha1-U/Nto/R3g7CSWvoG/587FlKA94E=", "dev": true, "requires": { "psl": "^1.1.24", @@ -5962,8 +5929,8 @@ }, "request-promise-core": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", - "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", + "resolved": "https://registry.npm.taobao.org/request-promise-core/download/request-promise-core-1.1.2.tgz", + "integrity": "sha1-M59qq6vK/bMceZ/xWHADNjAdM0Y=", "dev": true, "requires": { "lodash": "^4.17.11" @@ -5971,8 +5938,8 @@ }, "request-promise-native": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", - "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", + "resolved": "https://registry.npm.taobao.org/request-promise-native/download/request-promise-native-1.0.7.tgz", + "integrity": "sha1-pJhopiS96lBp8SUdCoNuDYmqLFk=", "dev": true, "requires": { "request-promise-core": "1.1.2", @@ -5988,8 +5955,8 @@ }, "require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "resolved": "https://registry.npm.taobao.org/require-main-filename/download/require-main-filename-2.0.0.tgz", + "integrity": "sha1-0LMp7MfMD2Fkn2IhW+aa9UqomJs=", "dev": true }, "reselect": { @@ -5999,9 +5966,9 @@ "dev": true }, "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "version": "1.11.1", + "resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.11.1.tgz?cache=0&sync_timestamp=1559589332035&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.11.1.tgz", + "integrity": "sha1-6hDYEQN2mC/vV434/DC5rDCgej4=", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -6036,21 +6003,21 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-2.6.3.tgz", + "integrity": "sha1-stEE/g2Psnz54KHNqCYt04M8bKs=", "dev": true, "requires": { "glob": "^7.1.3" } }, "rollup": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.10.1.tgz", - "integrity": "sha512-pW353tmBE7QP622ITkGxtqF0d5gSRCVPD9xqM+fcPjudeZfoXMFW2sCzsTe2TU/zU1xamIjiS9xuFCPVT9fESw==", + "version": "1.14.4", + "resolved": "https://registry.npm.taobao.org/rollup/download/rollup-1.14.4.tgz", + "integrity": "sha1-+a948ULoxYUeM5K9pIjfSJGBrGA=", "dev": true, "requires": { "@types/estree": "0.0.39", - "@types/node": "^11.13.5", + "@types/node": "^12.0.3", "acorn": "^6.1.1" } }, @@ -6064,9 +6031,9 @@ } }, "rollup-plugin-node-resolve": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.3.tgz", - "integrity": "sha512-r+WaesPzdGEynpLZLALFEDugA4ACa5zn7bc/+LVX4vAXQQ8IgDHv0xfsSvJ8tDXUtprfBtrDtRFg27ifKjcJTg==", + "version": "4.2.4", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-node-resolve/download/rollup-plugin-node-resolve-4.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup-plugin-node-resolve%2Fdownload%2Frollup-plugin-node-resolve-4.2.4.tgz", + "integrity": "sha1-fTcPjW/TAxAGoAMsOCYt2b48YlA=", "dev": true, "requires": { "@types/resolve": "0.0.8", @@ -6076,25 +6043,24 @@ } }, "rollup-plugin-typescript2": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.21.0.tgz", - "integrity": "sha512-fbUAc2bvWxRrg1GGMYCFVf6aSxq3zvWn0sY2ubzFW9shJNT95ztFbM6GHO4/2rDSCjier7IswQnbr1ySqoLNPw==", + "version": "0.21.1", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-typescript2/download/rollup-plugin-typescript2-0.21.1.tgz", + "integrity": "sha1-kc6nh8UoJ2L0hJ4zTL72qf2qdWQ=", "dev": true, "requires": { "fs-extra": "7.0.1", - "resolve": "1.10.0", - "rollup-pluginutils": "2.4.1", + "resolve": "1.10.1", + "rollup-pluginutils": "2.6.0", "tslib": "1.9.3" }, "dependencies": { - "rollup-pluginutils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz", - "integrity": "sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==", + "resolve": { + "version": "1.10.1", + "resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.10.1.tgz?cache=0&sync_timestamp=1559589332035&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.10.1.tgz", + "integrity": "sha1-ZkhCrJYHlbvnWCIc3M2mH7ZLXxg=", "dev": true, "requires": { - "estree-walker": "^0.6.0", - "micromatch": "^3.1.10" + "path-parse": "^1.0.6" } } } @@ -6132,9 +6098,9 @@ } }, "rsvp": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.4.tgz", - "integrity": "sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA==", + "version": "4.8.5", + "resolved": "https://registry.npm.taobao.org/rsvp/download/rsvp-4.8.5.tgz", + "integrity": "sha1-yPFVMR0Wf2jyHhaN9x7FsIMRNzQ=", "dev": true }, "safe-buffer": { @@ -6154,14 +6120,14 @@ }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsafer-buffer%2Fdownload%2Fsafer-buffer-2.1.2.tgz", + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", "dev": true }, "sane": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", + "resolved": "https://registry.npm.taobao.org/sane/download/sane-4.1.0.tgz", + "integrity": "sha1-7Ygf2SJzOmxGG8GJ3CtsAG8//e0=", "dev": true, "requires": { "@cnakazawa/watch": "^1.0.3", @@ -6177,14 +6143,14 @@ }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "resolved": "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz", + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", "dev": true }, "scheduler": { "version": "0.13.6", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", - "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", + "resolved": "https://registry.npm.taobao.org/scheduler/download/scheduler-0.13.6.tgz", + "integrity": "sha1-RmpOwzJGezGpG5v3TlNHBy5M2Ik=", "dev": true, "requires": { "loose-envify": "^1.1.0", @@ -6193,8 +6159,8 @@ }, "semver": { "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.0.tgz", + "integrity": "sha1-eQp89v6lRZuslhELKbYEEtyP+Ws=", "dev": true }, "serialize-javascript": { @@ -6249,8 +6215,8 @@ }, "shellwords": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "resolved": "https://registry.npm.taobao.org/shellwords/download/shellwords-0.1.1.tgz", + "integrity": "sha1-1rkYHBpI05cyTISHHvvPxz/AZUs=", "dev": true }, "signal-exit": { @@ -6261,20 +6227,20 @@ }, "sisteransi": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.0.tgz", - "integrity": "sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ==", + "resolved": "https://registry.npm.taobao.org/sisteransi/download/sisteransi-1.0.0.tgz", + "integrity": "sha1-d9liL/kJCA8cGeX0od8MGwonuIw=", "dev": true }, "slash": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-2.0.0.tgz", + "integrity": "sha1-3lUoUaF1nfOo8gZTVEL17E3eq0Q=", "dev": true }, "slash2": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash2/-/slash2-2.0.0.tgz", - "integrity": "sha512-7ElvBydJPi3MHU/KEOblFSbO/skl4Z69jKkFCpYIYVOMSIZsKi4gYU43HGeZPmjxCXrHekoDAAewphPQNnsqtA==", + "resolved": "https://registry.npm.taobao.org/slash2/download/slash2-2.0.0.tgz", + "integrity": "sha1-9OChFwi4VFuRJpWYHPcJb1LGNIc=", "dev": true }, "snapdragon": { @@ -6405,8 +6371,8 @@ }, "source-map-support": { "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "resolved": "https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.12.tgz", + "integrity": "sha1-tPOxDVGFelrwE4086AA7IBYT1Zk=", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -6415,8 +6381,8 @@ "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } @@ -6429,8 +6395,8 @@ }, "spdx-correct": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "resolved": "https://registry.npm.taobao.org/spdx-correct/download/spdx-correct-3.1.0.tgz", + "integrity": "sha1-+4PlBERSaPFUsHTiGMh8ADzTHfQ=", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -6439,14 +6405,14 @@ }, "spdx-exceptions": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "resolved": "https://registry.npm.taobao.org/spdx-exceptions/download/spdx-exceptions-2.2.0.tgz", + "integrity": "sha1-LqRQrudPKom/uUUZwH/Nb0EyKXc=", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "resolved": "https://registry.npm.taobao.org/spdx-expression-parse/download/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -6455,8 +6421,8 @@ }, "spdx-license-ids": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "resolved": "https://registry.npm.taobao.org/spdx-license-ids/download/spdx-license-ids-3.0.4.tgz", + "integrity": "sha1-dezRqI3owYTvAV6vtRtbSL/RG7E=", "dev": true }, "split-string": { @@ -6476,8 +6442,8 @@ }, "sshpk": { "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz", + "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=", "dev": true, "requires": { "asn1": "~0.2.3", @@ -6493,8 +6459,8 @@ }, "stack-utils": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", - "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", + "resolved": "https://registry.npm.taobao.org/stack-utils/download/stack-utils-1.0.2.tgz", + "integrity": "sha1-M+ujiXeIVYvr/C2wWdwVjsNs67g=", "dev": true }, "static-extend": { @@ -6553,8 +6519,8 @@ }, "string-width": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -6600,8 +6566,8 @@ }, "strip-ansi": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz", + "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", "dev": true, "requires": { "ansi-regex": "^4.1.0" @@ -6635,9 +6601,9 @@ "dev": true }, "test-exclude": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.2.tgz", - "integrity": "sha512-N2pvaLpT8guUpb5Fe1GJlmvmzH3x+DAKmmyEQmFP792QcLYoGE1syxztSvPD1V8yPe6VrcCt6YGQVjSRjCASsA==", + "version": "5.2.3", + "resolved": "https://registry.npm.taobao.org/test-exclude/download/test-exclude-5.2.3.tgz", + "integrity": "sha1-w9Ph4xHrfuQF4JLawQrv0JCR6sA=", "dev": true, "requires": { "glob": "^7.1.3", @@ -6708,8 +6674,8 @@ }, "tough-cookie": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz", + "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=", "dev": true, "requires": { "psl": "^1.1.28", @@ -6733,8 +6699,8 @@ }, "tslib": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "resolved": "https://registry.npm.taobao.org/tslib/download/tslib-1.9.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.9.3.tgz", + "integrity": "sha1-1+TdeSRdhUKMTX5IIqeZF5VMooY=", "dev": true }, "tunnel-agent": { @@ -6762,9 +6728,9 @@ } }, "typescript": { - "version": "3.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz", - "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==", + "version": "3.5.1", + "resolved": "https://registry.npm.taobao.org/typescript/download/typescript-3.5.1.tgz", + "integrity": "sha1-unKmpgCyFYE5xd2IUPcA4jFGQgI=", "dev": true }, "uglify-js": { @@ -6786,9 +6752,9 @@ } }, "umi-test": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/umi-test/-/umi-test-1.5.6.tgz", - "integrity": "sha512-Tz+EsBdb05N/ohsCo/bZ1j/c9OiJUkcvuqZfHUwWLgAzPz8VvGKAnmYD+7w72Viea+JTlSJptYNulIB7JXMxxg==", + "version": "1.5.10", + "resolved": "https://registry.npm.taobao.org/umi-test/download/umi-test-1.5.10.tgz", + "integrity": "sha1-sy69asKh3xZ4Y7g/a56v1UJT+Hg=", "dev": true, "requires": { "@babel/core": "7.2.2", @@ -6797,7 +6763,7 @@ "babel-core": "7.0.0-bridge.0", "babel-jest": "24.1.0", "babel-plugin-module-resolver": "3.1.1", - "babel-preset-umi": "1.4.1", + "babel-preset-umi": "1.5.0", "debug": "4.1.1", "enzyme": "3.9.0", "enzyme-adapter-react-16": "1.9.1", @@ -6808,37 +6774,37 @@ "react": "16.8.3", "react-dom": "16.8.3", "typescript": "3.3.3", - "umi-utils": "1.4.1", + "umi-utils": "1.4.4", "yargs-parser": "13.0.0" }, "dependencies": { "debug": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", "dev": true, "requires": { "ms": "^2.1.1" } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", "dev": true }, "typescript": { "version": "3.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3.tgz", - "integrity": "sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==", + "resolved": "https://registry.npm.taobao.org/typescript/download/typescript-3.3.3.tgz", + "integrity": "sha1-8WV/x9qifhqJMHWKzpro2jFAMiE=", "dev": true } } }, "umi-utils": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/umi-utils/-/umi-utils-1.4.1.tgz", - "integrity": "sha512-cPuNqDkD3Evjc8K2q+xAWoklN2CGFlxygc7NFJ9wSk8BkFNZ/TwVpm3AEKTr42BLy+zW6VHz2ewiegdomUxouw==", + "version": "1.4.4", + "resolved": "https://registry.npm.taobao.org/umi-utils/download/umi-utils-1.4.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fumi-utils%2Fdownload%2Fumi-utils-1.4.4.tgz", + "integrity": "sha1-BpCP6KsUMY3EaL+vx6C0RGGtUxg=", "dev": true, "requires": { "is-url": "1.2.4", @@ -6847,14 +6813,14 @@ }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "resolved": "https://registry.npm.taobao.org/unicode-canonical-property-names-ecmascript/download/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha1-JhmADEyCWADv3YNDr33Zkzy+KBg=", "dev": true }, "unicode-match-property-ecmascript": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "resolved": "https://registry.npm.taobao.org/unicode-match-property-ecmascript/download/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha1-jtKjJWmWG86SJ9Cc0/+7j+1fAgw=", "dev": true, "requires": { "unicode-canonical-property-names-ecmascript": "^1.0.4", @@ -6863,14 +6829,14 @@ }, "unicode-match-property-value-ecmascript": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", - "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "resolved": "https://registry.npm.taobao.org/unicode-match-property-value-ecmascript/download/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha1-W0tCbgjROoA2Xg1lesemwexGonc=", "dev": true }, "unicode-property-aliases-ecmascript": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", - "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "resolved": "https://registry.npm.taobao.org/unicode-property-aliases-ecmascript/download/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha1-qcxsx85joKMCP8meNBuUQx1AWlc=", "dev": true }, "union-value": { @@ -6910,8 +6876,8 @@ }, "universalify": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz", + "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", "dev": true }, "unset-value": { @@ -6956,8 +6922,8 @@ }, "uri-js": { "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz", + "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", "dev": true, "requires": { "punycode": "^2.1.0" @@ -6983,8 +6949,8 @@ }, "util.promisify": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "resolved": "https://registry.npm.taobao.org/util.promisify/download/util.promisify-1.0.0.tgz", + "integrity": "sha1-RA9xZaRZyaFtwUXrjnLzVocJcDA=", "dev": true, "requires": { "define-properties": "^1.1.2", @@ -6993,14 +6959,14 @@ }, "uuid": { "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.3.2.tgz", + "integrity": "sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=", "dev": true }, "validate-npm-package-license": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "resolved": "https://registry.npm.taobao.org/validate-npm-package-license/download/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -7038,14 +7004,14 @@ }, "webidl-conversions": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "resolved": "https://registry.npm.taobao.org/webidl-conversions/download/webidl-conversions-4.0.2.tgz", + "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", "dev": true }, "whatwg-encoding": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "resolved": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz", + "integrity": "sha1-WrrPd3wyFmpR0IXWtPPn0nET3bA=", "dev": true, "requires": { "iconv-lite": "0.4.24" @@ -7053,14 +7019,14 @@ }, "whatwg-mimetype": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "resolved": "https://registry.npm.taobao.org/whatwg-mimetype/download/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha1-PUseAxLSB5h5+Cav8Y2+7KWWD78=", "dev": true }, "whatwg-url": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "resolved": "https://registry.npm.taobao.org/whatwg-url/download/whatwg-url-6.5.0.tgz", + "integrity": "sha1-8t8Cv/F2/WUHDfdK1cy7WhmZZag=", "dev": true, "requires": { "lodash.sortby": "^4.7.0", @@ -7070,8 +7036,8 @@ }, "which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "resolved": "https://registry.npm.taobao.org/which/download/which-1.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwhich%2Fdownload%2Fwhich-1.3.1.tgz", + "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", "dev": true, "requires": { "isexe": "^2.0.0" @@ -7144,8 +7110,8 @@ }, "write-file-atomic": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz", - "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==", + "resolved": "https://registry.npm.taobao.org/write-file-atomic/download/write-file-atomic-2.4.1.tgz", + "integrity": "sha1-0LBUY8GIroBDlv1asqNwBir4dSk=", "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -7155,8 +7121,8 @@ }, "ws": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "resolved": "https://registry.npm.taobao.org/ws/download/ws-5.2.2.tgz", + "integrity": "sha1-3/7xSGa46NyRM1glFNG++vlumA8=", "dev": true, "requires": { "async-limiter": "~1.0.0" @@ -7164,20 +7130,20 @@ }, "xml-name-validator": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "resolved": "https://registry.npm.taobao.org/xml-name-validator/download/xml-name-validator-3.0.0.tgz", + "integrity": "sha1-auc+Bt5NjG5H+fsYH3jWSK1FfGo=", "dev": true }, "y18n": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.0.tgz", + "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", "dev": true }, "yargs": { "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "resolved": "https://registry.npm.taobao.org/yargs/download/yargs-12.0.5.tgz", + "integrity": "sha1-BfWZe2CWR7ZPZrgeO0sQo2jnrRM=", "dev": true, "requires": { "cliui": "^4.0.0", @@ -7202,8 +7168,8 @@ }, "yargs-parser": { "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-11.1.1.tgz", + "integrity": "sha1-h5oIZZc7yp9rq1y987HGfsfTvPQ=", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -7214,8 +7180,8 @@ }, "yargs-parser": { "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-13.0.0.tgz", + "integrity": "sha1-P8RPPnaovbHMNgLoYBCGAuXM3os=", "dev": true, "requires": { "camelcase": "^5.0.0", diff --git a/package.json b/package.json index 3287f1a..0da79cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sval", - "version": "0.4.5", + "version": "0.4.6", "description": "A javascript interpreter written in javascript", "main": "dist/sval.js", "module": "dist/sval.js", @@ -36,13 +36,13 @@ "devDependencies": { "@types/acorn": "^4.0.5", "@types/estree": "0.0.39", - "@types/jest": "^24.0.11", - "rollup": "^1.10.1", + "@types/jest": "^24.0.13", + "rollup": "^1.14.4", "rollup-plugin-json": "^3.1.0", - "rollup-plugin-node-resolve": "^4.2.3", - "rollup-plugin-typescript2": "^0.21.0", + "rollup-plugin-node-resolve": "^4.2.4", + "rollup-plugin-typescript2": "^0.21.1", "rollup-plugin-uglify": "^6.0.2", - "typescript": "^3.4.4", - "umi-test": "^1.5.6" + "typescript": "^3.5.1", + "umi-test": "^1.5.10" } }