This repository has been archived by the owner. It is now read-only.

User external-helpers #254

Merged
merged 1 commit into from Jan 2, 2017

Conversation

Projects
None yet
2 participants
@danez
Copy link
Member

danez commented Dec 12, 2016

Q A
Bug fix? no
Breaking change? no
New feature? no
Deprecations? no
Spec compliancy? no
Tests added/pass? yes
Fixed tickets Fixes #253
License MIT

Use external-helpers and do not bundle comments

Add yarn.lock as recommended

@danez danez requested review from DrewML and hzoo Dec 12, 2016

@hzoo

This comment has been minimized.

Copy link
Member

hzoo commented Dec 12, 2016

Yeah what I had when testing it out previously https://gist.github.com/hzoo/6f393d0a24be191e25dee0bb894bb09e - there's some issue with asyncGenerator and IIFE (maybe it doesn't have to be one). Had more than a few reports of others experiencing the same issue

@danez

This comment has been minimized.

Copy link
Member Author

danez commented Dec 12, 2016

You mean it is in there, although not needed?

@hzoo

This comment has been minimized.

Copy link
Member

hzoo commented Dec 12, 2016

It's definetely not needed since our code doesn't use async function * but rollup isn't able to dead-code-elim an iife like that?

@danez

This comment has been minimized.

Copy link
Member Author

danez commented Dec 12, 2016

We could use the new whitelist option for now, although seems more like a temporary workaround rollup/rollup-plugin-babel#92

This describes the issue pretty good: http://stackoverflow.com/questions/40022087/using-the-whitelist-option-with-babels-external-helpers/40071679#40071679

@hzoo

This comment has been minimized.

Copy link
Member

hzoo commented Dec 12, 2016

Cool that sounds good

@hzoo

This comment has been minimized.

Copy link
Member

hzoo commented Dec 12, 2016

dang wish I saved those other issues then to ping them

@danez

This comment has been minimized.

Copy link
Member Author

danez commented Dec 12, 2016

Ok upgrading to rollup 0.37 removes the asyncGenerator, still get/set are included.

@danez

This comment has been minimized.

Copy link
Member Author

danez commented Dec 13, 2016

I created a PR + issue at rollup for get/set
rollup/rollup#1143
rollup/rollup#1142

@danez danez force-pushed the external-helpers branch from 7f836ef to 767c931 Dec 13, 2016

@danez danez added the PR: WIP label Dec 14, 2016

@danez danez force-pushed the external-helpers branch from 767c931 to 8e5e967 Dec 21, 2016

@danez danez removed the PR: WIP label Dec 21, 2016

@danez danez force-pushed the external-helpers branch from 8e5e967 to ada4f46 Dec 21, 2016

@danez

This comment has been minimized.

Copy link
Member Author

danez commented Dec 21, 2016

Ok now finally with rollup 0.37.2 :)

--- 	2016-12-21 19:03:00 +0000
+++ 	2016-12-21 19:03:00 +0000
@@ -124,7 +124,71 @@
   return options;
 }
 
-function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
+  return typeof obj;
+} : function (obj) {
+  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+};
+
+
+
+
+
+
+
+
+
+
+
+var classCallCheck = function (instance, Constructor) {
+  if (!(instance instanceof Constructor)) {
+    throw new TypeError("Cannot call a class as a function");
+  }
+};
+
+
+
+
+
+
+
+
+
+
+
+var inherits = function (subClass, superClass) {
+  if (typeof superClass !== "function" && superClass !== null) {
+    throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+  }
+
+  subClass.prototype = Object.create(superClass && superClass.prototype, {
+    constructor: {
+      value: subClass,
+      enumerable: false,
+      writable: true,
+      configurable: true
+    }
+  });
+  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+};
+
+
+
+
+
+
+
+
+
+
+
+var possibleConstructorReturn = function (self, call) {
+  if (!self) {
+    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+  }
+
+  return call && (typeof call === "object" || typeof call === "function") ? call : self;
+};
 
 // ## Token types
 
