[Bug 1214618] Re: apparmor policy_version is incorrectly set

Zoltan Balogh 1214618 at bugs.launchpad.net
Thu Aug 22 06:41:07 UTC 2013


I have checked if there is a way in the JS level to change the
representation of numerical values. On the JSON level the sringify
function does the first conversion we have a chance to intrude. It can
be given a replace function to overule the conversion:

--
function replacer(key, value) {
          if (key == 'policy_version'){
                var ending_zero = ".0";
                var version_value = String(value);
                var new_value = String(version_value.concat(ending_zero));
                return new_value;
        }
    return value;
}
function toJSON() {
    return JSON.stringify(jsonData, replacer);

}
--

Regardless of my clearly desperate and slightly hackish way of forcing
the .0 at the end f the value, the JS either drops the .0 when it
converts to numerical value or kindly puts the value as a string "1.0"
to the JSON file.

I assume that unless we change the very core behavior of JS how it
handles numerical values it would be way simpler to store the version
numbers in a string just as the application version is stored in a
string.

-- 
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to qtcreator in Ubuntu.
https://bugs.launchpad.net/bugs/1214618

Title:
  apparmor policy_version is incorrectly set

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtcreator/+bug/1214618/+subscriptions




More information about the kubuntu-bugs mailing list