From 28f49a7df9fa3d82e9bb11424864531b5890156e Mon Sep 17 00:00:00 2001 From: Alessandro Molina Date: Fri, 4 Sep 2015 11:30:39 +0200 Subject: [PATCH] note on including the polyfills when using ES6 --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 1782d68..4cd5f60 100644 --- a/README.rst +++ b/README.rst @@ -41,6 +41,8 @@ To compile ES6 code to ES5 for everyday usage you can use ``dukpy.babel_compile` ... ''') '"use strict";\n\nvar _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };\n\nvar _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };\n\nvar Point = (function () {\n function Point(x, y) {\n _classCallCheck(this, Point);\n\n this.x = x;\n this.y = y;\n }\n\n _prototypeProperties(Point, null, {\n toString: {\n value: function toString() {\n return "(" + this.x + ", " + this.y + ")";\n },\n writable: true,\n configurable: true\n }\n });\n\n return Point;\n})();\n' +**NOTE:** When using the BabelJS compiler for code that needs to run in the browser, make sure to add https://cdnjs.cloudflare.com/ajax/libs/babel-core/4.6.6/browser-polyfill.js dependency. + Using the JavaScript Interpreter --------------------------------