Packagecom.threerings.util
Classpublic class Assert

Simple implementation of assertion checks for debug environments. When running in a debug player, each function will test the assert expression, and if it fails, log an error message with a stack trace. When running in a release player, these functions do not run any tests, and exit immediately. Note: stack dumping is controlled via the Assert.dumpStack parameter. Usage example:
   Assert.isNotNull(mystack.top());
   Assert.isTrue(mystack.length == 1, "Unexpected number of items on stack!");
 
Deprecation notes: What we really want is a way to turn off assertions at compile time. We don't want folks who happen to be running a debug player to have their player exit. And why wouldn't you always want an exception if something's going to go wrong?



Public Properties
 PropertyDefined by
  dumpStack : Boolean = true
[static] Controls whether stack dumps should be included in the error log (default value is true).
Assert
Protected Properties
 PropertyDefined by
  _debug : Boolean
[static]
Assert
  _log : Log
[static]
Assert
Public Methods
 MethodDefined by
  
fail(message:String):void
[static] Displays an error message, with an optional stack trace.
Assert
  
isFalse(value:Boolean, message:String = null):void
[static] Asserts that the value is false.
Assert
  
isNotNull(value:Object, message:String = null):void
[static] Asserts that the value is not equal to null.
Assert
  
isNull(value:Object, message:String = null):void
[static] Asserts that the value is equal to null.
Assert
  
isTrue(value:Boolean, message:String = null):void
[static] Asserts that the value is true.
Assert
Property detail
_debugproperty
protected static var _debug:Boolean
dumpStackproperty 
public static var dumpStack:Boolean = true

Controls whether stack dumps should be included in the error log (default value is true).

_logproperty 
protected static var _log:Log
Method detail
fail()method
public static function fail(message:String):void

Displays an error message, with an optional stack trace.

Parameters
message:String
isFalse()method 
public static function isFalse(value:Boolean, message:String = null):void

Asserts that the value is false.

Parameters
value:Boolean
 
message:String (default = null)
isNotNull()method 
public static function isNotNull(value:Object, message:String = null):void

Asserts that the value is not equal to null.

Parameters
value:Object
 
message:String (default = null)
isNull()method 
public static function isNull(value:Object, message:String = null):void

Asserts that the value is equal to null.

Parameters
value:Object
 
message:String (default = null)
isTrue()method 
public static function isTrue(value:Boolean, message:String = null):void

Asserts that the value is true.

Parameters
value:Boolean
 
message:String (default = null)