Ticket #1236 (new Bug)
Unquoted keys in JavaScript objects got compressed by FCKpackager
| Reported by: | martinkou | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | Project : FCKpackager | Version: | |
| Keywords: | Confirmed | Cc: |
Description
This bug have caused bug #1158 in FCKeditor, which appeared only in the built version.
A test case for the bug can be found below:
var key1 = "hack";
var key2 = "and";
var key3 = "slash";
var key4 = "rpg";
var obj = {key1: 'hack', key2: 'and', key3: 'slash', key4: 'rpg'};
alert( [obj.key1, obj.key2, obj.key3, obj.key4].join(' ')) ;
While the variable identifiers, key1-4 can be compressed to A to D, the object keys of the same names in obj cannot be compressed to A to D as well. However, the FCKpackager's behavior observed from bug #1158 was to compress the above code as follow:
var A="hack";var B="and";var C="slash";var D="rpg";var obj={A:'hack',B:'and',C:'slash',D:'rpg'};alert([obj.key1,obj.key2,obj.key3,obj.key4].join(' '));
Which is incorrect and changed the code's behavior.
Change History
Note: See
TracTickets for help on using
tickets.