Opened 18 years ago
Closed 17 years ago
#1244 closed Bug (fixed)
Wrong variable renaming related to constants
Reported by: | Frederico Caldeira Knabben | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Project : CKPackager | Version: | |
Keywords: | Cc: |
Description
The following variables:
var IDM_ASSIGNABLEUNIT = 28; var IDM_CHAPTER = 29; var IDM_SECTION = 30; var IDM_PAGE = 31; var IDM_OBJECT = 32; var IDM_ACTION = 33;
Get changed to this:
var IDM_ASSIGNABLEUNIT = 28; var IDM_2 = 29; var IDM_3 = 30; var IDM_4 = 31; var IDM_OBJECT = 32; var IDM_6 = 33;
Because of the following definitions in the fckpackager.xml file:
<Constant name="CHAPTER" value="2" /> <Constant name="SECTION" value="3" /> <Constant name="PAGE" value="4" /> <Constant name="CWOBJECT" value="5" /> <Constant name="ACTION" value="6" />
Change History (2)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
The packager output is now:
var IDM_ASSIGNABLEUNIT=28;var IDM_CHAPTER=29;var IDM_SECTION=30;var IDM_PAGE=31;var IDM_OBJECT=32;var IDM_ACTION=33;
as is suppose to be.
I was able to fix this behavior by modifying fckpackager.php
FCKConstantProcessor class:
The changes are in the lookbehind var s was changed to var\s and \w was added as a condition. The \s matches the condition in the code above this (in fckpackager.php) that checks for a constant's declaration. The \w keeps the packager from modifying subparts of other variables and fixes the problem stated in this bug.
We currently pack some 181 js files, the largest being approx. 350k bytes. We do not see any issues with the above code, but wanted to post this description in the event there is a special case we are missing.