summaryrefslogtreecommitdiffstats
path: root/src/number.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-07-26 09:17:34 +0100
committerwout <wout@impinc.co.uk>2013-07-26 09:17:34 +0100
commit21d6c0b30a530ce7746f789921c7135079f43338 (patch)
treee31f12819b83222cccdaaebbb171e800e97ffff5 /src/number.js
parent0685d55d3125f212975807f540520cffb663d9a8 (diff)
downloadsvg.js-21d6c0b30a530ce7746f789921c7135079f43338.tar.gz
svg.js-21d6c0b30a530ce7746f789921c7135079f43338.zip
Added support for CommonJS and AMD, bunped to v0.300.31
Diffstat (limited to 'src/number.js')
-rw-r--r--src/number.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/number.js b/src/number.js
index e45a8c6..ae3c120 100644
--- a/src/number.js
+++ b/src/number.js
@@ -8,7 +8,8 @@ SVG.Number = function(value) {
/* parse value */
switch(typeof value) {
case 'number':
- this.value = value
+ /* ensure a valid numeric value */
+ this.value = isNaN(value) ? 0 : !isFinite(value) ? (value < 0 ? Number.MIN_VALUE : Number.MAX_VALUE) : value
break
case 'string':
var match = value.match(SVG.regex.unit)