Opened 11 years ago
Closed 9 years ago
#10901 closed enhancement (fixed)
i18nUtil.flattenLayerFileBundles regular expression not general enough
Reported by: | yveskurz | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | low | Milestone: | 1.8 |
Component: | BuildSystem | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In "util/trunk/buildscripts/jslib/i18nUtil.js" function "flattenLayerFileBundles()" is a regular expression which should match all calls to dojo.requireLocalization(). This regular expression can be improved by allowing whitespace characters between function name its arguments and the semicolon.
Current regular expression:
var requireStatements = fileContents.match(/dojo\.requireLocalization\(.*\)\;/g);
More flexible expression:
var requireStatements = fileContents.match(/dojo\.requireLocalization\s*\(.*\)\s*\;/g);
This allows recognizing statements like: dojo.requireLocalization (...) ;
Change History (6)
comment:1 Changed 11 years ago by
Component: | General → BuildSystem |
---|---|
Owner: | changed from anonymous to James Burke |
comment:2 Changed 11 years ago by
Milestone: | tbd → 1.6 |
---|
comment:3 Changed 10 years ago by
Milestone: | 1.6 → future |
---|
comment:4 Changed 9 years ago by
Owner: | changed from James Burke to Rawld Gill |
---|
Bulk update to assign BuildSystem? tickets to Rawld. Many of these are probably already fixed in 1.7.
comment:5 Changed 9 years ago by
Milestone: | future → 1.8 |
---|---|
Priority: | high → low |
Status: | new → assigned |
The regex hell of the past can be completely circumvented by using AMD modules. That said, I'll take a look and fix if this particular regex is being used in any of the backcompat.
comment:6 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Type: | defect → enhancement |
The algorithm for sniffing legacy loader API calls was improved in 1.7. The new algorithm
- does not use this regular expression
- handles spaces correctly
See the function extractLegacyApiApplications
in dojo/_base\loader.js for details.
(sadly) punting seemingly abandoned ticket and meta tickets to future