Opened 12 years ago

Closed 10 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:


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 12 years ago by Adam Peller

Component: GeneralBuildSystem
Owner: changed from anonymous to James Burke

comment:2 Changed 12 years ago by James Burke

Milestone: tbd1.6

comment:3 Changed 11 years ago by bill

Milestone: 1.6future

(sadly) punting seemingly abandoned ticket and meta tickets to future

comment:4 Changed 10 years ago by bill

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 10 years ago by Rawld Gill

Milestone: future1.8
Priority: highlow
Status: newassigned

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 10 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed
Type: defectenhancement

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.

Note: See TracTickets for help on using tickets.