@babel/helpers
Advanced tools
Comparing version 8.0.0-alpha.11 to 8.0.0-alpha.12
@@ -45,3 +45,5 @@ export default function _asyncIterator(iterable) { | ||
var thr = this.s.return; | ||
if (thr === undefined) return Promise.reject(maybeError); | ||
if (thr === undefined) { | ||
return Promise.reject(maybeError); | ||
} | ||
return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); | ||
@@ -48,0 +50,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import getPrototypeOf from "getPrototypeOf"; | ||
import getPrototypeOf from "./getPrototypeOf.js"; | ||
import isNativeReflectConstruct from "./isNativeReflectConstruct.js"; | ||
import possibleConstructorReturn from "possibleConstructorReturn"; | ||
import possibleConstructorReturn from "./possibleConstructorReturn.js"; | ||
export default function _callSuper(_this, derived, args) { | ||
@@ -5,0 +5,0 @@ derived = getPrototypeOf(derived); |
@@ -1,2 +0,2 @@ | ||
import unsupportedIterableToArray from "unsupportedIterableToArray"; | ||
import unsupportedIterableToArray from "./unsupportedIterableToArray.js"; | ||
export default function _createForOfIteratorHelper(o, allowArrayLike) { | ||
@@ -12,5 +12,7 @@ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; | ||
n: function () { | ||
if (i >= o.length) return { | ||
done: true | ||
}; | ||
if (i >= o.length) { | ||
return { | ||
done: true | ||
}; | ||
} | ||
return { | ||
@@ -47,3 +49,5 @@ done: false, | ||
try { | ||
if (!normalCompletion && it.return != null) it.return(); | ||
if (!normalCompletion && it.return != null) { | ||
it.return(); | ||
} | ||
} finally { | ||
@@ -50,0 +54,0 @@ if (didErr) throw err; |
@@ -1,2 +0,2 @@ | ||
import unsupportedIterableToArray from "unsupportedIterableToArray"; | ||
import unsupportedIterableToArray from "./unsupportedIterableToArray.js"; | ||
export default function _createForOfIteratorHelperLoose(o, allowArrayLike) { | ||
@@ -9,5 +9,7 @@ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; | ||
return function () { | ||
if (i >= o.length) return { | ||
done: true | ||
}; | ||
if (i >= o.length) { | ||
return { | ||
done: true | ||
}; | ||
} | ||
return { | ||
@@ -14,0 +16,0 @@ done: false, |
@@ -1,2 +0,2 @@ | ||
import setPrototypeOf from "setPrototypeOf"; | ||
import setPrototypeOf from "./setPrototypeOf.js"; | ||
export default function _inherits(subClass, superClass) { | ||
@@ -3,0 +3,0 @@ if (typeof superClass !== "function" && superClass !== null) { |
@@ -1,2 +0,2 @@ | ||
import setPrototypeOf from "setPrototypeOf"; | ||
import setPrototypeOf from "./setPrototypeOf.js"; | ||
export default function _inheritsLoose(subClass, superClass) { | ||
@@ -3,0 +3,0 @@ subClass.prototype = Object.create(superClass.prototype); |
export default function _isNativeFunction(fn) { | ||
try { | ||
return Function.toString.call(fn).indexOf("[native code]") !== -1; | ||
} catch (e) { | ||
} catch (_e) { | ||
return typeof fn === "function"; | ||
@@ -6,0 +6,0 @@ } |
export default function _isNativeReflectConstruct() { | ||
try { | ||
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
} catch (e) {} | ||
} catch (_) {} | ||
return (_isNativeReflectConstruct = function () { | ||
@@ -6,0 +6,0 @@ return !!result; |
@@ -10,3 +10,3 @@ import objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose.js"; | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (excluded.includes(key)) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
@@ -13,0 +13,0 @@ target[key] = source[key]; |
@@ -6,3 +6,3 @@ export default function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (excluded.includes(key)) continue; | ||
target[key] = source[key]; | ||
@@ -9,0 +9,0 @@ } |
@@ -19,8 +19,20 @@ export default function _usingCtx() { | ||
} | ||
if (dispose == null) { | ||
if (dispose === undefined) { | ||
dispose = value[Symbol.dispose || Symbol.for("Symbol.dispose")]; | ||
if (isAwait) { | ||
var inner = dispose; | ||
} | ||
} | ||
if (typeof dispose !== "function") { | ||
throw new TypeError(`Property [Symbol.dispose] is not a function.`); | ||
throw new TypeError("Object is not disposable."); | ||
} | ||
if (inner) { | ||
dispose = function () { | ||
try { | ||
inner.call(value); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
}; | ||
} | ||
stack.push({ | ||
@@ -44,11 +56,22 @@ v: value, | ||
d: function () { | ||
var error = this.e; | ||
var error = this.e, | ||
state = 0, | ||
resource; | ||
function next() { | ||
while (resource = stack.pop()) { | ||
try { | ||
var resource, | ||
disposalResult = resource.d && resource.d.call(resource.v); | ||
if (resource.a) { | ||
return Promise.resolve(disposalResult).then(next, err); | ||
if (!resource.a && state === 1) { | ||
state = 0; | ||
stack.push(resource); | ||
return Promise.resolve().then(next); | ||
} | ||
if (resource.d) { | ||
var disposalResult = resource.d.call(resource.v); | ||
if (resource.a) { | ||
state |= 2; | ||
return Promise.resolve(disposalResult).then(next, err); | ||
} | ||
} else { | ||
state |= 1; | ||
} | ||
} catch (e) { | ||
@@ -58,2 +81,9 @@ return err(e); | ||
} | ||
if (state === 1) { | ||
if (error !== empty) { | ||
return Promise.reject(error); | ||
} else { | ||
return Promise.resolve(); | ||
} | ||
} | ||
if (error !== empty) throw error; | ||
@@ -60,0 +90,0 @@ } |
@@ -1,5 +0,5 @@ | ||
import getPrototypeOf from "getPrototypeOf"; | ||
import setPrototypeOf from "setPrototypeOf"; | ||
import isNativeFunction from "isNativeFunction"; | ||
import construct from "construct"; | ||
import getPrototypeOf from "./getPrototypeOf.js"; | ||
import setPrototypeOf from "./setPrototypeOf.js"; | ||
import isNativeFunction from "./isNativeFunction.js"; | ||
import construct from "./construct.js"; | ||
export default function _wrapNativeSuper(Class) { | ||
@@ -6,0 +6,0 @@ var _cache = typeof Map === "function" ? new Map() : undefined; |
@@ -1,3 +0,3 @@ | ||
import setPrototypeOf from "setPrototypeOf"; | ||
import inherits from "inherits"; | ||
import setPrototypeOf from "./setPrototypeOf.js"; | ||
import inherits from "./inherits.js"; | ||
export default function _wrapRegExp() { | ||
@@ -51,3 +51,5 @@ _wrapRegExp = function (re, groups) { | ||
var k = 0; | ||
while (result[i[k]] === undefined && k + 1 < i.length) k++; | ||
while (result[i[k]] === undefined && k + 1 < i.length) { | ||
k++; | ||
} | ||
groups[name] = result[i[k]]; | ||
@@ -54,0 +56,0 @@ } |
@@ -6,3 +6,3 @@ import * as t from '@babel/types'; | ||
declare function get(name: string, getDependency?: GetDependency, bindingName?: string, localBindings?: string[], adjustAst?: AdjustAst): { | ||
nodes: t.Statement[]; | ||
nodes: t.Program["body"]; | ||
globals: string[]; | ||
@@ -9,0 +9,0 @@ }; |
{ | ||
"name": "@babel/helpers", | ||
"version": "8.0.0-alpha.11", | ||
"version": "8.0.0-alpha.12", | ||
"description": "Collection of helper functions used by Babel transforms.", | ||
@@ -18,9 +18,9 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"dependencies": { | ||
"@babel/template": "^8.0.0-alpha.11", | ||
"@babel/types": "^8.0.0-alpha.11" | ||
"@babel/template": "^8.0.0-alpha.12", | ||
"@babel/types": "^8.0.0-alpha.12" | ||
}, | ||
"devDependencies": { | ||
"@babel/generator": "^8.0.0-alpha.11", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.11", | ||
"@babel/parser": "^8.0.0-alpha.11", | ||
"@babel/generator": "^8.0.0-alpha.12", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.12", | ||
"@babel/parser": "^8.0.0-alpha.12", | ||
"regenerator-runtime": "^0.14.0" | ||
@@ -27,0 +27,0 @@ }, |
@@ -1,3 +0,1 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import fs from "fs"; | ||
@@ -4,0 +2,0 @@ import { createRequire } from "module"; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
810371
239
5986
12