mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1378824 - Stop using sdk/util/uuid in DevTools. r=jdescottes
MozReview-Commit-ID: 18nh2NT5fEE --HG-- extra : rebase_source : 090b83b70f158d291337abbf2dedb898ef941c84
This commit is contained in:
parent
dc857a8098
commit
8877005317
@ -105,7 +105,7 @@ module.exports = envConfig => {
|
||||
"method": path.join(__dirname, "../../../addon-sdk/source/lib/method"),
|
||||
"modules/libpref/init/all":
|
||||
path.join(__dirname, "../../../modules/libpref/init/all.js"),
|
||||
"sdk/util/uuid":
|
||||
"devtools/shared/generate-uuid":
|
||||
path.join(__dirname, "./webpack/uuid-sham.js"),
|
||||
"sdk": path.join(__dirname, "../../../addon-sdk/source/lib/sdk"),
|
||||
"Services": path.join(__dirname, "../shared/shim/Services.js"),
|
||||
@ -163,4 +163,4 @@ module.exports = envConfig => {
|
||||
webpackConfig.babelExcludes = /(devtools(\/|\\)|addon-sdk(\/|\\)|modules(\/|\\))/;
|
||||
|
||||
return toolboxConfig(webpackConfig, envConfig);
|
||||
};
|
||||
};
|
@ -10,10 +10,10 @@ const s4 = function () {
|
||||
.substring(1);
|
||||
};
|
||||
|
||||
let uuid = function () {
|
||||
let generateUUID = function () {
|
||||
return "ss-s-s-s-sss".replace(/s/g, function () {
|
||||
return s4();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = { uuid };
|
||||
module.exports = { generateUUID };
|
||||
|
@ -3,7 +3,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const uuidgen = require("sdk/util/uuid").uuid;
|
||||
const { generateUUID } = require("devtools/shared/generate-uuid");
|
||||
const defer = require("devtools/shared/defer");
|
||||
const {
|
||||
entries, toObject, executeSoon
|
||||
@ -17,7 +17,7 @@ function promiseMiddleware({ dispatch, getState }) {
|
||||
}
|
||||
|
||||
const promiseInst = action[PROMISE];
|
||||
const seqId = uuidgen().toString();
|
||||
const seqId = generateUUID().toString();
|
||||
|
||||
// Create a new action that doesn't have the promise field and has
|
||||
// the `seqId` field that represents the sequence id
|
||||
|
16
devtools/shared/generate-uuid.js
Normal file
16
devtools/shared/generate-uuid.js
Normal file
@ -0,0 +1,16 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { Cc, Ci } = require("chrome");
|
||||
const { generateUUID } =
|
||||
Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
|
||||
/**
|
||||
* Returns a new `uuid`.
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = { generateUUID };
|
@ -59,6 +59,7 @@ DevToolsModules(
|
||||
'event-emitter.js',
|
||||
'extend.js',
|
||||
'flags.js',
|
||||
'generate-uuid.js',
|
||||
'indentation.js',
|
||||
'l10n.js',
|
||||
'loader-plugin-raw.jsm',
|
||||
|
Loading…
Reference in New Issue
Block a user