-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Description
Recently, I found that when the regular expression is used as the default config value of a module, it would be corrupted.
I think it comes from configMerge or somewhere, but I cannot track exactly where the issue lies.
How to represent/prove
set some fields in defaults of MODULENAME.JS and config of config.js
// In module file
Module.register("TEST", {
defaults: {
rex_default1: /ab+c/,
rex_default2: [ 'ab+c', /ab+c/, new RegExp('ab+c') ],
rex_config1: null,
rex_config2: [],
...// in config.js
{
module: 'TEST',
config: {
rex_config1: /ab+c/,
rex_config2: [ 'ab+c', /ab+c/, new RegExp('ab+c') ],
...
//Let's check which values are there.
start: function () {
console.log(this.config)
}