diff options
author | Jose <jose@zeroc.com> | 2015-03-10 10:23:44 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2015-03-10 10:23:44 +0100 |
commit | fd8bc78f8dea97b6eda7f185ea8d7fb42cfbd429 (patch) | |
tree | 466a048c0f0f61996b63e3e7a5e3c87f7e163f59 /js | |
parent | ICE-6342 forgot to fix demo script (diff) | |
download | ice-fd8bc78f8dea97b6eda7f185ea8d7fb42cfbd429.tar.bz2 ice-fd8bc78f8dea97b6eda7f185ea8d7fb42cfbd429.tar.xz ice-fd8bc78f8dea97b6eda7f185ea8d7fb42cfbd429.zip |
Minor JS style fixes
Diffstat (limited to 'js')
-rw-r--r-- | js/src/Ice/BasicStream.js | 6 | ||||
-rw-r--r-- | js/src/Ice/EnumBase.js | 4 | ||||
-rw-r--r-- | js/test/Ice/defaultValue/Client.js | 40 | ||||
-rw-r--r-- | js/test/Ice/operations/Twoways.js | 28 | ||||
-rw-r--r-- | js/test/Ice/operationsBidir/MyDerivedClassI.js | 2 |
5 files changed, 40 insertions, 40 deletions
diff --git a/js/src/Ice/BasicStream.js b/js/src/Ice/BasicStream.js index 50b445bc827..97e803c3ab3 100644 --- a/js/src/Ice/BasicStream.js +++ b/js/src/Ice/BasicStream.js @@ -2899,11 +2899,11 @@ var defineBuiltinHelper = function(write, read, sz, format, min, max) readOpt: function(is, tag) { return is.readOptValue(tag, format, read); }, }; - if(min !== undefined && max != undefined) + if(min !== undefined && max !== undefined) { helper.validate = function(v) { return v >= min && v <= max; - } + }; } defineProperty(helper, "minWireSize", { get: function() { return sz; } @@ -2956,7 +2956,7 @@ Ice.LongHelper.validate = function(v) // return v.low >= MIN_UINT32_VALUE && v.low <= MAX_UINT32_VALUE && v.high >= MIN_UINT32_VALUE && v.high <= MAX_UINT32_VALUE; -} +}; Ice.StringHelper = defineBuiltinHelper(stream.writeString, stream.readString, 1, Ice.OptionalFormat.VSize); diff --git a/js/src/Ice/EnumBase.js b/js/src/Ice/EnumBase.js index 0eaaa7abf78..6e500530815 100644 --- a/js/src/Ice/EnumBase.js +++ b/js/src/Ice/EnumBase.js @@ -128,7 +128,7 @@ Slice.defineEnum = function(enumerators) { os.writeEnum(firstEnum); } - } + }; type.__read = function(is) { return is.readEnum(type); @@ -142,7 +142,7 @@ Slice.defineEnum = function(enumerators) type.__write(os, v); } } - } + }; type.__readOpt = function(is, tag) { return is.readOptEnum(tag, type); diff --git a/js/test/Ice/defaultValue/Client.js b/js/test/Ice/defaultValue/Client.js index 9721990229a..ef3b47fb1a2 100644 --- a/js/test/Ice/defaultValue/Client.js +++ b/js/test/Ice/defaultValue/Client.js @@ -166,33 +166,33 @@ out.write("testing default constructor... "); var v2 = new Test.StructNoDefaults(); - test(v2.bo == false); - test(v2.b == 0); - test(v2.s == 0); - test(v2.i == 0); - test(v2.l == 0); - test(v2.f == 0.0); - test(v2.d == 0.0); - test(v2.str == ""); + test(v2.bo === false); + test(v2.b === 0); + test(v2.s === 0); + test(v2.i === 0); + test(v2.l === 0); + test(v2.f === 0.0); + test(v2.d === 0.0); + test(v2.str === ""); test(v2.c1 == Test.Color.red); - test(v2.bs == null); - test(v2.is == null); - test(v2.st != null && v2.st instanceof Test.InnerStruct); - test(v2.dict == null); + test(v2.bs === null); + test(v2.is === null); + test(v2.st !== null && v2.st instanceof Test.InnerStruct); + test(v2.dict === null); var e = new Test.ExceptionNoDefaults(); - test(e.str == ""); + test(e.str === ""); test(e.c1 == Test.Color.red); - test(e.bs == null); - test(e.st != null && e.st instanceof Test.InnerStruct); - test(e.dict == null); + test(e.bs === null); + test(e.st !== null && e.st instanceof Test.InnerStruct); + test(e.dict === null); var cl = new Test.ClassNoDefaults(); - test(cl.str == ""); + test(cl.str === ""); test(cl.c1 == Test.Color.red); - test(cl.bs == null); - test(cl.st != null && cl.st instanceof Test.InnerStruct); - test(cl.dict == null); + test(cl.bs === null); + test(cl.st !== null && cl.st instanceof Test.InnerStruct); + test(cl.dict === null); out.writeLine("ok"); } diff --git a/js/test/Ice/operations/Twoways.js b/js/test/Ice/operations/Twoways.js index 5438f4bebcb..f5777d5c6d5 100644 --- a/js/test/Ice/operations/Twoways.js +++ b/js/test/Ice/operations/Twoways.js @@ -1488,13 +1488,13 @@ ).then( function() { - d = Test.MyDerivedClassPrx.uncheckedCast(prx); - s = new Test.MyStruct1(); + var d = Test.MyDerivedClassPrx.uncheckedCast(prx); + var s = new Test.MyStruct1(); s.tesT = "Test.MyStruct1.s"; s.myClass = null; s.myStruct1 = "Test.MyStruct1.myStruct1"; - c = new Test.MyClass1(); + var c = new Test.MyClass1(); c.tesT = "Test.MyClass1.testT"; c.myClass = null; c.myClass1 = "Test.MyClass1.myClass1"; @@ -1521,25 +1521,25 @@ test(arguments[0][0] == 0xFF); test(arguments[1][0] == 0x7FFF); test(arguments[2][0] == 0x7FFFFFFF); - l = arguments[3][0]; + var l = arguments[3][0]; test(l.high == 0x7FFFFFFF && l.low == 0xFFFFFFFF); test(arguments[4][0] == 1.0); test(arguments[5][0] == 1.0); test(arguments[6][0] == "opString1"); - test(arguments[7][0].length == 0); - test(arguments[8][0].size == 0); - test(arguments[9][0].length == 0); - test(arguments[10][0].size == 0); + test(arguments[7][0].length === 0); + test(arguments[8][0].size === 0); + test(arguments[9][0].length === 0); + test(arguments[10][0].size === 0); s = arguments[11][0]; - test(s.tesT == "Test.MyStruct1.s") - test(s.myClass == null) - test(s.myStruct1 == "Test.MyStruct1.myStruct1") + test(s.tesT == "Test.MyStruct1.s"); + test(s.myClass === null); + test(s.myStruct1 == "Test.MyStruct1.myStruct1"); c = arguments[12][0]; - test(c.tesT == "Test.MyClass1.testT") - test(c.myClass == null) - test(c.myClass1 == "Test.MyClass1.myClass1") + test(c.tesT == "Test.MyClass1.testT"); + test(c.myClass === null); + test(c.myClass1 == "Test.MyClass1.myClass1"); }); } ).then( diff --git a/js/test/Ice/operationsBidir/MyDerivedClassI.js b/js/test/Ice/operationsBidir/MyDerivedClassI.js index 686681ba1a2..d859781ce45 100644 --- a/js/test/Ice/operationsBidir/MyDerivedClassI.js +++ b/js/test/Ice/operationsBidir/MyDerivedClassI.js @@ -481,7 +481,7 @@ opMyStruct1: function(value, current) { - return value + return value; } }); |