mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
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:
parent
edb09e5551
commit
ee7152f6a6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user