Fix sum type equality check
commit17a76cf4c3d48ef5d912f1491594ab2ce6f6b81c
authorMax New <maxsnew@gmail.com>
dateTue 6 May 2014, 10:45 (12 years ago)
parent52a5ca0
libraries/Native/Utils.js+10−1
@@ -16,7 +16,16 @@ Elm.Native.Utils.make = function(elm) {
1616 var c = 0;
1717 for (var i in x) {
1818 ++c;
19− stack.push({ 'x': x[i], 'y': y[i] });
19+ if (i in y) {
20+ if (i !== 'ctor') {
21+ stack.push({ 'x': x[i], 'y': y[i] });
22+ }
23+ } else {
24+ return false;
25+ }
26+ }
27+ if ('ctor' in x) {
28+ stack.push({'x': x.ctor, 'y': y.ctor});
2029 }
2130 if (c !== Object.keys(y).length) {
2231 return false;