diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2020-01-01 16:46:55 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2020-01-01 16:46:55 (GMT) |
commit | 8249e877dffdca52ba20e0ffebdc9c7bd37c30ae (patch) | |
tree | 55925828ba3151b4deed527642db917d38755074 /tools/tclOOScript.tcl | |
parent | b308bd97e6cdee90b11f3409a485253c414bbac0 (diff) | |
download | tcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.zip tcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.tar.gz tcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.tar.bz2 |
More error cases
Diffstat (limited to 'tools/tclOOScript.tcl')
-rw-r--r-- | tools/tclOOScript.tcl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/tclOOScript.tcl b/tools/tclOOScript.tcl index e10eda2..e918787 100644 --- a/tools/tclOOScript.tcl +++ b/tools/tclOOScript.tcl @@ -483,12 +483,22 @@ if {[string match "-*" $prop]} { return -code error -level 2 \ -errorcode {TCLOO PROPERTY_FORMAT} \ - "bad property name \"$prop\"; must not begin with -" + "bad property name \"$prop\": must not begin with -" } if {$prop ne [list $prop]} { return -code error -level 2 \ -errorcode {TCLOO PROPERTY_FORMAT} \ - "bad property name \"$prop\"; must be a simple word" + "bad property name \"$prop\": must be a simple word" + } + if {[string first "::" $prop] != -1} { + return -code error -level 2 \ + -errorcode {TCLOO PROPERTY_FORMAT} \ + "bad property name \"$prop\": must not contain namespace separators" + } + if {[string match {*[()]*} $prop]} { + return -code error -level 2 \ + -errorcode {TCLOO PROPERTY_FORMAT} \ + "bad property name \"$prop\": must not contain parentheses" } set realprop [string cat "-" $prop] set getter [format {::set [my varname %s]} $prop] |