diff options
author | Christian Schneider | 2018-05-03 17:48:27 +0200 |
---|---|---|
committer | Christian Schneider | 2018-05-03 17:48:27 +0200 |
commit | 49cb7482b57046d69c15eea7737716229ba08ef8 (patch) | |
tree | 609e0b701b793719d6f4a9687b89ed53a8bee182 /it_html.class | |
parent | e649b1a12fe4b43063753e482a47fcda0cbeb9d7 (diff) | |
download | itools-49cb7482b57046d69c15eea7737716229ba08ef8.tar.gz itools-49cb7482b57046d69c15eea7737716229ba08ef8.tar.bz2 itools-49cb7482b57046d69c15eea7737716229ba08ef8.zip |
Generate it::error when trying to redefine function for a tag
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/it_html.class b/it_html.class index e410816..5828438 100644 --- a/it_html.class +++ b/it_html.class @@ -88,6 +88,7 @@ function __construct($p = array()) 'title' => '', # HTML title (default: no title added) 'use_it_state' => false, # If true, generate code needed by state.js (aka 'history iframe') 'srclines' => $GLOBALS['debug_srclines'], # append stackdump to each tag + 'error_on_redefine' => true, # Generate it::error when trying to redefine function for a tag ); $this->p['notexported'] = trim($p['notexported'] . ',configure,sanitize,comment', ','); @@ -111,6 +112,8 @@ function __construct($p = array()) { if (!function_exists($func) && $func) $code[$func] = "function $func() { \$args = func_get_args(); return \$GLOBALS['{$this->p['name']}']->_tag('$func', \$args); }"; + else if ($this->p['error_on_redefine']) + it::error("Trying to redefine existing function '$func' in it_html"); } # Create global functions for it_html methods |