From 149e4345c6d581e2088bc9a8bab2cb32f9d8cf8d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 14 Jun 2008 04:01:16 -0500 Subject: [PATCH] Add sanity checks --- extra/html/components/components.factor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extra/html/components/components.factor b/extra/html/components/components.factor index 6e1a25f5f5..7355cd153d 100644 --- a/extra/html/components/components.factor +++ b/extra/html/components/components.factor @@ -10,9 +10,12 @@ IN: html.components SYMBOL: values -: value ( name -- value ) values get at ; +: check-value-name ( name -- name ) + dup string? [ "Value name not a string" throw ] unless ; -: set-value ( value name -- ) values get set-at ; +: value ( name -- value ) check-value-name values get at ; + +: set-value ( value name -- ) check-value-name values get set-at ; : blank-values ( -- ) H{ } clone values set ;