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 interfaceNativeConsole.ConsolePrinterstatic classNativeConsole.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.ObjectCONSOLE_TAGprivate java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicInteger>countersprivate static java.lang.StringDEFAULT_LABELprivate static java.util.regex.PatternFMT_REGprivate static intId_assertprivate static intId_countprivate static intId_countResetprivate static intId_debugprivate static intId_errorprivate static intId_infoprivate static intId_logprivate static intId_timeprivate static intId_timeEndprivate static intId_timeLogprivate static intId_toSourceprivate static intId_traceprivate static intId_warnprivate static intLAST_METHOD_IDprivate static intMAX_IDprivate NativeConsole.ConsolePrinterprinterprivate static longserialVersionUIDprivate 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 privateNativeConsole(NativeConsole.ConsolePrinter printer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcount(Context cx, Scriptable scope, java.lang.Object[] args)private voidcountReset(Context cx, Scriptable scope, java.lang.Object[] args)java.lang.ObjectexecIdCall(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 intfindPrototypeId(java.lang.String s)static java.lang.Stringformat(Context cx, Scriptable scope, java.lang.Object[] args)private static java.lang.StringformatFloat(java.lang.Object val)private static java.lang.StringformatInt(java.lang.Object val)private static java.lang.StringformatObj(Context cx, Scriptable scope, java.lang.Object arg)private static java.lang.StringformatString(java.lang.Object val)java.lang.StringgetClassName()Return the name of the class.static voidinit(Scriptable scope, boolean sealed, NativeConsole.ConsolePrinter printer)protected voidinitPrototypeId(int id)private voidjsAssert(Context cx, Scriptable scope, java.lang.Object[] args)private doublenano2Milli(java.lang.Long nano)private voidprint(Context cx, Scriptable scope, NativeConsole.Level level, java.lang.String msg)private voidtime(Context cx, Scriptable scope, java.lang.Object[] args)private voidtimeEnd(Context cx, Scriptable scope, java.lang.Object[] args)private voidtimeLog(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:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeIdin 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:
execIdCallin interfaceIdFunctionCall- Overrides:
execIdCallin 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:
findPrototypeIdin classIdScriptableObject
-
-