Bug 1338567 - Update debugger frontend (2/10/2017) r=jdescottes.

MozReview-Commit-ID: 8N2LMc5i1Sn
This commit is contained in:
Jason Laster 2017-02-11 07:03:00 +08:00
parent c9f00b0447
commit a41ccf9765
17 changed files with 56537 additions and 39480 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -21,11 +21,11 @@
src="chrome://devtools/content/shared/theme-switching.js"></script>
<script type="text/javascript">
const { BrowserLoader } = Components.utils.import("resource://devtools/client/shared/browser-loader.js", {});
const { require: devtoolsRequire } = BrowserLoader({
const { require } = BrowserLoader({
baseURI: "resource://devtools/client/debugger/new/",
window,
});
Debugger = require("devtools/client/debugger/new/debugger");
</script>
<script type="text/javascript" src="resource://devtools/client/debugger/new/debugger.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@
DevToolsModules(
'debugger.css',
'debugger.js',
'integration-tests.js',
'panel.js',
'pretty-print-worker.js',
'source-map-worker.js'

View File

@ -1,34 +1,19 @@
var Debugger =
/******/ (function(modules) { // webpackBootstrap
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // SingleModulePlugin
/******/ const smpCache = this.smpCache = this.smpCache || {};
/******/ const smpMap = this.smpMap = this.smpMap || new Map();
/******/ function sanitizeString(text) {
/******/ return text.replace(/__webpack_require__\(\d+\)/g,"");
/******/ }
/******/ function getModuleBody(id) {
/******/ if (smpCache.hasOwnProperty(id)) {
/******/ return smpCache[id];
/******/ }
/******/
/******/ const body = sanitizeString(String(modules[id]));
/******/ smpCache[id] = body;
/******/ return body;
/******/ }
/******/ if (!installedModules[moduleId]) {
/******/ const body = getModuleBody(moduleId);
/******/ if (smpMap.has(body)) {
/******/ installedModules[moduleId] = installedModules[smpMap.get(body)];
/******/ }
/******/ else {
/******/ smpMap.set(body, moduleId)
/******/ }
/******/ }
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
@ -70,17 +55,19 @@ var Debugger =
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(679);
module.exports = __webpack_require__(527);
/***/ },
/***/ 252:
/***/ 197:
/***/ function(module, exports) {
"use strict";
function assert(condition, message) {
if (!condition) {
throw new Error(`Assertion failure: ${ message }`);
throw new Error(`Assertion failure: ${message}`);
}
}
@ -88,11 +75,13 @@ var Debugger =
/***/ },
/***/ 679:
/***/ 527:
/***/ function(module, exports, __webpack_require__) {
var prettyFast = __webpack_require__(680);
var assert = __webpack_require__(252);
"use strict";
var prettyFast = __webpack_require__(528);
var assert = __webpack_require__(197);
function prettyPrint(_ref) {
var url = _ref.url,
@ -110,7 +99,7 @@ var Debugger =
mappings: prettified.map._mappings
};
} catch (e) {
return new Error(`${ e.message }\n${ e.stack }`);
throw new Error(`${e.message}\n${e.stack}`);
}
}
@ -156,7 +145,7 @@ var Debugger =
/***/ },
/***/ 680:
/***/ 528:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* -*- indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
@ -178,8 +167,8 @@ var Debugger =
}(this, function () {
"use strict";
var acorn = this.acorn || __webpack_require__(681);
var sourceMap = this.sourceMap || __webpack_require__(682);
var acorn = this.acorn || __webpack_require__(529);
var sourceMap = this.sourceMap || __webpack_require__(530);
var SourceNode = sourceMap.SourceNode;
// If any of these tokens are seen before a "[" token, we know that "[" token
@ -1038,7 +1027,7 @@ var Debugger =
/***/ },
/***/ 681:
/***/ 529:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Acorn is a tiny, fast JavaScript parser written in JavaScript.
@ -3698,7 +3687,7 @@ var Debugger =
/***/ },
/***/ 682:
/***/ 530:
/***/ function(module, exports, __webpack_require__) {
/*
@ -3706,14 +3695,14 @@ var Debugger =
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.SourceMapGenerator = __webpack_require__(683).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(689).SourceMapConsumer;
exports.SourceNode = __webpack_require__(691).SourceNode;
exports.SourceMapGenerator = __webpack_require__(531).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(537).SourceMapConsumer;
exports.SourceNode = __webpack_require__(539).SourceNode;
/***/ },
/***/ 683:
/***/ 531:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3727,10 +3716,10 @@ var Debugger =
}
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
var base64VLQ = __webpack_require__(684);
var util = __webpack_require__(686);
var ArraySet = __webpack_require__(687).ArraySet;
var MappingList = __webpack_require__(688).MappingList;
var base64VLQ = __webpack_require__(532);
var util = __webpack_require__(534);
var ArraySet = __webpack_require__(535).ArraySet;
var MappingList = __webpack_require__(536).MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
@ -4120,7 +4109,7 @@ var Debugger =
/***/ },
/***/ 684:
/***/ 532:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4164,7 +4153,7 @@ var Debugger =
}
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
var base64 = __webpack_require__(685);
var base64 = __webpack_require__(533);
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
@ -4269,7 +4258,7 @@ var Debugger =
/***/ },
/***/ 685:
/***/ 533:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4318,7 +4307,7 @@ var Debugger =
/***/ },
/***/ 686:
/***/ 534:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4644,7 +4633,7 @@ var Debugger =
/***/ },
/***/ 687:
/***/ 535:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4658,7 +4647,7 @@ var Debugger =
}
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
var util = __webpack_require__(686);
var util = __webpack_require__(534);
/**
* A data structure which is a combination of an array and a set. Adding a new
@ -4748,7 +4737,7 @@ var Debugger =
/***/ },
/***/ 688:
/***/ 536:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4762,7 +4751,7 @@ var Debugger =
}
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
var util = __webpack_require__(686);
var util = __webpack_require__(534);
/**
* Determine whether mappingB is after mappingA with respect to generated
@ -4841,7 +4830,7 @@ var Debugger =
/***/ },
/***/ 689:
/***/ 537:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4855,10 +4844,10 @@ var Debugger =
}
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
var util = __webpack_require__(686);
var binarySearch = __webpack_require__(690);
var ArraySet = __webpack_require__(687).ArraySet;
var base64VLQ = __webpack_require__(684);
var util = __webpack_require__(534);
var binarySearch = __webpack_require__(538);
var ArraySet = __webpack_require__(535).ArraySet;
var base64VLQ = __webpack_require__(532);
/**
* A SourceMapConsumer instance represents a parsed source map which we can
@ -5423,7 +5412,7 @@ var Debugger =
/***/ },
/***/ 690:
/***/ 538:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -5510,7 +5499,7 @@ var Debugger =
/***/ },
/***/ 691:
/***/ 539:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
@ -5524,8 +5513,8 @@ var Debugger =
}
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
var SourceMapGenerator = __webpack_require__(683).SourceMapGenerator;
var util = __webpack_require__(686);
var SourceMapGenerator = __webpack_require__(531).SourceMapGenerator;
var util = __webpack_require__(534);
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
@ -5931,5 +5920,7 @@ var Debugger =
/***/ }
/******/ });
/******/ })
});
;
//# sourceMappingURL=pretty-print-worker.js.map

