summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-03-31 21:17:15 +0200
committerJose <jose@zeroc.com>2016-03-31 21:17:15 +0200
commitc666102aee0c2eeadd124540c1eae41562478eae (patch)
tree7b0a7975f9159e9910e0b11fccac03f70a330560
parentadding clean command for icestormdb on Windows (diff)
downloadice-c666102aee0c2eeadd124540c1eae41562478eae.tar.bz2
ice-c666102aee0c2eeadd124540c1eae41562478eae.tar.xz
ice-c666102aee0c2eeadd124540c1eae41562478eae.zip
ICE-7084 - JavaScript Number.isNan not implemented in IE
-rw-r--r--js/src/Ice/BasicStream.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/js/src/Ice/BasicStream.js b/js/src/Ice/BasicStream.js
index 8bfbcaa4778..bb225826be1 100644
--- a/js/src/Ice/BasicStream.js
+++ b/js/src/Ice/BasicStream.js
@@ -54,6 +54,16 @@ var FLAG_HAS_INDIRECTION_TABLE = (1<<3);
var FLAG_HAS_SLICE_SIZE = (1<<4);
var FLAG_IS_LAST_SLICE = (1<<5);
+//
+// Number.isNaN polyfill for compatibility with IE
+//
+// see: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
+//
+Number.isNaN = Number.isNaN || function(value)
+{
+ return typeof value === "number" && isNaN(value);
+}
+
var IndirectPatchEntry = function(index, patcher)
{
this.index = index;
@@ -2898,7 +2908,7 @@ var defineBuiltinHelper = function(write, read, sz, format, min, max)
writeOpt: function(os, tag, v) { os.writeOptValue(tag, format, write, v); },
readOpt: function(is, tag) { return is.readOptValue(tag, format, read); },
};
-
+
if(min !== undefined && max !== undefined)
{
helper.validate = function(v) {
@@ -2932,13 +2942,13 @@ var MAX_INT32_VALUE = 0x7FFFFFFF;
var MIN_FLOAT32_VALUE = -3.4028234664e+38;
var MAX_FLOAT32_VALUE = 3.4028234664e+38;
-Ice.ByteHelper = defineBuiltinHelper(stream.writeByte, stream.readByte, 1, Ice.OptionalFormat.F1,
+Ice.ByteHelper = defineBuiltinHelper(stream.writeByte, stream.readByte, 1, Ice.OptionalFormat.F1,
MIN_UINT8_VALUE, MAX_UINT8_VALUE);
Ice.ShortHelper = defineBuiltinHelper(stream.writeShort, stream.readShort, 2, Ice.OptionalFormat.F2,
MIN_INT16_VALUE, MAX_INT16_VALUE);
-Ice.IntHelper = defineBuiltinHelper(stream.writeInt, stream.readInt, 4, Ice.OptionalFormat.F4,
+Ice.IntHelper = defineBuiltinHelper(stream.writeInt, stream.readInt, 4, Ice.OptionalFormat.F4,
MIN_INT32_VALUE, MAX_INT32_VALUE);
Ice.FloatHelper = defineBuiltinHelper(stream.writeFloat, stream.readFloat, 4, Ice.OptionalFormat.F4,
@@ -2964,7 +2974,7 @@ Ice.LongHelper.validate = function(v)
//
// For a long to be valid both words must be within the range of UINT32
//
- return v.low >= MIN_UINT32_VALUE && v.low <= MAX_UINT32_VALUE &&
+ return v.low >= MIN_UINT32_VALUE && v.low <= MAX_UINT32_VALUE &&
v.high >= MIN_UINT32_VALUE && v.high <= MAX_UINT32_VALUE;
};