@babel/helpers
Advanced tools
Comparing version 7.5.5 to 7.6.0
@@ -64,11 +64,2 @@ "use strict"; | ||
} | ||
if (props && defaultProps) { | ||
for (var propName in defaultProps) { | ||
if (props[propName] === void 0) { | ||
props[propName] = defaultProps[propName]; | ||
} | ||
} | ||
} else if (!props) { | ||
props = defaultProps || {}; | ||
} | ||
@@ -85,2 +76,12 @@ if (childrenLength === 1) { | ||
if (props && defaultProps) { | ||
for (var propName in defaultProps) { | ||
if (props[propName] === void 0) { | ||
props[propName] = defaultProps[propName]; | ||
} | ||
} | ||
} else if (!props) { | ||
props = defaultProps || {}; | ||
} | ||
return { | ||
@@ -413,3 +414,3 @@ $$typeof: REACT_ELEMENT_TYPE, | ||
// This function is different to "Reflect.ownKeys". The enumerableOnly | ||
// filters on symbol properties only. Returned string properties are always | ||
// filters on symbol properties only. Returned string properties are always | ||
// enumerable. It is good to use in objectSpread. | ||
@@ -599,24 +600,41 @@ | ||
helpers.interopRequireWildcard = helper("7.0.0-beta.0")` | ||
function _getRequireWildcardCache() { | ||
if (typeof WeakMap !== "function") return null; | ||
var cache = new WeakMap(); | ||
_getRequireWildcardCache = function () { return cache; }; | ||
return cache; | ||
} | ||
export default function _interopRequireWildcard(obj) { | ||
if (obj && obj.__esModule) { | ||
return obj; | ||
} else { | ||
var newObj = {}; | ||
if (obj != null) { | ||
for (var key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor | ||
? Object.getOwnPropertyDescriptor(obj, key) | ||
: {}; | ||
if (desc.get || desc.set) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
var cache = _getRequireWildcardCache(); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = {}; | ||
if (obj != null) { | ||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor | ||
? Object.getOwnPropertyDescriptor(obj, key) | ||
: null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
return newObj; | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
@@ -799,13 +817,2 @@ `; | ||
`; | ||
helpers.temporalRef = helper("7.0.0-beta.0")` | ||
import undef from "temporalUndefined"; | ||
export default function _temporalRef(val, name) { | ||
if (val === undef) { | ||
throw new ReferenceError(name + " is not defined - temporal dead zone"); | ||
} else { | ||
return val; | ||
} | ||
} | ||
`; | ||
helpers.readOnlyError = helper("7.0.0-beta.0")` | ||
@@ -822,4 +829,19 @@ export default function _readOnlyError(name) { | ||
helpers.temporalUndefined = helper("7.0.0-beta.0")` | ||
export default {}; | ||
// This function isn't mean to be called, but to be used as a reference. | ||
// We can't use a normal object because it isn't hoisted. | ||
export default function _temporalUndefined() {} | ||
`; | ||
helpers.tdz = helper("7.5.5")` | ||
export default function _tdzError(name) { | ||
throw new ReferenceError(name + " is not defined - temporal dead zone"); | ||
} | ||
`; | ||
helpers.temporalRef = helper("7.0.0-beta.0")` | ||
import undef from "temporalUndefined"; | ||
import err from "tdz"; | ||
export default function _temporalRef(val, name) { | ||
return val === undef ? err(name) : val; | ||
} | ||
`; | ||
helpers.slicedToArray = helper("7.0.0-beta.0")` | ||
@@ -893,3 +915,5 @@ import arrayWithHoles from "arrayWithHoles"; | ||
// _s = _step | ||
if (!( | ||
Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]" | ||
)) { return } | ||
var _arr = []; | ||
@@ -919,2 +943,5 @@ var _n = true; | ||
export default function _iterableToArrayLimitLoose(arr, i) { | ||
if (!( | ||
Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]" | ||
)) { return } | ||
var _arr = []; | ||
@@ -1103,2 +1130,5 @@ for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { | ||
} | ||
if (descriptor.get) { | ||
return descriptor.get.call(receiver); | ||
} | ||
return descriptor.value; | ||
@@ -1112,9 +1142,14 @@ } | ||
} | ||
if (!descriptor.writable) { | ||
// This should only throw in strict mode, but class bodies are | ||
// always strict and private fields can only be used inside | ||
// class bodies. | ||
throw new TypeError("attempted to set read only private field"); | ||
if (descriptor.set) { | ||
descriptor.set.call(receiver, value); | ||
} else { | ||
if (!descriptor.writable) { | ||
// This should only throw in strict mode, but class bodies are | ||
// always strict and private fields can only be used inside | ||
// class bodies. | ||
throw new TypeError("attempted to set read only private field"); | ||
} | ||
descriptor.value = value; | ||
} | ||
descriptor.value = value; | ||
return value; | ||
@@ -1830,3 +1865,3 @@ } | ||
_wrapRegExp = function(re, groups) { | ||
return new BabelRegExp(re, groups); | ||
return new BabelRegExp(re, undefined, groups); | ||
}; | ||
@@ -1838,5 +1873,6 @@ | ||
function BabelRegExp(re, groups) { | ||
var _this = _RegExp.call(this, re); | ||
_groups.set(_this, groups); | ||
function BabelRegExp(re, flags, groups) { | ||
var _this = _RegExp.call(this, re, flags); | ||
// if the regex is recreated with 'g' flag | ||
_groups.set(_this, groups || _groups.get(re)); | ||
return _this; | ||
@@ -1843,0 +1879,0 @@ } |
{ | ||
"name": "@babel/helpers", | ||
"version": "7.5.5", | ||
"version": "7.6.0", | ||
"description": "Collection of helper functions used by Babel transforms.", | ||
@@ -14,5 +14,5 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"dependencies": { | ||
"@babel/template": "^7.4.4", | ||
"@babel/traverse": "^7.5.5", | ||
"@babel/types": "^7.5.5" | ||
"@babel/template": "^7.6.0", | ||
"@babel/traverse": "^7.6.0", | ||
"@babel/types": "^7.6.0" | ||
}, | ||
@@ -22,3 +22,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43" | ||
"gitHead": "cbd5a26e57758e3f748174ff84aa570e8780e85d" | ||
} |
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
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
70283
1957
Updated@babel/template@^7.6.0
Updated@babel/traverse@^7.6.0
Updated@babel/types@^7.6.0