View File

@ -1,34 +1,19 @@
var Debugger =
/******/ (function(modules) { // webpackBootstrap
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // SingleModulePlugin
/******/ const smpCache = this.smpCache = this.smpCache || {};
/******/ const smpMap = this.smpMap = this.smpMap || new Map();
/******/ function sanitizeString(text) {
/******/ return text.replace(/__webpack_require__\(\d+\)/g,"");
/******/ }
/******/ function getModuleBody(id) {
/******/ if (smpCache.hasOwnProperty(id)) {
/******/ return smpCache[id];
/******/ }
/******/
/******/ const body = sanitizeString(String(modules[id]));
/******/ smpCache[id] = body;
/******/ return body;
/******/ }
/******/ if (!installedModules[moduleId]) {
/******/ const body = getModuleBody(moduleId);
/******/ if (smpMap.has(body)) {
/******/ installedModules[moduleId] = installedModules[smpMap.get(body)];
/******/ }
/******/ else {
/******/ smpMap.set(body, moduleId)
/******/ }
/******/ }
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
@ -70,7 +55,7 @@ var Debugger =
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(692);
module.exports = __webpack_require__(540);
/***/ },
@ -92,7 +77,7 @@ var Debugger =
/***/ },
/***/ 125:
/***/ 127:
/***/ function(module, exports) {
function networkRequest(url, opts) {
@ -128,9 +113,11 @@ var Debugger =
/***/ },
/***/ 250:
/***/ 195:
/***/ function(module, exports) {
"use strict";
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
@ -181,7 +168,7 @@ var Debugger =
*/
function truncateStr(str, size) {
if (str.length > size) {
return `${ str.slice(0, size) }...`;
return `${str.slice(0, size)}...`;
}
return str;
}
@ -192,7 +179,7 @@ var Debugger =
*/
function endTruncateStr(str, size) {
if (str.length > size) {
return `...${ str.slice(str.length - size) }`;
return `...${str.slice(str.length - size)}`;
}
return str;
}
@ -356,6 +343,10 @@ var Debugger =
};
}
function waitForMs(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
module.exports = {
handleError,
promisify,
@ -368,17 +359,20 @@ var Debugger =
mapObject,
compose,
updateObj,
throttle
throttle,
waitForMs
};
/***/ },
/***/ 252:
/***/ 197:
/***/ function(module, exports) {
"use strict";
function assert(condition, message) {
if (!condition) {
throw new Error(`Assertion failure: ${ message }`);
throw new Error(`Assertion failure: ${message}`);
}
}
@ -386,20 +380,20 @@ var Debugger =
/***/ },
/***/ 295:
/***/ 207:
/***/ function(module, exports, __webpack_require__) {
"use strict";
/**
* Utils for working with Source URLs
* @module utils/source
*/
var _require = __webpack_require__(250),
var _require = __webpack_require__(195),
endTruncateStr = _require.endTruncateStr;
var _require2 = __webpack_require__(296),
var _require2 = __webpack_require__(208),
basename = _require2.basename;
/**
@ -447,7 +441,7 @@ var Debugger =
* @static
*/
function getPrettySourceURL(url) {
return `${ url }:formatted`;
return `${url}:formatted`;
}
/**
@ -471,7 +465,7 @@ var Debugger =
if (!url) {
var sourceId = id.split("/")[1];
return `SOURCE${ sourceId }`;
return `SOURCE${sourceId}`;
}
url = getRawSourceURL(url || "");
@ -569,9 +563,11 @@ var Debugger =
/***/ },
/***/ 296:
/***/ 208:
/***/ function(module, exports) {
"use strict";
function basename(path) {
return path.split("/").pop();
}
@ -590,7 +586,7 @@ var Debugger =
}
function join(base, dir) {
return `${ base }/${ dir }`;
return `${base}/${dir}`;
}
module.exports = {
@ -599,10 +595,12 @@ var Debugger =
/***/ },
/***/ 317:
/***/ 220:
/***/ function(module, exports, __webpack_require__) {
var md5 = __webpack_require__(318);
"use strict";
var md5 = __webpack_require__(221);
function originalToGeneratedId(originalId) {
var match = originalId.match(/(.*)\/originalSource/);
@ -610,7 +608,7 @@ var Debugger =
}
function generatedToOriginalId(generatedId, url) {
return `${ generatedId }/originalSource-${ md5(url) }`;
return `${generatedId}/originalSource-${md5(url)}`;
}
function isOriginalId(id) {
@ -627,14 +625,14 @@ var Debugger =
/***/ },
/***/ 318:
/***/ 221:
/***/ function(module, exports, __webpack_require__) {
(function(){
var crypt = __webpack_require__(319),
utf8 = __webpack_require__(320).utf8,
isBuffer = __webpack_require__(321),
bin = __webpack_require__(320).bin,
var crypt = __webpack_require__(222),
utf8 = __webpack_require__(223).utf8,
isBuffer = __webpack_require__(224),
bin = __webpack_require__(223).bin,
// The core
md5 = function (message, options) {
@ -794,7 +792,7 @@ var Debugger =
/***/ },
/***/ 319:
/***/ 222:
/***/ function(module, exports) {
(function() {
@ -897,7 +895,7 @@ var Debugger =
/***/ },
/***/ 320:
/***/ 223:
/***/ function(module, exports) {
var charenc = {
@ -937,7 +935,7 @@ var Debugger =
/***/ },
/***/ 321:
/***/ 224:
/***/ function(module, exports) {
/*!
@ -965,7 +963,7 @@ var Debugger =
/***/ },
/***/ 398:
/***/ 262:
/***/ function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
@ -991,8 +989,8 @@ var Debugger =
'use strict';
var punycode = __webpack_require__(399);
var util = __webpack_require__(400);
var punycode = __webpack_require__(263);
var util = __webpack_require__(264);
exports.parse = urlParse;
exports.resolve = urlResolve;
@ -1067,7 +1065,7 @@ var Debugger =
'gopher:': true,
'file:': true
},
querystring = __webpack_require__(401);
querystring = __webpack_require__(265);
function urlParse(url, parseQueryString, slashesDenoteHost) {
if (url && util.isObject(url) && url instanceof Url) return url;
@ -1704,7 +1702,7 @@ var Debugger =
/***/ },
/***/ 399:
/***/ 263:
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */
@ -2240,7 +2238,7 @@ var Debugger =
/***/ },
/***/ 400:
/***/ 264:
/***/ function(module, exports) {
'use strict';
@ -2263,18 +2261,18 @@ var Debugger =
/***/ },
/***/ 401:
/***/ 265:
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.decode = exports.parse = __webpack_require__(402);
exports.encode = exports.stringify = __webpack_require__(403);
exports.decode = exports.parse = __webpack_require__(266);
exports.encode = exports.stringify = __webpack_require__(267);
/***/ },
/***/ 402:
/***/ 266:
/***/ function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
@ -2361,7 +2359,7 @@ var Debugger =
/***/ },
/***/ 403:
/***/ 267:
/***/ function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
@ -2432,9 +2430,11 @@ var Debugger =
/***/ },
/***/ 692:
/***/ 540:
/***/ function(module, exports, __webpack_require__) {
"use strict";
var _resolveAndFetch = (() => {
var _ref = _asyncToGenerator(function* (generatedSource) {
// Fetch the sourcemap over the network and create it.
@ -2566,23 +2566,23 @@ var Debugger =
* @module utils/source-map-worker
*/
var networkRequest = __webpack_require__(125);
var networkRequest = __webpack_require__(127);
var _require = __webpack_require__(398),
var _require = __webpack_require__(262),
parse = _require.parse;
var path = __webpack_require__(296);
var path = __webpack_require__(208);
var _require2 = __webpack_require__(693),
var _require2 = __webpack_require__(541),
SourceMapConsumer = _require2.SourceMapConsumer,
SourceMapGenerator = _require2.SourceMapGenerator;
var _require3 = __webpack_require__(295),
var _require3 = __webpack_require__(207),
getContentType = _require3.getContentType;
var assert = __webpack_require__(252);
var assert = __webpack_require__(197);
var _require4 = __webpack_require__(317),
var _require4 = __webpack_require__(220),
originalToGeneratedId = _require4.originalToGeneratedId,
generatedToOriginalId = _require4.generatedToOriginalId,
isGeneratedId = _require4.isGeneratedId,
@ -2618,11 +2618,11 @@ var Debugger =
_parse$host = _parse.host,
host = _parse$host === undefined ? "" : _parse$host;
return `${ protocol }//${ host }${ sourceMapURL }`;
return `${protocol}//${host}${sourceMapURL}`;
}
// Otherwise, it's a relative path and should be resolved relative
// to the source.
return `${ path.dirname(url) }/${ sourceMapURL }`;
return `${path.dirname(url)}/${sourceMapURL}`;
}
/**
@ -2710,7 +2710,7 @@ var Debugger =
/***/ },
/***/ 693:
/***/ 541:
/***/ function(module, exports, __webpack_require__) {
/*
@ -2718,14 +2718,14 @@ var Debugger =
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.SourceMapGenerator = __webpack_require__(694).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(700).SourceMapConsumer;
exports.SourceNode = __webpack_require__(703).SourceNode;
exports.SourceMapGenerator = __webpack_require__(542).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(548).SourceMapConsumer;
exports.SourceNode = __webpack_require__(551).SourceNode;
/***/ },
/***/ 694:
/***/ 542:
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -2735,10 +2735,10 @@ var Debugger =
* http://opensource.org/licenses/BSD-3-Clause
*/
var base64VLQ = __webpack_require__(695);
var util = __webpack_require__(697);
var ArraySet = __webpack_require__(698).ArraySet;
var MappingList = __webpack_require__(699).MappingList;
var base64VLQ = __webpack_require__(543);
var util = __webpack_require__(545);
var ArraySet = __webpack_require__(546).ArraySet;
var MappingList = __webpack_require__(547).MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
@ -3136,7 +3136,7 @@ var Debugger =
/***/ },
/***/ 695:
/***/ 543:
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3176,7 +3176,7 @@ var Debugger =
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var base64 = __webpack_require__(696);
var base64 = __webpack_require__(544);
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
@ -3283,7 +3283,7 @@ var Debugger =
/***/ },
/***/ 696:
/***/ 544:
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3357,7 +3357,7 @@ var Debugger =
/***/ },
/***/ 697:
/***/ 545:
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3781,7 +3781,7 @@ var Debugger =
/***/ },
/***/ 698:
/***/ 546:
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3791,7 +3791,7 @@ var Debugger =
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(697);
var util = __webpack_require__(545);
var has = Object.prototype.hasOwnProperty;
/**
@ -3892,7 +3892,7 @@ var Debugger =
/***/ },
/***/ 699:
/***/ 547:
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3902,7 +3902,7 @@ var Debugger =
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(697);
var util = __webpack_require__(545);
/**
* Determine whether mappingB is after mappingA with respect to generated
@ -3978,7 +3978,7 @@ var Debugger =
/***/ },
/***/ 700:
/***/ 548:
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3988,11 +3988,11 @@ var Debugger =
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(697);
var binarySearch = __webpack_require__(701);
var ArraySet = __webpack_require__(698).ArraySet;
var base64VLQ = __webpack_require__(695);
var quickSort = __webpack_require__(702).quickSort;
var util = __webpack_require__(545);
var binarySearch = __webpack_require__(549);
var ArraySet = __webpack_require__(546).ArraySet;
var base64VLQ = __webpack_require__(543);
var quickSort = __webpack_require__(550).quickSort;
function SourceMapConsumer(aSourceMap) {
var sourceMap = aSourceMap;
@ -5067,7 +5067,7 @@ var Debugger =
/***/ },
/***/ 701:
/***/ 549:
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -5185,7 +5185,7 @@ var Debugger =
/***/ },
/***/ 702:
/***/ 550:
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -5306,7 +5306,7 @@ var Debugger =
/***/ },
/***/ 703:
/***/ 551:
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -5316,8 +5316,8 @@ var Debugger =
* http://opensource.org/licenses/BSD-3-Clause
*/
var SourceMapGenerator = __webpack_require__(694).SourceMapGenerator;
var util = __webpack_require__(697);
var SourceMapGenerator = __webpack_require__(542).SourceMapGenerator;
var util = __webpack_require__(545);
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
@ -5720,5 +5720,7 @@ var Debugger =
/***/ }
/******/ });
/******/ })
});
;
//# sourceMappingURL=source-map-worker.js.map

