- Added new tag: data-declare. It declares a list of items, each item is a variable name, a variable type (optional) and a default value expression (optional too). Optionally a 'required' suffix can be added. A strict mode is set to true inside the node with this attribute.
- Added some methods to context:
- setStrictMode( strictMode ). Set the value of strictMode (default value is false). If it is set to true all variables must be declared; if ZPT-JS finds a non declared variable in an expression an error occurs.
- isStrictMode(). Get the value of strictMode.
- Variable expression must match a regular expression. It is defined by zpt.context.getConf().variableNameRE and it is /^[A-Za-z0-9_/-]+$/ by default.
- errorFunction method of Context now is invoked when any error occurs except if the error is related to async preloading (in this case the asyncError method is invoked).
- Added a prefix to private vars to avoid name collision: '_'. The renamed vars are:
- onErrorVarName: "_on-error",
- onErrorStructureVarName: "_on-error-structure",
- i18nDomainVarName: "_i18nDomain"
- i18nLanguageVarName: "_i18nLanguage"
- externalMacroUrlVarName: "_externalMacroUrl"
- strictModeVarName: "_strictMode"
- declaredVarsVarName: "_declaredVars"
- repeatVarName: "_repeat"
Assets
2
-
2019-06-04T10:18:42Z
-
2019-06-04T10:18:42Z
-