From c92fd6f0bb2a7868cb65de5b9b69b3b12a85b82e Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 12 Dec 2014 12:14:24 +1100 Subject: [PATCH 1/3] remove useless GeneratorFunction aliasing causing issues #283 --- .../transformers/es6-generators/runtime.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/6to5/transformation/transformers/es6-generators/runtime.js b/lib/6to5/transformation/transformers/es6-generators/runtime.js index 2adc60afdd..0c8f932f1f 100644 --- a/lib/6to5/transformation/transformers/es6-generators/runtime.js +++ b/lib/6to5/transformation/transformers/es6-generators/runtime.js @@ -27,20 +27,14 @@ var ContinueSentinel = {}; // Dummy constructor that we use as the .constructor property for // functions that return Generator objects. -var GF = function GeneratorFunction() {}; +function GeneratorFunction() {} var GFp = function GeneratorFunctionPrototype() {}; var Gp = GFp.prototype = Generator.prototype; -(GFp.constructor = GF).prototype = - Gp.constructor = GFp; - -// Ensure isGeneratorFunction works when Function#name not supported. -var GFName = "GeneratorFunction"; -if (GF.name !== GFName) GF.name = GFName; -if (GF.name !== GFName) throw new Error(GFName + " renamed?"); +(GFp.constructor = GeneratorFunction).prototype = Gp.constructor = GFp; runtime.isGeneratorFunction = function (genFun) { var ctor = genFun && genFun.constructor; - return ctor ? GF.name === ctor.name : false; + return ctor ? GeneratorFunction.name === ctor.name : false; }; runtime.mark = function (genFun) { From 2a27b7c16c28586fad19a3b2c2bf1cf747dde5b2 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 13 Dec 2014 12:15:32 +1100 Subject: [PATCH 2/3] 1.15.0 --- CHANGELOG.md | 127 ++++++++++++++++++++++++++++----------------------- 1 file changed, 70 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93935fa179..d3736834d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,267 +1,280 @@ -# 1.14.17 +# Changelog + +Gaps between patch versions are faulty/broken releases. + +## 1.15.0 + + * Don't alias `GeneratorFunction` and check the name which causes minifiers to remove the name and throw an error later on when we check if it's set. + +## 1.14.18 + + * Fix files only containg comments not being output. + * Fix duplicate comments on property key shorthands. + +## 1.14.17 * Add default initializer to let variables within loop bodies. * Fix excessive `break` replacement inside of switches in let scoping. -# 1.14.16 +## 1.14.16 * Add object getter memos and this shorthand to playground. * Fix while loops in let scoping. * Upgrade `acorn-6to5`. -# 1.14.14 +## 1.14.14 * Fix template literals escaping. -# 1.14.13 +## 1.14.13 * Fix let scoping of `while` loops. * Make class methods enumerable. -# 1.14.12 +## 1.14.12 * Fix duplicate dynamic expressions in call spread. -# 1.14.10 +## 1.14.10 * Fix let scoping unneccesary override. -# 1.14.6 +## 1.14.6 * Avoid ensuring a block on non-array node replacements. -# 1.14.5 +## 1.14.5 * Upgrade `acorn-6to5`. * Fix JSON recursion error for unknown code generator node types. * Ensure that a statement is a block on block/statement types when replacing them with multiple nodes. -# 1.14.4 +## 1.14.4 * Merge pretzel maps and method binding. -# 1.14.3 +## 1.14.3 * Add playground pretzel maps. -# 1.14.2 +## 1.14.2 * Fix `commonInterop` default export handling. * Fix keyworded property key identifiers being turned into computed property key literals. -# 1.14.1 +## 1.14.1 * Inherit comments from `ClassDeclaration`. -# 1.14.0 +## 1.14.0 * Add [playground](https://6to5.github.io/playground.html). -# 1.13.13 +## 1.13.13 * Fix `--debug` in `bin/6to5-node`. Thanks [@timoxley](https://github.com/timoxley). -# 1.13.12 +## 1.13.12 * Ignore `XJSEmptyExpression`s in `react` transformer output. -# 1.13.11 +## 1.13.11 * Fix `util.regexify` on falsy values. * Fix `_aliasFunction` with rest parameters. * Export as `module.exports` instead of `exports.default` if there are no other `ExportDeclaration`s in `commonInterop` module formatter. * Add `system` module formatter. Thanks [@douglasduteil](https://github.com/douglasduteil). -# 1.13.10 +## 1.13.10 * Add support for `AssignmentExpression` destructuring outside of `ExpressionStatement`. -# 1.13.9 +## 1.13.9 * Fix `VirtualPropertyExpression` visitor keys. -# 1.13.8 +## 1.13.8 * Only use a single reference in abstract references. -# 1.13.7 +## 1.13.7 * Upgrade `acorn-6to5`. * Add experimental exponentiation operator support. -# 1.13.6 +## 1.13.6 * Fix experimental object spread/rest helper. -# 1.13.5 +## 1.13.5 * Upgrade `acorn-6to5`. * Add experimental support for object spread/rest. * Change `arguments` to array to an additional helper method. -# 1.13.4 +## 1.13.4 * Fix single spread element returning itself. -# 1.13.3 +## 1.13.3 * Upgrade `acorn-6to5`. * Add experimental support for abstract references. -# 1.13.2 +## 1.13.2 * Optimise `Array.from` usage by adding a helper method. * Upgrade `acorn-6to5`. -# 1.13.1 +## 1.13.1 * Fix constructor spread optimisation. Thanks [@zloirock](https://github.com/zloirock). -# 1.13.0 +## 1.13.0 * Put experimental ES7 features behind a flag `--experimental` and `experimental` option. * Constructor spread performance increase. Thanks [@RReverser](https://github.com/RReverser). * Use `self` instead of `window` in the optional 6to5 runtime. Thanks [@RReverser](https://github.com/RReverser). -# 1.12.26 +## 1.12.26 * Support computed property destructuring. -# 1.12.25 +## 1.12.25 * Update `acorn-6to5`, `ast-types`, `es6-shim`, `chokidar`, `estraverse` and `private`. -# 1.12.24 +## 1.12.24 * Collect references that haven't been declared in scope. -# 1.12.23 +## 1.12.23 * Fix generator function export hoisting. -# 1.12.22 +## 1.12.22 * Update `fs-readdir-recursive` and `chokidar`. * Support array destructuring on iterables. * Make amd module id optional. Thanks [@webpro](https://github.com/webpro). -# 1.12.21 +## 1.12.21 * Fix unneccesary let scoping replacement. * Add `commonInterop` module formatter. Thanks [@Naddiseo](https://github.com/Naddiseo). * Fix `return` outside of function body bug. Thanks [@brentburg](https://github.com/brentburg). * Add more flexible option types. -# 1.12.20 +## 1.12.20 * Append `sourceMappingURL` when using `bin/6to5` and output sourcemaps. -# 1.12.19 +## 1.12.19 * Add `comments` option and `--remove-comments` flag. Thanks [@webpro](htps://github.com/webpro). * Embed `regenerator`. -# 1.12.18 +## 1.12.18 * Use `global` reference instead of `window`. -# 1.12.17 +## 1.12.17 * Add `moduleName`, `sourceRoot` and `filenameRelative` options. Thanks [@darvelo](https://github.com/darvelo). * Traversal optimisations. -# 1.12.16 +## 1.12.16 * Fix comments not being retained from `MethodDefinition` in classes. * Add temporal dead zone in default parameters. -# 1.12.15 +## 1.12.15 * Update `acorn-6to5`. -# 1.12.14 +## 1.12.14 * Fix duplicate let scoping in functions. * Make JSX whitespace more React-compliant. * Add `_memberExpressionKeywords` transformer that turns keyword identifiers to computed literals. * Upgrade `regenerator-6to5`. -# 1.12.13 +## 1.12.13 * Support duplicate constants within different block scopes. * Fix for-head duplication testing and replacement. * Support `raw` property on tagged template literals. -# 1.12.12 +## 1.12.12 * Make scope tracker more reliable to handle all edgecases. -# 1.12.11 +## 1.12.11 * Block scope classes. * Fix generation of integer `Literal`s in `MemberExpression`. -# 1.12.10 +## 1.12.10 * Fix let scoping var hoisting. -# 1.12.9 +## 1.12.9 * Escape unicode characters when generating string `Literal`s. * Fix semicolons being output for statements in `ExportDeclaration`. * Fix `WithStatement` missing parenthesis. -# 1.12.8 +## 1.12.8 * Temporarily forbid `AssignmentExpression` destructuring outside of `ExpressionStatement`. -# 1.12.7 +## 1.12.7 * Update to latest `acorn-6to5`. -# 1.12.6 +## 1.12.6 * Update to latest `acorn-6to5`. -# 1.12.5 +## 1.12.5 * Fix excessive whitespace trimming resulting in innaccurate sourcemap line. -# 1.12.4 +## 1.12.4 * Add `doc` folder for documentation. -# 1.12.3 +## 1.12.3 * Support generator comprehensions. * Use `Array.from` instead of `Array.prototype.slice` in spread transformer. * Support spread in `NewExpression`s. -# 1.12.2 +## 1.12.2 * Upgrade `matcha` to `0.6.0` and `browserify` to `6.3.2`. * Add own `trimRight` helper instead of relying on the string instance method. * Support JSX spreads that aren't the first. -# 1.12.1 +## 1.12.1 * Fix `this` and `arguments` mapping in the `_aliasFunctions` transformer. -# 1.12.0 +## 1.12.0 * Combine `jsx` and `react` transformers to `react`. * Update `react` syntax output to React v0.12. -# 1.11.15 +## 1.11.15 * Fix JSX literal whitespace generation. -# 1.11.14 +## 1.11.14 * Avoid using a switch for let-scoping continue and break statements and use an if statement instead. * Remove excess whitespace and newlines from JSX literals. -# 1.11.13 +## 1.11.13 * Update regenerator-6to5 * Add support for most escodegen formatting options From 9ca05b1971a97154980dc987831f12bbc6641471 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 13 Dec 2014 12:18:05 +1100 Subject: [PATCH 3/3] v1.15.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d4b342188..c8a00f30f0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "6to5", "description": "Turn ES6 code into readable vanilla ES5 with source maps", - "version": "1.14.17", + "version": "1.15.0", "author": "Sebastian McKenzie ", "homepage": "https://github.com/6to5/6to5", "repository": {