Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit 0c30525

Browse files
committed
Babel update
1 parent f7019cb commit 0c30525

8 files changed

Lines changed: 4594 additions & 2846 deletions

File tree

build-babel/jspm.config.js

Lines changed: 280 additions & 294 deletions
Large diffs are not rendered by default.

build-babel/jspm_packages/npm/babel-plugin-transform-regenerator@6.8.0/lib/util.js renamed to build-babel/jspm_packages/npm/babel-plugin-transform-regenerator@6.9.0/lib/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var t = _interopRequireWildcard(_babelTypes);
1313
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)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1414

1515
function runtimeProperty(name, regeneratorIdentifier) {
16-
return t.memberExpression(regeneratorIdentifier || t.identifier("regeneratorRuntime"), t.identifier(name), false);
16+
return t.memberExpression(regeneratorIdentifer || t.identifier("regeneratorRuntime"), t.identifier(name), false);
1717
} /**
1818
* Copyright (c) 2014, Facebook, Inc.
1919
* All rights reserved.

build-babel/jspm_packages/npm/babel-plugin-transform-regenerator@6.8.0/lib/visit.js renamed to build-babel/jspm_packages/npm/babel-plugin-transform-regenerator@6.9.0/lib/visit.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ exports.visitor = {
8787
bodyBlockPath.node.body = innerBody;
8888
}
8989

90-
var outerFnExpr = getOuterFnExpr(path);
90+
var outerFnExpr = getOuterFnExpr(path, state);
9191
// Note that getOuterFnExpr has the side-effect of ensuring that the
9292
// function has a name (so node.id will always be an Identifier), even
9393
// if a temporary name has to be synthesized.
@@ -152,7 +152,7 @@ exports.visitor = {
152152
// used to refer reliably to the function object from inside the function.
153153
// This expression is essentially a replacement for arguments.callee, with
154154
// the key advantage that it works in strict mode.
155-
function getOuterFnExpr(funPath) {
155+
function getOuterFnExpr(funPath, state) {
156156
var node = funPath.node;
157157
t.assertFunction(node);
158158

@@ -172,7 +172,7 @@ function getOuterFnExpr(funPath) {
172172
return node.id;
173173
}
174174

175-
var markDecl = getRuntimeMarkDecl(pp);
175+
var markDecl = getRuntimeMarkDecl(pp, state);
176176
var markedArray = markDecl.declarations[0].id;
177177
var funDeclIdArray = markDecl.declarations[0].init.callee.object;
178178
t.assertArrayExpression(funDeclIdArray);
@@ -186,7 +186,7 @@ function getOuterFnExpr(funPath) {
186186
return node.id;
187187
}
188188

189-
function getRuntimeMarkDecl(blockPath) {
189+
function getRuntimeMarkDecl(blockPath, state) {
190190
var block = blockPath.node;
191191
/*istanbul ignore next*/_assert2.default.ok(Array.isArray(block.body));
192192

@@ -246,7 +246,7 @@ var awaitVisitor = {
246246
path.skip(); // Don't descend into nested function scopes.
247247
},
248248

249-
AwaitExpression: function /*istanbul ignore next*/AwaitExpression(path) {
249+
AwaitExpression: function /*istanbul ignore next*/AwaitExpression(path, state) {
250250
// Convert await expressions to yield expressions.
251251
var argument = path.node.argument;
252252

build-babel/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"babel-preset-stage-2": "npm:babel-preset-stage-2@^6.5.0",
3030
"babel-preset-stage-3": "npm:babel-preset-stage-3@^6.3.13",
3131
"core-js": "npm:core-js@^1.2.6",
32-
"regenerator": "github:facebook/regenerator@^0.8.42"
32+
"regenerator": "github:facebook/regenerator@^0.8.42",
33+
"regenerator-runtime": "npm:regenerator-runtime@^0.9.5"
3334
},
3435
"devDependencies": {
3536
"plugin-babel": "npm:systemjs-plugin-babel@0.0.10"

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jspm run systemjs-build-babel-helpers.js > ../babel-helpers.js
66
jspm run systemjs-build-modular-babel-helpers.js
77
(
88
echo "export default (function(module) {" ;
9-
cat jspm_packages/github/facebook/regenerator@0.8.42/runtime.js
9+
cat jspm_packages/npm/regenerator-runtime@0.9.5/runtime.js
1010
echo "return module.exports; })({exports:{}});"
1111
) > ../regenerator-runtime.js
1212
cd ..

regenerator-runtime.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,9 @@ export default (function(module) {
311311
}
312312

313313
if (method === "next") {
314-
if (state === GenStateSuspendedYield) {
315-
context.sent = arg;
316-
} else {
317-
context.sent = undefined;
318-
}
314+
// Setting context._sent for legacy support of Babel's
315+
// function.sent implementation.
316+
context.sent = context._sent = arg;
319317

320318
} else if (method === "throw") {
321319
if (state === GenStateSuspendedStart) {
@@ -488,7 +486,9 @@ export default (function(module) {
488486
reset: function(skipTempReset) {
489487
this.prev = 0;
490488
this.next = 0;
491-
this.sent = undefined;
489+
// Resetting context._sent for legacy support of Babel's
490+
// function.sent implementation.
491+
this.sent = this._sent = undefined;
492492
this.done = false;
493493
this.delegate = null;
494494

systemjs-babel-browser.js

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)