@@ -146,8 +210,7 @@
 
 var TokenType = function TokenType(label) {
   var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
-  _classCallCheck$2(this, TokenType);
+  classCallCheck(this, TokenType);
 
   this.label = label;
   this.keyword = conf.keyword;
@@ -292,14 +355,12 @@
 
 var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
 
-function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
 // The algorithm used to determine whether a regexp can appear at a
 // given point in the program is loosely based on sweet.js' approach.
 // See https://github.com/mozilla/sweet.js/wiki/design
 
 var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
-  _classCallCheck$3(this, TokContext);
+  classCallCheck(this, TokContext);
 
   this.token = token;
   this.isExpr = !!isExpr;
@@ -385,20 +446,18 @@
   this.state.exprAllowed = false;
 };
 
-function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
 // These are used when `options.locations` is on, for the
 // `startLoc` and `endLoc` properties.
 
 var Position = function Position(line, col) {
-  _classCallCheck$4(this, Position);
+  classCallCheck(this, Position);
 
   this.line = line;
   this.column = col;
 };
 
 var SourceLocation = function SourceLocation(start, end) {
-  _classCallCheck$4(this, SourceLocation);
+  classCallCheck(this, SourceLocation);
 
   this.start = start;
   this.end = end;
@@ -423,11 +482,9 @@
   }
 }
 
-function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
 var State = function () {
   function State() {
-    _classCallCheck$5(this, State);
+    classCallCheck(this, State);
   }
 
   State.prototype.init = function init(options, input) {
@@ -558,8 +615,6 @@
   return State;
 }();
 
-function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
 /* eslint indent: 0 */
 
 // Object type used to represent tokens. Note that normally, tokens
@@ -567,7 +622,7 @@
 // used for the onToken callback and the external tokenizer.
 
 var Token = function Token(state) {
-  _classCallCheck$1(this, Token);
+  classCallCheck(this, Token);
 
   this.type = state.type;
   this.value = state.value;
@@ -589,7 +644,7 @@
 
 var Tokenizer = function () {
   function Tokenizer(options, input) {
-    _classCallCheck$1(this, Tokenizer);
+    classCallCheck(this, Tokenizer);
 
     this.state = new State();
     this.state.init(options, input);
@@ -1426,24 +1481,18 @@
   return Tokenizer;
 }();
 
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
 var plugins = {};
 var frozenDeprecatedWildcardPluginList = ["jsx", "doExpressions", "objectRestSpread", "decorators", "classProperties", "exportExtensions", "asyncGenerators", "functionBind", "functionSent", "dynamicImport", "flow"];
 
 var Parser = function (_Tokenizer) {
-  _inherits(Parser, _Tokenizer);
+  inherits(Parser, _Tokenizer);
 
   function Parser(options, input) {
-    _classCallCheck(this, Parser);
+    classCallCheck(this, Parser);
 
     options = getOptions(options);
 
-    var _this = _possibleConstructorReturn(this, _Tokenizer.call(this, options, input));
+    var _this = possibleConstructorReturn(this, _Tokenizer.call(this, options, input));
 
     _this.options = options;
     _this.inModule = _this.options.sourceType === "module";
@@ -1546,8 +1595,6 @@
   return Parser;
 }(Tokenizer);
 
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
 var pp = Parser.prototype;
 
 // ## Parser utilities
@@ -4177,8 +4224,6 @@
   return this.finishNode(node, "YieldExpression");
 };
 
-function _classCallCheck$6(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
 // Start an AST node, attaching a start offset.
 
 var pp$4 = Parser.prototype;
@@ -4186,7 +4231,7 @@
 
 var Node = function () {
   function Node(pos, loc, filename) {
-    _classCallCheck$6(this, Node);
+    classCallCheck(this, Node);
 
     this.type = "";
     this.start = pos;

@danez danez force-pushed the external-helpers branch from ada4f46 to 649582f Dec 28, 2016

Daniel Tschinder
User external-helpers
Add yarn.lock as recommended

@danez danez force-pushed the external-helpers branch from 649582f to 24d490e Dec 28, 2016

@danez danez merged commit 0fb1be4 into master Jan 2, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@danez danez deleted the external-helpers branch Jan 2, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.