From b7fc000f340f2be6f9c0e8f615aa4ae23ecf9d20 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Wed, 6 Jul 2011 08:35:31 -0400 Subject: Add client-side Basis.now and pretty-printing of times --- src/jscomp.sml | 3 +-- src/settings.sml | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/jscomp.sml b/src/jscomp.sml index d8b2d661..41811e9a 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -1,4 +1,4 @@ -(* Copyright (c) 2008-2010, Adam Chlipala +(* Copyright (c) 2008-2011, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -646,7 +646,6 @@ fun process file = val name = case Settings.jsFunc (m, x) of NONE => (EM.errorAt loc ("Unsupported FFI function " ^ m ^ "." ^ x ^ " in JavaScript"); - app (fn ((m', x'), _) => print (m' ^ "." ^ x' ^ "\n")) (Settings.allJsFuncs ()); "ERROR") | SOME s => s diff --git a/src/settings.sml b/src/settings.sml index 26aaad95..57ab956a 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -248,7 +248,11 @@ val jsFuncsBase = basisM [("alert", "alert"), ("le_time", "le"), ("debug", "alert"), - ("naughtyDebug", "alert")] + ("naughtyDebug", "alert"), + + ("now", "now"), + ("timeToString", "showTime"), + ("htmlifyTime", "showTime")] val jsFuncs = ref jsFuncsBase fun setJsFuncs ls = jsFuncs := foldl (fn ((k, v), m) => M.insert (m, k, v)) jsFuncsBase ls fun jsFunc x = M.find (!jsFuncs, x) -- cgit v1.2.3