Package org.htmlunit.corejs.javascript
Class NativeConsole
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.corejs.javascript.IdScriptableObject
-
- org.htmlunit.corejs.javascript.NativeConsole
-
- All Implemented Interfaces:
java.io.Serializable
,ConstProperties
,DebuggableObject
,IdFunctionCall
,Scriptable
,SymbolScriptable
public class NativeConsole extends IdScriptableObject
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
NativeConsole.ConsolePrinter
static class
NativeConsole.Level
-
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Object
CONSOLE_TAG
private java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicInteger>
counters
private static java.lang.String
DEFAULT_LABEL
private static java.util.regex.Pattern
FMT_REG
private static int
Id_assert
private static int
Id_count
private static int
Id_countReset
private static int
Id_debug
private static int
Id_error
private static int
Id_info
private static int
Id_log
private static int
Id_time
private static int
Id_timeEnd
private static int
Id_timeLog
private static int
Id_toSource
private static int
Id_trace
private static int
Id_warn
private static int
LAST_METHOD_ID
private static int
MAX_ID
private NativeConsole.ConsolePrinter
printer
private static long
serialVersionUID
private java.util.Map<java.lang.String,java.lang.Long>
timers
-
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
-
Constructor Summary
Constructors Modifier Constructor Description private
NativeConsole(NativeConsole.ConsolePrinter printer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
count(Context cx, Scriptable scope, java.lang.Object[] args)
private void
countReset(Context cx, Scriptable scope, java.lang.Object[] args)
java.lang.Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.protected int
findPrototypeId(java.lang.String s)
static java.lang.String
format(Context cx, Scriptable scope, java.lang.Object[] args)
private static java.lang.String
formatFloat(java.lang.Object val)
private static java.lang.String
formatInt(java.lang.Object val)
private static java.lang.String
formatObj(Context cx, Scriptable scope, java.lang.Object arg)
private static java.lang.String
formatString(java.lang.Object val)
java.lang.String
getClassName()
Return the name of the class.static void
init(Scriptable scope, boolean sealed, NativeConsole.ConsolePrinter printer)
protected void
initPrototypeId(int id)
private void
jsAssert(Context cx, Scriptable scope, java.lang.Object[] args)
private double
nano2Milli(java.lang.Long nano)
private void
print(Context cx, Scriptable scope, NativeConsole.Level level, java.lang.String msg)
private void
time(Context cx, Scriptable scope, java.lang.Object[] args)
private void
timeEnd(Context cx, Scriptable scope, java.lang.Object[] args)
private void
timeLog(Context cx, Scriptable scope, java.lang.Object[] args)
-
Methods inherited from class org.htmlunit.corejs.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getIds, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
addLazilyInitializedValue, applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildClassCtor, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, checkValidAttributes, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getBase, getBase, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putImpl, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
CONSOLE_TAG
private static final java.lang.Object CONSOLE_TAG
-
DEFAULT_LABEL
private static final java.lang.String DEFAULT_LABEL
- See Also:
- Constant Field Values
-
FMT_REG
private static final java.util.regex.Pattern FMT_REG
-
timers
private final java.util.Map<java.lang.String,java.lang.Long> timers
-
counters
private final java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicInteger> counters
-
printer
private final NativeConsole.ConsolePrinter printer
-
Id_toSource
private static final int Id_toSource
- See Also:
- Constant Field Values
-
Id_trace
private static final int Id_trace
- See Also:
- Constant Field Values
-
Id_debug
private static final int Id_debug
- See Also:
- Constant Field Values
-
Id_log
private static final int Id_log
- See Also:
- Constant Field Values
-
Id_info
private static final int Id_info
- See Also:
- Constant Field Values
-
Id_warn
private static final int Id_warn
- See Also:
- Constant Field Values
-
Id_error
private static final int Id_error
- See Also:
- Constant Field Values
-
Id_assert
private static final int Id_assert
- See Also:
- Constant Field Values
-
Id_count
private static final int Id_count
- See Also:
- Constant Field Values
-
Id_countReset
private static final int Id_countReset
- See Also:
- Constant Field Values
-
Id_time
private static final int Id_time
- See Also:
- Constant Field Values
-
Id_timeEnd
private static final int Id_timeEnd
- See Also:
- Constant Field Values
-
Id_timeLog
private static final int Id_timeLog
- See Also:
- Constant Field Values
-
LAST_METHOD_ID
private static final int LAST_METHOD_ID
- See Also:
- Constant Field Values
-
MAX_ID
private static final int MAX_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NativeConsole
private NativeConsole(NativeConsole.ConsolePrinter printer)
-
-
Method Detail
-
init
public static void init(Scriptable scope, boolean sealed, NativeConsole.ConsolePrinter printer)
-
getClassName
public java.lang.String getClassName()
Description copied from class:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in classScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeId
in classIdScriptableObject
-
execIdCall
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Description copied from class:IdScriptableObject
'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.- Specified by:
execIdCall
in interfaceIdFunctionCall
- Overrides:
execIdCall
in classIdScriptableObject
-
print
private void print(Context cx, Scriptable scope, NativeConsole.Level level, java.lang.String msg)
-
format
public static java.lang.String format(Context cx, Scriptable scope, java.lang.Object[] args)
-
formatString
private static java.lang.String formatString(java.lang.Object val)
-
formatInt
private static java.lang.String formatInt(java.lang.Object val)
-
formatFloat
private static java.lang.String formatFloat(java.lang.Object val)
-
formatObj
private static java.lang.String formatObj(Context cx, Scriptable scope, java.lang.Object arg)
-
jsAssert
private void jsAssert(Context cx, Scriptable scope, java.lang.Object[] args)
-
count
private void count(Context cx, Scriptable scope, java.lang.Object[] args)
-
countReset
private void countReset(Context cx, Scriptable scope, java.lang.Object[] args)
-
time
private void time(Context cx, Scriptable scope, java.lang.Object[] args)
-
timeEnd
private void timeEnd(Context cx, Scriptable scope, java.lang.Object[] args)
-
timeLog
private void timeLog(Context cx, Scriptable scope, java.lang.Object[] args)
-
nano2Milli
private double nano2Milli(java.lang.Long nano)
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
-