From effd86e79f9789c4cda7f35840da2387fb6278a1 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Wed, 15 Jun 2016 18:54:10 -0700 Subject: [PATCH] Revert "FIX Unfinished Function Declaration in Comments" --- client/commonFramework/detect-unsafe-code-stream.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/commonFramework/detect-unsafe-code-stream.js b/client/commonFramework/detect-unsafe-code-stream.js index ccf81a77de..14ed08f77b 100644 --- a/client/commonFramework/detect-unsafe-code-stream.js +++ b/client/commonFramework/detect-unsafe-code-stream.js @@ -5,9 +5,6 @@ window.common = (function(global) { } = global; const detectFunctionCall = /function\s*?\(|function\s+\w+\s*?\(/gi; - const detectInComment = new RegExp(['\\/\\/[\\W\\w\\s]*?function.|', - '\\/\\*[\\s\\w\\W]*?function', - '[\\s\\W\\w]*?\\*\\/'].join(''), 'gi'); const detectUnsafeJQ = /\$\s*?\(\s*?\$\s*?\)/gi; const detectUnsafeConsoleCall = /if\s\(null\)\sconsole\.log\(1\);/gi; @@ -38,8 +35,7 @@ window.common = (function(global) { if ( code.match(/function/g) && - !code.match(detectFunctionCall) && - !code.match(detectInComment) + !code.match(detectFunctionCall) ) { return Observable.throw( new Error('SyntaxError: Unsafe or unfinished function declaration')