package de.iterable.teavm.jso.browser;

import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject;

/**
 * The console object provides access co
 */
public abstract class Console implements JSObject {

	private Console() {
	}

	@JSBody(params = {}, script = "return console;")
	public static native Console current();

	// currently not working in Firebug 2.0.12  see https://github.com/firebug/firebug/issues/7948
	@JSBody(params = { "expression", "msg" }, script = "return this.assert(expression, msg)")
	public abstract void assertTrue(boolean expression, String msg);

	public abstract void clear();

	public abstract void count();

	public abstract void count(String label);

	@JSBody(params = { "objs" }, script = "return this.debug.apply(this, objs)")
	public abstract void debug(JSObject... objs);

	@JSBody(params = { "msg",
			"objs" }, script = "var args=[msg]; args.push.apply(args, objs);return this.debug.apply(this, args)")
	public abstract void debug(String msg, JSObject... objs);

	public abstract void dir(JSObject obj);

	public abstract void dirxml(JSObject obj);

	@JSBody(params = { "objs" }, script = "return this.error.apply(this, objs)")
	public abstract void error(JSObject... objs);

	@JSBody(params = { "objs" }, script = "return this.group.apply(this, objs)")
	public abstract void group(JSObject... objs);

	@JSBody(params = { "objs" }, script = "return this.groupCollapsed.apply(this, objs)")
	public abstract void groupCollapsed(JSObject... objs);

	public abstract void groupEnd();

	@JSBody(params = { "objs" }, script = "return this.info.apply(this, objs)")
	public abstract void info(JSObject... objs);

	@JSBody(params = { "msg",
			"objs" }, script = "var args=[msg]; args.push.apply(args, objs);return this.info.apply(this, args)")
	public abstract void info(String msg, JSObject... objs);

	@JSBody(params = { "msg",
			"objs" }, script = "var args=[msg]; args.push.apply(args, objs);return this.log.apply(this, args)")
	public abstract void log(String msg, JSObject... objs);

	@JSBody(params = { "objs" }, script = "return this.log.apply(this, objs)")
	public abstract void log(JSObject... objs);

	public abstract void profile();

	public abstract void profile(String label);

	public abstract void profileEnd();

	public abstract void time(String timerName);

	public abstract void timeEnd();

	public abstract void timeStamp();

	public abstract void timeStamp(String label);

	// currently not working in Firebug 2.0.12  see https://github.com/firebug/firebug/issues/7948
	public abstract void trace();

	@JSBody(params = { "objs" }, script = "return this.warn.apply(this, objs)")
	public abstract void warn(JSObject... objs);

	@JSBody(params = { "msg",
			"objs" }, script = "var args=[msg]; args.push.apply(args, objs);return this.warn.apply(this, args)")
	public abstract void warn(String msg, JSObject... objs);

}

@@ -1,8 +1,617 @@
+/*%0A *  Copyright 2015 Felix Wittmann%0A *%0A *  Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *  you may not use this file except in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *       http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A */%0A
 package 
@@ -705,17 +705,16 @@
 ect;%0A%0A/*
-*
 %0A * The 
@@ -744,18 +744,185 @@
  access 
-co
+to the browser's debugging console. The%0A * specifics of how it works vary from browser to browser, but there is a%0A * factual set of features that are typically provided.
 %0A */%0Apub
@@ -1092,104 +1092,8 @@
 );%0A%0A
-%09// currently not working in Firebug 2.0.12  see https://github.com/firebug/firebug/issues/7948%0A
 %09@JS
@@ -3100,104 +3100,8 @@
 );%0A%0A
-%09// currently not working in Firebug 2.0.12  see https://github.com/firebug/firebug/issues/7948%0A
 %09pub

update comments