console moved from application to globals

This commit is contained in:
Vladimir Enchev
2014-05-12 14:21:02 +03:00
parent 76dd7014a1
commit c9ca0d997b
6 changed files with 10 additions and 11 deletions

View File

@ -1,7 +1,4 @@
import consoleModule = require("Console/console");
// TODO: This is put in the global context, is this the preferred approach
console = new consoleModule.Console();
require("globals");
export var onLaunch = function (): any {
}

View File

@ -278,7 +278,7 @@ export class Console {
}
public log(message: any, ...formatParams: any[]): void {
helperModule.log(this.formatParams.apply(this, arguments));
helperModule.helper_log(this.formatParams.apply(this, arguments));
}
public trace(): void {

View File

@ -1,6 +1,6 @@
var TAG = 'JS';
export var log = function (message: string) {
export var helper_log = function (message: string) {
android.util.Log.v(TAG, message);
}

View File

@ -1,4 +1,4 @@
export declare var log: (message: string) => void;
export declare var helper_log: (message: string) => void;
export declare var info: (message: string) => void;
export declare var error: (message: string) => void;
export declare var warn: (message: string) => void;

View File

@ -1,7 +1,7 @@
// TODO: we should use Foundation.NSLog() but it currently does not work
// TODO: Is there a better way to implement the info/warn/error
export var log = function (message: string) {
export var helper_log = function (message: string) {
log('log: ' + message);
}

View File

@ -1,8 +1,10 @@
declare var module, setTimeout, clearTimeout, setInterval, clearInterval;
declare var setTimeout, clearTimeout, setInterval, clearInterval;
import timer = require("timer/timer");
module.exports = timer;
import consoleModule = require("Console/console");
setTimeout = timer.setTimeout;
clearTimeout = timer.clearTimeout;
setInterval = timer.setInterval;
clearInterval = timer.clearTimeout;
clearInterval = timer.clearTimeout;
console = new consoleModule.Console();