Add option to enable type checking in index-debug.html.

This commit is contained in:
Tom Robinson committed 2009-07-29 20:23:40 -07:00
1 parent 3b8664e6ff
commit 0c349a8d7f
3 files changed
+20 -4

No files matched your search

+2 -2
View File
@@ -106,7 +106,7 @@ function objj_typecheck_decorator(msgSend)
objj_typechecks_reported[key] = true;
objj_fprintf(warning_stream, "Type check failed on argument " + (i-2) + " of " + objj_debug_message_format(aReceiver, aSelector) + ": " + e);
if (objj_typecheck_prints_backtrace)
objj_backtrace_fprint(warning_stream);
objj_backtrace_print(warning_stream);
}
}
}
@@ -124,7 +124,7 @@ function objj_typecheck_decorator(msgSend)
objj_typechecks_reported[key] = true;
objj_fprintf(warning_stream, "Type check failed on return val of " + objj_debug_message_format(aReceiver, aSelector) + ": " + e);
if (objj_typecheck_prints_backtrace)
objj_backtrace_fprint(warning_stream);
objj_backtrace_print(warning_stream);
}
}
+2 -1
View File
@@ -671,7 +671,8 @@ objj_preprocessor.prototype.method = function(tokens)
CONCAT(buffer, ")\n{ with(self)\n{");
CONCAT(buffer, this.preprocess(tokens, NULL, TOKEN_CLOSE_BRACE, TOKEN_OPEN_BRACE));
CONCAT(buffer, "}\n}");
if (this._flags & OBJJ_PREPROCESSOR_TYPE_SIGNATURES)
// TODO: actually use OBJJ_PREPROCESSOR_TYPE_SIGNATURES flag instead of tying to OBJJ_PREPROCESSOR_DEBUG_SYMBOLS
if (this._flags & OBJJ_PREPROCESSOR_DEBUG_SYMBOLS) //OBJJ_PREPROCESSOR_TYPE_SIGNATURES)
CONCAT(buffer, ","+JSON.stringify(types));
CONCAT(buffer, ")");
@@ -21,7 +21,22 @@
</script>
<script src = "Frameworks/Debug/Objective-J/Objective-J.js" type = "text/javascript"></script>
<script type = "text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
</script>
<style type = "text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}