Another Neuromancer Bug Fixed

Chris Philips found another Bug in Neuromancer today.  Computed numbers, returned as members of a struct, were always deserialized as null.  Literal numbers, however, were handled correctly.  While debugging the problem, I realized the methods with returntype="numeric" simply refused to run as well, for much the same reason.  Both glitches are now fixed.

As before, the zip on SourceForge has not been updated, though the changes are available in the Subversion repository.  I've included a patch below for js/io/RemoteObject.js that you can use to get the fix as well.  The patch should work with or without last night's update, but I'd recommend applying them both in order.  If you want the updated test cases, you'll have to hit the SVN repository.

Index: RemoteObject.js
===================================================================
— RemoteObject.js (revision 6)
+++ RemoteObject.js (revision 7)
@@ -24,6 +24,8 @@
var DATATYPE_STRING2 = "xsd:string";
var DATATYPE_ARRAY = "soapenc:Array";
var DATATYPE_BOOLEAN = "soapenc:boolean";
+var DATATYPE_NUMBER = "soapenc:double";
+var DATATYPE_NUMBER2 = "xsd:double";

/**
* Variable: REMOTE_OBJECT_VERSION
@@ -74,11 +76,16 @@
//if(dItem.item(z).getAttribute("href")== null
// || typeof dItem.item(z).getAttribute("href") == "undefined"
// || dItem.item(z).getAttribute("href") == "")
- if(dItem.item(z).getAttribute("xsi:type") == DATATYPE_STRING)
+ var xsiType = dItem.item(z).getAttribute("xsi:type")
+ if(xsiType == DATATYPE_STRING || xsiType == DATATYPE_STRING2)
{
value = dItem.item(z).firstChild.nodeValue;
}
- else if(dItem.item(z).getAttribute("xsi:type") == DATATYPE_MAP)
+ else if (xsiType == DATATYPE_NUMBER || xsiType == DATATYPE_NUMBER2)
+ {
+ value = parseFloat(dItem.item(z).firstChild.nodeValue);
+ }
+ else if(xsiType == DATATYPE_MAP)
{
value = new Map();
//value = "!ref! " + dItem.item(z).getAttribute("href");
@@ -705,6 +712,10 @@
eval(__dfh__variable + " = resvalnodes.item(0).firstChild.nodeValue");
}
}
+ else if (returntype == DATATYPE_NUMBER || returntype == DATATYPE_NUMBER2)
+ {
+ eval(__dfh__variable + " = parseFloat(resvalnodes.item(0).firstChild.nodeValue)");
+ }
//}
//this is a structure (a coldfusion struct)
//else if(complextypeid != null && complextypeid.length > 1)

internetiniu svetainiu ir el parduotuviu kurimas, SEO optimizacija ir kitos reklamos paslaugos konkurencinga kaina https://seopaslaugos.com/seo-optimizacija-google/

Comments are closed.