Fixed: The browser can’t promise when a javascript block will execute so compiler flags can be set after the files are compiled. This implementation works all the time.

This commit is contained in:
Martin Carlberg committed 2015-10-09 16:06:53 +02:00
1 parent 26a123f5a8
commit 3844b88f7e
4 files changed
+23 -15

No files matched your search

+17
View File
@@ -45,6 +45,23 @@ if (DOMBaseElementsCount > 0)
pageURL = new CFURL(DOMBaseElementHref, pageURL);
}
// Set compiler flags
if (OBJJ_COMPILER_FLAGS)
{
var flags = 0;
for (var i = 0; i < OBJJ_COMPILER_FLAGS.length; i++)
{
var flag = ObjJAcornCompiler.Flags[OBJJ_COMPILER_FLAGS[i]];
if (flag != null)
{
flags |= flag;
}
}
exports.setCurrentCompilerFlags(flags);
}
// Turn the main file into a URL.
var mainFileURL = new CFURL(window.OBJJ_MAIN_FILE || "main.j"),
@@ -33,6 +33,8 @@
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
// Uncomment below to generate debug symbols, type signatures and inline objj_msgSend functions
// OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures", "InlineMsgSend"];
var progressBar = null;
@@ -61,11 +63,6 @@
<script type="text/javascript">
objj_msgSend_reset();
// COMPILER OPTIONS:
// Uncomment to generate debug symbols, type signatures and/or inline objj_msgSend functions
// ObjectiveJ.setCurrentCompilerFlags(ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols | ObjectiveJ.ObjJAcornCompiler.Flags.IncludeTypeSignatures | ObjectiveJ.ObjJAcornCompiler.Flags.InlineMsgSend);
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
@@ -33,6 +33,8 @@
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
// Uncomment below to generate debug symbols, type signatures and inline objj_msgSend functions
// OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures", "InlineMsgSend"];
var progressBar = null;
@@ -61,11 +63,6 @@
<script type="text/javascript">
objj_msgSend_reset();
// COMPILER OPTIONS:
// Uncomment to generate debug symbols, type signatures and/or inline objj_msgSend functions
// ObjectiveJ.setCurrentCompilerFlags(ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols | ObjectiveJ.ObjJAcornCompiler.Flags.IncludeTypeSignatures | ObjectiveJ.ObjJAcornCompiler.Flags.InlineMsgSend);
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
@@ -33,6 +33,8 @@
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
// Uncomment below to generate debug symbols, type signatures and inline objj_msgSend functions
// OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures", "InlineMsgSend"];
var progressBar = null;
@@ -61,11 +63,6 @@
<script type="text/javascript">
objj_msgSend_reset();
// COMPILER OPTIONS:
// Uncomment to generate debug symbols, type signatures and/or inline objj_msgSend functions
// ObjectiveJ.setCurrentCompilerFlags(ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols | ObjectiveJ.ObjJAcornCompiler.Flags.IncludeTypeSignatures | ObjectiveJ.ObjJAcornCompiler.Flags.InlineMsgSend);
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions: