mirror of https://github.com/amol-/dukpy.git
note on including the polyfills when using ES6
This commit is contained in:
parent
b654b34238
commit
28f49a7df9
|
@ -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
|
||||
--------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue