Skip to content

regular expression used as defaults value of a module, is corrupted. #3237

@eouia

Description

@eouia

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)
}

The Result;
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions