From ed81d75815a0c5a3e64ea71c0aa497f3c7cd3445 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Thu, 20 Dec 2012 17:49:23 +0100 Subject: [PATCH] Removes #pragma lines --- Objective-J/ObjJCompiler.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Objective-J/ObjJCompiler.js b/Objective-J/ObjJCompiler.js index aa06bf8c5..a21019cab 100644 --- a/Objective-J/ObjJCompiler.js +++ b/Objective-J/ObjJCompiler.js @@ -42,7 +42,7 @@ exports.compileFileDependencies = function(/*String*/ aString, /*CFURL*/ aURL, / var ObjJCompiler = function(/*String*/ aString, /*CFURL*/ aURL, /*unsigned*/ flags, /*unsigned*/ pass) { - aString = aString.replace(/^#[^\n]+\n/, "\n"); + aString = aString.replace(/^\#.*/gm, ""); this._URL = new CFURL(aURL); this._pass = pass; // If this is pass one we should not save anything in javascript buffer @@ -72,10 +72,14 @@ var ObjJCompiler = function(/*String*/ aString, /*CFURL*/ aURL, /*unsigned*/ fla console.time("Compile pass " + pass + " - " + aURL); #endif try { - this.nodeDocument(this._tokens); + this.nodeDocument(this._tokens); } catch (e) { - print("Error: " + e + ", file content: " + aString); + #ifdef BROWSER + //console.log("Error: " + e + ", file content: " + aString); + #else + //print("Error: " + e + ", file content: " + aString); + #endif throw e; } //var end = new Date().getTime(); @@ -102,7 +106,7 @@ ObjJCompiler.prototype.compilePass2 = function() //var time = (end - start) / 1000; //print("Compile pass 2: " + this._URL + " in " + time + " seconds"); #ifdef BROWSER - console.timeEnd("Compile" + this._pass + " - " + this._URL); + console.timeEnd("Compile pass 2" + this._pass + " - " + this._URL); #endif return this._jsBuffer.toString(); }