Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-runtime

Package Overview
Dependencies
Maintainers
2
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-runtime - npm Package Compare versions

Comparing version 6.1.18 to 6.2.0

helpers/_jsx.js

6

package.json
{
"name": "babel-runtime",
"version": "6.1.18",
"version": "6.2.0",
"description": "babel selfContained runtime",

@@ -14,6 +14,6 @@ "license": "MIT",

"babel-plugin-transform-runtime": "^6.1.18",
"babel-template": "^6.1.18",
"babel-template": "^6.2.0",
"babel-runtime": "^5.0.0",
"regenerator": "^0.8.34"
"babel-regenerator-runtime": "^6.2.0"
}
}

@@ -19,2 +19,6 @@ "use strict";

var _iterator = require("babel-runtime/core-js/symbol/iterator");
var _iterator2 = _interopRequireDefault(_iterator);
var _symbol = require("babel-runtime/core-js/symbol");

@@ -41,5 +45,3 @@

var undefined; // More compressible than void 0.
var $Symbol = typeof _symbol2.default === "function" ? _symbol2.default : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var iteratorSymbol = typeof _symbol2.default === "function" && _iterator2.default || "@@iterator";

@@ -114,3 +116,3 @@ var inModule = (typeof module === "undefined" ? "undefined" : (0, _typeof3.default)(module)) === "object";

GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction";
GeneratorFunction.displayName = "GeneratorFunction";

@@ -140,5 +142,2 @@ // Helper for defining the .next, .throw, and .return methods of the

genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}

@@ -163,37 +162,26 @@ genFun.prototype = (0, _create2.default)(Gp);

function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value instanceof AwaitArgument) {
return _promise2.default.resolve(value.arg).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
});
}
return _promise2.default.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
resolve(result);
}, reject);
}
// This invoke function is written in a style that assumes some
// calling function (or Promise) will handle exceptions.
function invoke(method, arg) {
var result = generator[method](arg);
var value = result.value;
return value instanceof AwaitArgument ? _promise2.default.resolve(value.arg).then(invokeNext, invokeThrow) : _promise2.default.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
return result;
});
}

@@ -205,2 +193,5 @@

var invokeNext = invoke.bind(generator, "next");
var invokeThrow = invoke.bind(generator, "throw");
var invokeReturn = invoke.bind(generator, "return");
var previousPromise;

@@ -210,5 +201,3 @@

function callInvokeWithMethodAndArg() {
return new _promise2.default(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
return invoke(method, arg);
}

@@ -232,3 +221,5 @@

// invocations of the iterator.
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
callInvokeWithMethodAndArg) : new _promise2.default(function (resolve) {
resolve(callInvokeWithMethodAndArg());
});
}

@@ -333,2 +324,4 @@

if (method === "next") {
context._sent = arg;
if (state === GenStateSuspendedYield) {

@@ -396,4 +389,2 @@ context.sent = arg;

Gp[toStringTagSymbol] = "Generator";
Gp.toString = function () {

@@ -400,0 +391,0 @@ return "[object Generator]";

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc