зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
edb09e5551
Коммит
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче