Bug 1319496 - 4. Fix context menu item IDs; r=sebastian

Context menu items used UUIDs as their prompt list item IDs. However,
prompt list items only support integers as IDs. This error didn't show
up before because JSONObject was silently ignoring the error. This patch
changes to using an incremental integer as the ID and fixes the error.
This commit is contained in:
Jim Chen 2016-11-29 12:25:53 -05:00
Родитель edb09e5551
Коммит ee7152f6a6
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -6887,10 +6887,15 @@ var Tabs = {
};
function ContextMenuItem(args) {
this.id = uuidgen.generateUUID().toString();
this.id = ContextMenuItem._nextId;
this.args = args;
// Limit to Java int range.
ContextMenuItem._nextId = (ContextMenuItem._nextId + 1) & 0x7fffffff;
}
ContextMenuItem._nextId = 1;
ContextMenuItem.prototype = {
get order() {
return this.args.order || 0;