瀏覽代碼

Replaced `compile` with `constructor` call

sanex3339 4 年之前
父節點
當前提交
80a122b763

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 Change Log
 
+v1.2.1
+---
+* Support of old browsers when `selfDefending` is enabled. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/615
+
 v1.2.0
 ---
 * Conditional comments will be removed from the code after obfuscation. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/641

File diff suppressed because it is too large
+ 0 - 0
dist/index.browser.js


File diff suppressed because it is too large
+ 0 - 0
dist/index.cli.js


File diff suppressed because it is too large
+ 0 - 0
dist/index.js


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "javascript-obfuscator",
-  "version": "1.2.0",
+  "version": "1.2.1",
   "description": "JavaScript obfuscator",
   "keywords": [
     "obfuscator",

+ 1 - 1
src/custom-code-helpers/self-defending/templates/SelfDefendingTemplate.ts

@@ -9,7 +9,7 @@ export function SelfDefendingTemplate (): string {
             const test = function () {
                 const regExp = test
                     .constructor('return /" + this + "/')()
-                    .compile('^([^ ]+( +[^ ]+)+)+[^ ]}');
+                    .constructor('^([^ ]+( +[^ ]+)+)+[^ ]}');
                 
                 return !regExp.test({selfDefendingFunctionName});
             };

Some files were not shown because too many files changed in this diff