wisemapping-open-source/core-js/src/main/javascript/Functions.js

28 lines
591 B
JavaScript
Raw Normal View History

2011-08-09 06:45:24 +02:00
/*
Function: $defined
Returns true if the passed in value/object is defined, that means is not null or undefined.
Arguments:
obj - object to inspect
*/
$defined = function(obj) {
return (obj != undefined);
};
$assert = function(assert, message) {
if (!$defined(assert) || !assert) {
var stack;
try {
null.eval();
} catch(e) {
stack = e;
}
console.log(message + "," + stack);
throw message;
// wLogger.error(message + "," + stack);
2011-08-09 06:45:24 +02:00
// core.Logger.logError(message + "," + stack);
}
};