View File

@ -11,6 +11,7 @@ support-files =
examples/sourcemaps2/main.min.js
examples/sourcemaps2/main.js
examples/sourcemaps2/main.js.map
examples/doc-asm.html
examples/doc-scripts.html
examples/doc-script-switching.html
examples/doc-exceptions.html
@ -22,6 +23,7 @@ support-files =
examples/doc-sourcemaps2.html
examples/doc-sourcemap-bogus.html
examples/doc-sources.html
examples/asm.js
examples/bogus-map.js
examples/entry.js
examples/exceptions.js
@ -37,8 +39,10 @@ support-files =
examples/script-switching-01.js
examples/times2.js
[browser_dbg-asm.js]
[browser_dbg-breaking.js]
[browser_dbg-breaking-from-console.js]
skip-if = true # Issue 1998
[browser_dbg-breakpoints.js]
[browser_dbg-breakpoints-cond.js]
[browser_dbg-call-stack.js]

View File

@ -0,0 +1,33 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that asm.js AOT can be disabled and debugging of the asm.js code
// is working.
add_task(function* () {
const dbg = yield initDebugger("doc-asm.html");
const { selectors: { getSelectedSource }, getState } = dbg;
yield reload(dbg);
// After reload() we are getting getSources notifiction for old sources,
// using the debugger statement to really stop are reloaded page.
yield waitForPaused(dbg);
yield resume(dbg);
yield waitForSources(dbg, "doc-asm.html", "asm.js");
// Expand nodes and make sure more sources appear.
is(findAllElements(dbg, "sourceNodes").length, 2);
clickElement(dbg, "sourceArrow", 2);
is(findAllElements(dbg, "sourceNodes").length, 4);
selectSource(dbg, 'asm.js');
yield addBreakpoint(dbg, "asm.js", 7);
invokeInTab("runAsm");
yield waitForPaused(dbg);
assertPausedLocation(dbg, "asm.js", 7);
});

