diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-07-21 21:07:15 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-07-21 21:07:15 -0400 |
commit | 67e203426abe889946a755ba95dfa4e856348ec4 (patch) | |
tree | 7722ce2ecf232751b9c69503698efd6661b4d04e /src | |
parent | 2fa860df89c8680b4782308511a74244e0179b4e (diff) |
Fix bug in handling of event attributes within client-side widgets
Diffstat (limited to 'src')
-rw-r--r-- | src/monoize.sml | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 403e0b84..7b1da97a 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -3441,10 +3441,21 @@ fun monoExp (env, st, fm) (all as (e, loc)) = | (x, e, _) => if String.isPrefix "On" x then let + val arg = if String.isPrefix "Onkey" x then + SOME (L'.EFfiApp ("Basis", "keyEvent", []), loc) + else if String.isSuffix "click" x orelse String.isPrefix "Onmouse" x then + SOME (L'.EFfiApp ("Basis", "mouseEvent", []), loc) + else + NONE + + val e = liftExpInExp 0 e + + val e = case arg of + NONE => e + | SOME arg => (L'.EApp (e, arg), loc) + val e = (L'.EAbs ("_", (L'.TRecord [], loc), (L'.TRecord [], loc), - (L'.EApp ((L'.EApp (liftExpInExp 0 e, - (L'.EFfiApp ("Basis", "kc", []), loc)), - loc), (L'.ERecord [], loc)), loc)), loc) + (L'.EApp (e, (L'.ERecord [], loc)), loc)), loc) in case x of "Onkeyup" => |