mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
added ASSERT, fixed #103
This commit is contained in:
parent
55eff36f34
commit
dfa71bc8e5
17 changed files with 249 additions and 153 deletions
21
app/Lib/Utilities/Assert.js
Normal file
21
app/Lib/Utilities/Assert.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
define([
|
||||
"Lib/Utilities/Exception"
|
||||
],
|
||||
|
||||
function (Exception) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var Assert = {};
|
||||
|
||||
Assert.number = function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
if(isNaN(parseFloat(arguments[i]))) {
|
||||
throw new Exception("Assert: not a number ", JSON.stringify(arguments));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return Assert;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue