# HG changeset patch # User Adam Chlipala # Date 1251227940 14400 # Node ID 771449d8b4118d4837d2a364bbd1242b86c33c7f # Parent 12c77dc567a2bc4fe198985e78c313639eee061d Fix inconsistency in bool URLification between C and JavaScript diff -r 12c77dc567a2 -r 771449d8b411 lib/js/urweb.js --- a/lib/js/urweb.js Tue Aug 25 14:50:19 2009 -0400 +++ b/lib/js/urweb.js Tue Aug 25 15:19:00 2009 -0400 @@ -471,6 +471,10 @@ return unescape(s.replace(new RegExp ("\\+", "g"), " ")); } +function ub(b) { + return b ? "1" : "0"; +} + function uul(getToken, getData) { var tok = getToken(); if (tok == "Nil") { diff -r 12c77dc567a2 -r 771449d8b411 src/jscomp.sml --- a/src/jscomp.sml Tue Aug 25 14:50:19 2009 -0400 +++ b/src/jscomp.sml Tue Aug 25 15:19:00 2009 -0400 @@ -428,7 +428,7 @@ | TFfi ("Basis", "float") => ("parseFloat(t[i++])", st) | TFfi ("Basis", "channel") => ("(t[i++].length > 0 ? parseInt(t[i]) : null)", st) - | TFfi ("Basis", "bool") => ("t[i++] == \"True\"", st) + | TFfi ("Basis", "bool") => ("t[i++] == \"1\"", st) | TOption t => let diff -r 12c77dc567a2 -r 771449d8b411 src/settings.sml --- a/src/settings.sml Tue Aug 25 14:50:19 2009 -0400 +++ b/src/settings.sml Tue Aug 25 15:19:00 2009 -0400 @@ -143,7 +143,7 @@ ("urlifyInt", "ts"), ("urlifyFloat", "ts"), ("urlifyString", "uf"), - ("urlifyBool", "bs"), + ("urlifyBool", "ub"), ("recv", "rv"), ("strcat", "cat"), ("intToString", "ts"),