View File

@ -3,30 +3,12 @@
// Tests the breakpoints are hit in various situations.
add_task(function* () {
const dbg = yield initDebugger("doc-scripts.html");
const { selectors: { getSelectedSource }, getState } = dbg;
const {
breaking,
setupTestRunner
} = require("devtools/client/debugger/new/integration-tests");
// Make sure we can set a top-level breakpoint and it will be hit on
// reload.
yield addBreakpoint(dbg, "scripts.html", 18);
reload(dbg);
yield waitForPaused(dbg);
assertPausedLocation(dbg, "scripts.html", 18);
yield resume(dbg);
const paused = waitForPaused(dbg);
// Create an eval script that pauses itself.
invokeInTab("doEval");
yield paused;
yield resume(dbg);
const source = getSelectedSource(getState()).toJS();
ok(!source.url, "It is an eval source");
yield addBreakpoint(dbg, source, 5);
invokeInTab("evaledFunc");
yield waitForPaused(dbg);
assertPausedLocation(dbg, source, 5);
add_task(function*() {
setupTestRunner(this);
yield breaking(this);
});

View File

@ -1,50 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function findBreakpoint(dbg, url, line) {
const { selectors: { getBreakpoint }, getState } = dbg;
const source = findSource(dbg, url);
return getBreakpoint(getState(), { sourceId: source.id, line });
}
// Tests basic pretty-printing functionality.
function setConditionalBreakpoint(dbg, index, condition) {
return Task.spawn(function* () {
rightClickElement(dbg, "gutter", index);
selectMenuItem(dbg, 2);
yield waitForElement(dbg, ".conditional-breakpoint-panel input");
findElementWithSelector(dbg, ".conditional-breakpoint-panel input").focus();
type(dbg, condition);
pressKey(dbg, "Enter");
});
}
const {
breakpointsCond,
setupTestRunner
} = require("devtools/client/debugger/new/integration-tests");
add_task(function* () {
const dbg = yield initDebugger("doc-scripts.html");
yield selectSource(dbg, "simple2");
// Adding a conditional Breakpoint
yield setConditionalBreakpoint(dbg, 5, "1");
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
let bp = findBreakpoint(dbg, "simple2", 5);
is(bp.condition, "1", "breakpoint is created with the condition");
// Editing a conditional Breakpoint
yield setConditionalBreakpoint(dbg, 5, "2");
yield waitForDispatch(dbg, "SET_BREAKPOINT_CONDITION");
bp = findBreakpoint(dbg, "simple2", 5);
is(bp.condition, "12", "breakpoint is created with the condition");
// Removing a conditional breakpoint
clickElement(dbg, "gutter", 5);
yield waitForDispatch(dbg, "REMOVE_BREAKPOINT");
bp = findBreakpoint(dbg, "simple2", 5);
is(bp, null, "breakpoint was removed");
// Adding a condition to a breakpoint
clickElement(dbg, "gutter", 5);
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
yield setConditionalBreakpoint(dbg, 5, "1");
bp = findBreakpoint(dbg, "simple2", 5);
is(bp.condition, "1", "breakpoint is created with the condition");
add_task(function*() {
setupTestRunner(this);
yield breakpointsCond(this);
});

View File

@ -27,14 +27,19 @@ function getSplitConsole(dbg) {
add_task(function* () {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
const dbg = yield initDebugger("doc-script-switching.html");
const dbg = yield initDebugger(
"doc-script-switching.html"
);
yield selectSource(dbg, "switching-01");
// open the console
yield getSplitConsole(dbg);
const jsterm = yield getSplitConsole(dbg);
ok(dbg.toolbox.splitConsole, "Split console is shown.");
info("Evaluating a script in the console");
yield jsterm.execute("1+1");
// close the console
clickElement(dbg, "codeMirror");
// First time to focus out of text area

View File

@ -3,29 +3,12 @@
// Tests basic pretty-printing functionality.
add_task(function* () {
const dbg = yield initDebugger("doc-minified.html");
const {
prettyPrint,
setupTestRunner
} = require("devtools/client/debugger/new/integration-tests");
yield selectSource(dbg, "math.min.js");
clickElement(dbg, "prettyPrintButton");
yield waitForDispatch(dbg, "TOGGLE_PRETTY_PRINT");
const ppSrc = findSource(dbg, "math.min.js:formatted");
ok(ppSrc, "Pretty-printed source exists");
yield addBreakpoint(dbg, ppSrc, 18);
invokeInTab("arithmetic");
yield waitForPaused(dbg);
assertPausedLocation(dbg, ppSrc, 18);
yield stepOver(dbg);
assertPausedLocation(dbg, ppSrc, 27);
yield resume(dbg);
// The pretty-print button should go away in the pretty-printed
// source.
ok(!findElement(dbg, "sourceFooter"), "Footer is hidden");
yield selectSource(dbg, "math.min.js");
ok(findElement(dbg, "sourceFooter"), "Footer is hidden");
add_task(function*() {
setupTestRunner(this);
yield prettyPrint(this);
});

View File

@ -0,0 +1,11 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
var asmjs = (function () {
"use asm";
function f() {
return 1|0;
}
return {f: f};
})()

View File

@ -0,0 +1,20 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Asm.js</title>
<script src="asm.js"></script>
<script>
function runAsm() {
console.log(asmjs.f());
}
debugger; // see browser_dbg-asm.js reload() comment
</script>
</head>
<body>
<button onclick="runAsm()">test</button>
</body>
</html>

View File

@ -41,6 +41,11 @@ Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", true);
Services.prefs.clearUserPref("devtools.debugger.tabs")
Services.prefs.clearUserPref("devtools.debugger.pending-selected-location")
this.gBrowser = gBrowser;
this.Services = Services;
this.EXAMPLE_URL = EXAMPLE_URL;
this.EventUtils = EventUtils;
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
delete window.resumeTest;
@ -288,6 +293,7 @@ function createDebuggerContext(toolbox) {
getState: store.getState,
store: store,
client: win.Debugger.client,
threadClient: toolbox.threadClient,
toolbox: toolbox,
win: win
};
@ -306,7 +312,8 @@ function initDebugger(url, ...sources) {
return Task.spawn(function* () {
Services.prefs.clearUserPref("devtools.debugger.tabs")
Services.prefs.clearUserPref("devtools.debugger.pending-selected-location")
const toolbox = yield openNewTabAndToolbox(EXAMPLE_URL + url, "jsdebugger");
url = url.startsWith("data:") ? url : EXAMPLE_URL + url;
const toolbox = yield openNewTabAndToolbox(url, "jsdebugger");
return createDebuggerContext(toolbox);
});
}
@ -439,7 +446,7 @@ function resume(dbg) {
* @static
*/
function reload(dbg, ...sources) {
return dbg.client.reload().then(() => waitForSources(...sources));
return dbg.client.reload().then(() => waitForSources(dbg, ...sources));
}
/**
@ -524,6 +531,7 @@ function togglePauseOnExceptions(dbg,
* @return {Promise}
* @static
*/
function invokeInTab(fnc) {
info(`Invoking function ${fnc} in tab`);
return ContentTask.spawn(gBrowser.selectedBrowser, fnc, function* (fnc) {

View File

@ -14,6 +14,14 @@
# that collapses the left and right panes in the debugger UI.
collapsePanes=Collapse panes
# LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the
# context menu to copy the source URL of file open.
copySourceUrl=Copy Source Url
# LOCALIZATION NOTE (copySourceUrl.key): Access key to copy the source URL of a file from
# the context menu.
copySourceUrl.key=X
# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button
# that expands the left and right panes in the debugger UI.
expandPanes=Expand panes
@ -116,6 +124,10 @@ blackBoxCheckboxTooltip=Toggle black boxing
# searching all the source files the debugger has seen.
sources.search.key=P
# LOCALIZATION NOTE (sources.searchAlt.key): Alternate key shortcut to open
# the search for searching all the source files the debugger has seen.
sources.searchAlt.key=O
# LOCALIZATION NOTE (sourceSearch.search.key): Key shortcut to open the search
# for searching within a the currently opened files in the editor
sourceSearch.search.key=F
@ -269,18 +281,58 @@ expressions.placeholder=Add Watch Expression
# for closing the selected tab below the mouse.
sourceTabs.closeTab=Close tab
# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item
# for closing the selected tab below the mouse.
sourceTabs.closeTab.key=C
# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item
# for closing the other tabs.
sourceTabs.closeOtherTabs=Close others
# LOCALIZATION NOTE (sourceTabs.closeTabsToRight): Editor source tab context menu item
# for closing the tabs to the right of the selected tab.
sourceTabs.closeTabsToRight=Close tabs to the right
# LOCALIZATION NOTE (sourceTabs.closeOtherTabs.key): Access key to close other source tabs
# from the editor context menu.
sourceTabs.closeOtherTabs.key=O
# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item
# for closing the tabs to the end (the right for LTR languages) of the selected tab.
sourceTabs.closeTabsToEnd=Close tabs to the right
# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd.key): Access key to close source tabs
# after the selected tab from the editor context menu.
sourceTabs.closeTabsToEnd.key=R
# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item
# for closing all tabs.
sourceTabs.closeAllTabs=Close all tabs
# LOCALIZATION NOTE (sourceTabs.closeAllTabs.key): Access key to close all tabs from the
# editor context menu.
sourceTabs.closeAllTabs.key=A
# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item
# for revealing source in tree.
sourceTabs.revealInTree=Reveal in Tree
# LOCALIZATION NOTE (sourceTabs.revealInTree.key): Access key to reveal a source in the
# tree from the context menu.
sourceTabs.revealInTree.key=s
# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item
# for copying a link address.
sourceTabs.copyLink=Copy Link Address
# LOCALIZATION NOTE (sourceTabs.copyLink.key): Access key to copy a link addresss from the
# editor context menu.
sourceTabs.copyLink.key=X
# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item
# for pretty printing the source.
sourceTabs.prettyPrint=Pretty Print Source
# LOCALIZATION NOTE (sourceTabs.prettyPrint.key): Access key to pretty print a source from
# the editor context menu.
sourceTabs.prettyPrint.key=Z
# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed
# for close tab button in source tabs.
sourceTabs.closeTabButtonTooltip=Close tab