Bug 1297082 - Part 1: Convert Curl.jsm to a CommonJS module r=Honza

MozReview-Commit-ID: LI7Ra1w3RBj

--HG--
extra : rebase_source : 28ea664d54b860e09ec3aff049a79d5948d95770
This commit is contained in:
Jarda Snajdr 2016-08-18 17:05:15 +02:00
Родитель 95dd013945
Коммит d436f89be9
6 изменённых файлов: 13 добавлений и 13 удалений

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

@ -124,12 +124,6 @@ XPCOMUtils.defineConstant(this, "Editor", Editor);
XPCOMUtils.defineLazyModuleGetter(this, "Chart",
"resource://devtools/client/shared/widgets/Chart.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Curl",
"resource://devtools/client/shared/Curl.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CurlUtils",
"resource://devtools/client/shared/Curl.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");

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

@ -31,6 +31,7 @@ const {PrefsHelper} = require("devtools/client/shared/prefs");
const {ViewHelpers, Heritage, WidgetMethods, setNamedTimeout} =
require("devtools/client/shared/widgets/view-helpers");
const {gDevTools} = require("devtools/client/framework/devtools");
const {Curl, CurlUtils} = require("devtools/client/shared/curl");
/**
* Localization convenience methods.

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

@ -1,10 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests Curl Utils functionality.
*/
const { CurlUtils } = require("devtools/client/shared/curl");
function test() {
initNetMonitor(CURL_UTILS_URL).then(([aTab, aDebuggee, aMonitor]) => {
info("Starting test... ");

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

@ -9,7 +9,6 @@ Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js",
this);
var { CurlUtils } = Cu.import("resource://devtools/client/shared/Curl.jsm", {});
var NetworkHelper = require("devtools/shared/webconsole/network-helper");
var { Toolbox } = require("devtools/client/framework/toolbox");

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

@ -37,13 +37,11 @@
"use strict";
this.EXPORTED_SYMBOLS = ["Curl", "CurlUtils"];
Components.utils.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const DEFAULT_HTTP_VERSION = "HTTP/1.1";
this.Curl = {
const Curl = {
/**
* Generates a cURL command string which can be used from the command line etc.
*
@ -138,10 +136,12 @@ this.Curl = {
}
};
exports.Curl = Curl;
/**
* Utility functions for the Curl command generator.
*/
this.CurlUtils = {
const CurlUtils = {
/**
* Check if the request is an URL encoded request.
*
@ -398,3 +398,5 @@ this.CurlUtils = {
.replace(/[\r\n]+/g, "\"^$&\"") + "\"";
}
};
exports.CurlUtils = CurlUtils;

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

@ -21,7 +21,7 @@ DevToolsModules(
'browser-loader.js',
'css-angle.js',
'css-reload.js',
'Curl.jsm',
'curl.js',
'demangle.js',
'developer-toolbar.js',
'devices.js',