#2694 JS: Deserialisation bug

SlimerDude Wed 2 May 2018

In Fantom JS, when attempting to deserialise an object with a custom Type name:

using acme::MyMegaObj as Mega

Mega { ... }

I get an equals is not a function error. This small patch fixes it, although I've not run it against any test suites:

diff -r e69a30a90273 src/sys/js/fanx/ObjDecoder.js
--- a/src/sys/js/fanx/ObjDecoder.js	Tue Apr 10 13:58:43 2018 -0400
+++ b/src/sys/js/fanx/ObjDecoder.js	Wed May 02 16:02:47 2018 +0100
@@ -702,6 +702,6 @@
 function fanx_UsingType(t,n) { this.type = t; this.name = n; }
 fanx_UsingType.prototype.resolve = function(n)
 {
-  return this.name.equals(n) ? this.type : null;
+  return this.name == n ? this.type : null;
 }

andy Wed 2 May 2018

Ticket promoted to #2694 and assigned to andy

andy Wed 2 May 2018

Ticket resolved in 1.0.71

Yep -- pushed a fix to tip

Login or Signup to reply.