From cd06449eeeea15bce99c0524e15b21dd310fbb4b Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Tue, 7 Jun 2016 21:21:59 +0300 Subject: [PATCH] es6 to es5 with babel compilation --- dist/index.js | 1 + dist/src/JavaScriptObfuscator.js | 16 ++------------- .../node-groups/DebugProtectionNodesGroup.js | 20 ++++++++++++++++--- .../node-groups/SelfDefendingNodesGroup.js | 20 +++---------------- index.ts | 1 + 5 files changed, 24 insertions(+), 34 deletions(-) diff --git a/dist/index.js b/dist/index.js index d9c4f5e2..f06cf98b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,5 @@ "use strict"; +require("babel-polyfill"); var JavaScriptObfuscator_1 = require('./src/JavaScriptObfuscator'); module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator; diff --git a/dist/src/JavaScriptObfuscator.js b/dist/src/JavaScriptObfuscator.js index a74faeb4..12e29707 100644 --- a/dist/src/JavaScriptObfuscator.js +++ b/dist/src/JavaScriptObfuscator.js @@ -1,20 +1,8 @@ "use strict"; -var _createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); - } - }return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; - }; -}(); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var esprima = require('esprima'); var escodegen = require('escodegen'); diff --git a/dist/src/node-groups/DebugProtectionNodesGroup.js b/dist/src/node-groups/DebugProtectionNodesGroup.js index 394a74bc..bcf003cd 100644 --- a/dist/src/node-groups/DebugProtectionNodesGroup.js +++ b/dist/src/node-groups/DebugProtectionNodesGroup.js @@ -1,10 +1,24 @@ "use strict"; -function _classCallCheck(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 ? "symbol" : typeof obj; }; -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 _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} -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; } +function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + }return call && ((typeof call === "undefined" ? "undefined" : _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 === "undefined" ? "undefined" : _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 DebugProtectionFunctionCallNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode"); var DebugProtectionFunctionIntervalNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode"); diff --git a/dist/src/node-groups/SelfDefendingNodesGroup.js b/dist/src/node-groups/SelfDefendingNodesGroup.js index 35b4eb17..0b89e5ed 100644 --- a/dist/src/node-groups/SelfDefendingNodesGroup.js +++ b/dist/src/node-groups/SelfDefendingNodesGroup.js @@ -1,24 +1,10 @@ "use strict"; -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -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 _possibleConstructorReturn(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - }return call && ((typeof call === "undefined" ? "undefined" : _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 === "undefined" ? "undefined" : _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; -} +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 NodesGroup_1 = require('./NodesGroup'); var SelfDefendingUnicodeNode_1 = require("../custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode"); diff --git a/index.ts b/index.ts index eee91d17..c74bf86e 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,6 @@ "use strict"; +import "babel-polyfill"; import { JavaScriptObfuscator } from './src/JavaScriptObfuscator'; module.exports = JavaScriptObfuscator;