cloudchen / grunt-template-jasmine-requirejs

RequireJS template for grunt-contrib-jasmine task
111 stars 96 forks source link

RegExp in requireConfig doesn't get stringified properly #41

Closed 1000hz closed 11 years ago

1000hz commented 11 years ago

This issue is similar to #9 Since JSON.stringify doesn't know how to represent regular expressions, something like the following config gets mangled:

  requireConfig: {
    config: {
      'tpl' : {
        evaluate  : /\{\{([\s\S]+?)\}\}/g,
        interpolate : /\{\{=([\s\S]+?)\}\}/g
      }
    }
  }

becomes:

  requireConfig: {
    config: {
      'tpl' : {
        evaluate  : {},
        interpolate : {}
      }
    }
  }

We should check for RegExp values along with the check for Functions.