Bug 1406551 - Update Debugger frontend (10-8). r=jdescottes

MozReview-Commit-ID: GKTM3rLKlTX

--HG--
extra : rebase_source : d29dcda06f672c578fe1c3853312f056c9f7629e
This commit is contained in:
Jason Laster 2017-10-10 18:45:40 +02:00
parent 6e31492671
commit 0f3cc56815
17 changed files with 4695 additions and 4058 deletions

View File

@ -0,0 +1,11 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
Taken from upstream commit: ed61626e63720c5b8c354e5f26e31aec8d95539c
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
- babel-preset-react @6.24.1
- react @15.6.2
- react-dom @15.6.2
- webpack @3.6.0

View File

@ -412,7 +412,7 @@ body {
.modal-wrapper {
position: fixed;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
top: 0;
@ -423,7 +423,7 @@ body {
.modal {
top: 0;
height: 230px;
margin: auto;
width: 500px;
background-color: var(--theme-toolbar-background);
transform: translateY(-250px);
@ -438,7 +438,7 @@ body {
.modal.entered,
.modal.exiting {
transform: translateY(30px);
transform: translateY(0px);
}
@media (max-width: 520px) {
@ -490,7 +490,6 @@ body {
}
.shortcuts-modal {
height: fit-content;
width: 45%;
}
@ -973,7 +972,7 @@ html .arrow.expanded svg {
width: 15px;
height: 15px;
margin-right: 5px;
vertical-align: bottom;
vertical-align: sub;
}
.theme-dark .webpack {
@ -1428,6 +1427,7 @@ html[dir="rtl"] .managed-tree .tree .node > div {
display: flex;
overflow-x: hidden;
overflow-y: auto;
padding-top: 11px;
}
.sources-list .managed-tree {
@ -1462,6 +1462,11 @@ html[dir="rtl"] .managed-tree .tree .node > div {
display: inline-block;
}
.sources-list .tree .node .no-arrow {
width: 10px;
display: inline-block;
}
.no-sources-message {
font-size: 12px;
color: var(--theme-comment-alt);
@ -1497,7 +1502,7 @@ html[dir="rtl"] .managed-tree .tree .node > div {
position: relative;
transition: all 0.25s ease;
overflow: hidden;
padding: 6.5px;
padding: 8px 8px 7px 8px;
margin-bottom: 0px;
margin-top: -1px;
cursor: default;
@ -1542,14 +1547,28 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.outline-list {
list-style-type: none;
padding-left: 0px;
width: 100%;
padding: 10px;
margin: 0;
}
.outline-list__class-list {
list-style: none;
margin: 0;
padding: 0;
padding-left: 10px;
}
.outline-list h2 {
font-weight: normal;
font-size: 1em;
margin: 10px 0;
color: var(--theme-body-color);
}
.outline-list__element {
color: blue;
padding-bottom: 0.2rem;
padding-left: 1rem;
padding-right: 0.5rem;
padding-top: 0.2rem;
cursor: default;
@ -1577,40 +1596,6 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.function-signature .comma {
color: var(--object-color);
}
.conditional-breakpoint-panel {
cursor: initial;
margin: 1em 0;
position: relative;
display: flex;
align-items: center;
background: var(--theme-toolbar-background);
border-top: 1px solid var(--theme-splitter-color);
border-bottom: 1px solid var(--theme-splitter-color);
}
.conditional-breakpoint-panel .prompt {
font-size: 1.8em;
color: var(--theme-conditional-breakpoint-color);
padding-left: 3px;
padding-right: 3px;
padding-bottom: 3px;
text-align: right;
width: 30px;
}
.conditional-breakpoint-panel input {
margin: 5px 10px;
width: calc(100% - 4em);
border: none;
background: var(--theme-toolbar-background);
font-size: 14px;
color: var(--theme-conditional-breakpoint-color);
line-height: 30px;
}
.conditional-breakpoint-panel input:focus {
outline-width: 0;
}
.toggle-button-start,
.toggle-button-end {
transform: translate(0, 0px);
@ -2329,6 +2314,40 @@ html[dir="rtl"] .arrow svg,
.empty-line .CodeMirror-linenumber {
opacity: 0.5;
}
.conditional-breakpoint-panel {
cursor: initial;
margin: 1em 0;
position: relative;
display: flex;
align-items: center;
background: var(--theme-toolbar-background);
border-top: 1px solid var(--theme-splitter-color);
border-bottom: 1px solid var(--theme-splitter-color);
}
.conditional-breakpoint-panel .prompt {
font-size: 1.8em;
color: var(--theme-conditional-breakpoint-color);
padding-left: 3px;
padding-right: 3px;
padding-bottom: 3px;
text-align: right;
width: 30px;
}
.conditional-breakpoint-panel input {
margin: 5px 10px;
width: calc(100% - 4em);
border: none;
background: var(--theme-toolbar-background);
font-size: 14px;
color: var(--theme-conditional-breakpoint-color);
line-height: 30px;
}
.conditional-breakpoint-panel input:focus {
outline-width: 0;
}
.editor-wrapper {
--debug-line-border: rgb(145, 188, 219);
--debug-expression-background: rgba(202, 227, 255, 0.5);
@ -2353,11 +2372,6 @@ html[dir="rtl"] .arrow svg,
--theme-conditional-breakpoint-color: var(--theme-body-color);
}
.paused .CodeMirror-line,
.paused .CodeMirror-linenumber {
opacity: 0.7;
}
/**
* There's a known codemirror flex issue with chrome that this addresses.
* BUG https://github.com/devtools-html/debugger.html/issues/63
@ -2629,6 +2643,7 @@ html .breakpoints-list .breakpoint.paused {
overflow-x: hidden;
text-overflow: ellipsis;
padding: 1px 0;
vertical-align: bottom;
}
.breakpoints-list .pause-indicator {
@ -3029,7 +3044,6 @@ html .breakpoints-list .breakpoint.paused {
border-bottom: 1px solid var(--theme-splitter-color);
display: flex;
overflow: hidden;
position: sticky;
z-index: 1;
background-color: var(--theme-toolbar-background);
}
@ -3144,6 +3158,7 @@ html .command-bar > button:disabled {
display: inline-block;
}
.secondary-panes {
overflow: scroll;
display: flex;
flex-direction: column;
flex: 1;
@ -3158,8 +3173,12 @@ html .command-bar > button:disabled {
the wrapper.
Ref: https://github.com/devtools-html/debugger.html/issues/3426
*/
.secondary-panes--sticky-commandbar {
overflow-y: scroll;
.secondary-panes-wrapper {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
}
.secondary-panes .accordion {
@ -3216,12 +3235,26 @@ html .command-bar > button:disabled {
offset-inline-start: auto;
}
.welcomebox .small-size-layout {
display: none;
}
.welcomebox .normal-layout {
display: inline-block;
}
.shortcutKeys {
text-align: right;
float: left;
font-family: Courier;
}
.shortcutKey {
display: inline-block;
margin-right: 10px;
font-family: Courier;
}
.shortcutFunction {
text-align: left;
float: left;
@ -3231,6 +3264,24 @@ html .command-bar > button:disabled {
html .welcomebox .toggle-button-end.collapsed {
bottom: 1px;
}
@media (max-width: 430px) {
.welcomebox .small-size-layout {
display: inline-block;
}
.welcomebox .normal-layout {
display: none;
}
.shortcutFunction {
margin-left: 0;
}
.shortcutKey {
display: block;
}
}
.source-header {
border-bottom: 1px solid var(--theme-splitter-color);
width: 100%;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -70,17 +70,74 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.p = "/assets/build";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 380);
/******/ return __webpack_require__(__webpack_require__.s = 1282);
/******/ })
/************************************************************************/
/******/ ({
/***/ 380:
/***/ 1282:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(964);
module.exports = __webpack_require__(1283);
/***/ }),
/***/ 1283:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _prettyFast = __webpack_require__(802);
var _prettyFast2 = _interopRequireDefault(_prettyFast);
var _devtoolsUtils = __webpack_require__(900);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var workerHandler = _devtoolsUtils.workerUtils.workerHandler;
function prettyPrint(_ref) {
var url = _ref.url,
indent = _ref.indent,
source = _ref.source;
var prettified = (0, _prettyFast2.default)(source, {
url: url,
indent: " ".repeat(indent)
});
return {
code: prettified.code,
mappings: invertMappings(prettified.map._mappings)
};
}
function invertMappings(mappings) {
return mappings._array.map(m => {
var mapping = {
generated: {
line: m.originalLine,
column: m.originalColumn
}
};
if (m.source) {
mapping.source = m.source;
mapping.original = {
line: m.generatedLine,
column: m.generatedColumn
};
mapping.name = m.name;
}
return mapping;
});
}
self.onmessage = workerHandler({ prettyPrint });
/***/ }),
/***/ 381:
@ -7532,63 +7589,6 @@ module.exports = {
streamingWorkerHandler
};
/***/ }),
/***/ 964:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _prettyFast = __webpack_require__(802);
var _prettyFast2 = _interopRequireDefault(_prettyFast);
var _devtoolsUtils = __webpack_require__(900);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var workerHandler = _devtoolsUtils.workerUtils.workerHandler;
function prettyPrint(_ref) {
var url = _ref.url,
indent = _ref.indent,
source = _ref.source;
var prettified = (0, _prettyFast2.default)(source, {
url: url,
indent: " ".repeat(indent)
});
return {
code: prettified.code,
mappings: invertMappings(prettified.map._mappings)
};
}
function invertMappings(mappings) {
return mappings._array.map(m => {
var mapping = {
generated: {
line: m.originalLine,
column: m.originalColumn
}
};
if (m.source) {
mapping.source = m.source;
mapping.original = {
line: m.generatedLine,
column: m.generatedColumn
};
mapping.name = m.name;
}
return mapping;
});
}
self.onmessage = workerHandler({ prettyPrint });
/***/ })
/******/ });

View File

@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.p = "/assets/build";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 382);
/******/ return __webpack_require__(__webpack_require__.s = 1284);
/******/ })
/************************************************************************/
/******/ ({
@ -262,168 +262,6 @@ function arrayMap(array, iteratee) {
module.exports = arrayMap;
/***/ }),
/***/ 1123:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _getMatches = __webpack_require__(1173);
var _getMatches2 = _interopRequireDefault(_getMatches);
var _projectSearch = __webpack_require__(1140);
var _devtoolsUtils = __webpack_require__(900);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var workerHandler = _devtoolsUtils.workerUtils.workerHandler;
self.onmessage = workerHandler({ getMatches: _getMatches2.default, findSourceMatches: _projectSearch.findSourceMatches });
/***/ }),
/***/ 1138:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = buildQuery;
var _escapeRegExp = __webpack_require__(259);
var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Ignore doing outline matches for less than 3 whitespaces
*
* @memberof utils/source-search
* @static
*/
function ignoreWhiteSpace(str) {
return (/^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str
);
}
function wholeMatch(query, wholeWord) {
if (query === "" || !wholeWord) {
return query;
}
return `\\b${query}\\b`;
}
function buildFlags(caseSensitive, isGlobal) {
if (caseSensitive && isGlobal) {
return "g";
}
if (!caseSensitive && isGlobal) {
return "gi";
}
if (!caseSensitive && !isGlobal) {
return "i";
}
return;
}
function buildQuery(originalQuery, modifiers, _ref) {
var _ref$isGlobal = _ref.isGlobal,
isGlobal = _ref$isGlobal === undefined ? false : _ref$isGlobal,
_ref$ignoreSpaces = _ref.ignoreSpaces,
ignoreSpaces = _ref$ignoreSpaces === undefined ? false : _ref$ignoreSpaces;
var caseSensitive = modifiers.caseSensitive,
regexMatch = modifiers.regexMatch,
wholeWord = modifiers.wholeWord;
if (originalQuery === "") {
return new RegExp(originalQuery);
}
var query = originalQuery;
if (ignoreSpaces) {
query = ignoreWhiteSpace(query);
}
if (!regexMatch) {
query = (0, _escapeRegExp2.default)(query);
}
query = wholeMatch(query, wholeWord);
var flags = buildFlags(caseSensitive, isGlobal);
if (flags) {
return new RegExp(query, flags);
}
return new RegExp(query);
}
/***/ }),
/***/ 1140:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findSourceMatches = findSourceMatches;
var _source = __webpack_require__(233);
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); } } // Maybe reuse file search's functions?
function findSourceMatches(source, queryText) {
var _ref;
var text = source.text;
if (!(0, _source.isLoaded)(source) || !text || queryText == "") {
return [];
}
var lines = text.split("\n");
var result = undefined;
var query = new RegExp(queryText, "g");
var matches = lines.map((_text, line) => {
var indices = [];
while (result = query.exec(_text)) {
indices.push({
sourceId: source.id,
line: line + 1,
column: result.index,
match: result[0],
value: _text,
text: result.input
});
}
return indices;
}).filter(_matches => _matches.length > 0);
matches = (_ref = []).concat.apply(_ref, _toConsumableArray(matches));
return matches;
}
/***/ }),
/***/ 1165:
@ -681,44 +519,6 @@ module.exports = {
/***/ }),
/***/ 1173:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getMatches;
var _buildQuery = __webpack_require__(1138);
var _buildQuery2 = _interopRequireDefault(_buildQuery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getMatches(query, text, modifiers) {
if (!query || !text || !modifiers) {
return [];
}
var regexQuery = (0, _buildQuery2.default)(query, modifiers, {
isGlobal: true
});
var matchedLocations = [];
var lines = text.split("\n");
for (var i = 0; i < lines.length; i++) {
var singleMatch = void 0;
var line = lines[i];
while ((singleMatch = regexQuery.exec(line)) !== null) {
matchedLocations.push({ line: i, ch: singleMatch.index });
}
}
return matchedLocations;
}
/***/ }),
/***/ 121:
/***/ (function(module, exports, __webpack_require__) {
@ -809,6 +609,94 @@ var isArray = Array.isArray || function (xs) {
};
/***/ }),
/***/ 1211:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = buildQuery;
var _escapeRegExp = __webpack_require__(259);
var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Ignore doing outline matches for less than 3 whitespaces
*
* @memberof utils/source-search
* @static
*/
function ignoreWhiteSpace(str) {
return (/^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str
);
}
function wholeMatch(query, wholeWord) {
if (query === "" || !wholeWord) {
return query;
}
return `\\b${query}\\b`;
}
function buildFlags(caseSensitive, isGlobal) {
if (caseSensitive && isGlobal) {
return "g";
}
if (!caseSensitive && isGlobal) {
return "gi";
}
if (!caseSensitive && !isGlobal) {
return "i";
}
return;
}
function buildQuery(originalQuery, modifiers, _ref) {
var _ref$isGlobal = _ref.isGlobal,
isGlobal = _ref$isGlobal === undefined ? false : _ref$isGlobal,
_ref$ignoreSpaces = _ref.ignoreSpaces,
ignoreSpaces = _ref$ignoreSpaces === undefined ? false : _ref$ignoreSpaces;
var caseSensitive = modifiers.caseSensitive,
regexMatch = modifiers.regexMatch,
wholeWord = modifiers.wholeWord;
if (originalQuery === "") {
return new RegExp(originalQuery);
}
var query = originalQuery;
if (ignoreSpaces) {
query = ignoreWhiteSpace(query);
}
if (!regexMatch) {
query = (0, _escapeRegExp2.default)(query);
}
query = wholeMatch(query, wholeWord);
var flags = buildFlags(caseSensitive, isGlobal);
if (flags) {
return new RegExp(query, flags);
}
return new RegExp(query);
}
/***/ }),
/***/ 122:
@ -902,6 +790,126 @@ var objectKeys = Object.keys || function (obj) {
};
/***/ }),
/***/ 1284:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1285);
/***/ }),
/***/ 1285:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _getMatches = __webpack_require__(1286);
var _getMatches2 = _interopRequireDefault(_getMatches);
var _projectSearch = __webpack_require__(1287);
var _devtoolsUtils = __webpack_require__(900);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var workerHandler = _devtoolsUtils.workerUtils.workerHandler;
self.onmessage = workerHandler({ getMatches: _getMatches2.default, findSourceMatches: _projectSearch.findSourceMatches });
/***/ }),
/***/ 1286:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getMatches;
var _buildQuery = __webpack_require__(1211);
var _buildQuery2 = _interopRequireDefault(_buildQuery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getMatches(query, text, modifiers) {
if (!query || !text || !modifiers) {
return [];
}
var regexQuery = (0, _buildQuery2.default)(query, modifiers, {
isGlobal: true
});
var matchedLocations = [];
var lines = text.split("\n");
for (var i = 0; i < lines.length; i++) {
var singleMatch = void 0;
var line = lines[i];
while ((singleMatch = regexQuery.exec(line)) !== null) {
matchedLocations.push({ line: i, ch: singleMatch.index });
}
}
return matchedLocations;
}
/***/ }),
/***/ 1287:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findSourceMatches = findSourceMatches;
var _source = __webpack_require__(233);
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); } } // Maybe reuse file search's functions?
function findSourceMatches(source, queryText) {
var _ref;
var text = source.text;
if (!(0, _source.isLoaded)(source) || !text || queryText == "") {
return [];
}
var lines = text.split("\n");
var result = undefined;
var query = new RegExp(queryText, "g");
var matches = lines.map((_text, line) => {
var indices = [];
while (result = query.exec(_text)) {
indices.push({
sourceId: source.id,
line: line + 1,
column: result.index,
match: result[0],
value: _text,
text: result.input
});
}
return indices;
}).filter(_matches => _matches.length > 0);
matches = (_ref = []).concat.apply(_ref, _toConsumableArray(matches));
return matches;
}
/***/ }),
/***/ 14:
@ -949,7 +957,7 @@ module.exports = isObjectLike;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isLoaded = exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isThirdParty = exports.isPretty = exports.isJavaScript = undefined;
exports.isLoaded = exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFileURL = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isThirdParty = exports.isPretty = exports.isJavaScript = undefined;
var _devtoolsSourceMap = __webpack_require__(898);
@ -1048,12 +1056,23 @@ function getRawSourceURL(url) {
return url.replace(/:formatted$/, "");
}
function getFilenameFromURL(url) {
function resolveFileURL(url) {
var transformUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : initialUrl => initialUrl;
url = getRawSourceURL(url || "");
var name = (0, _path.basename)(url) || "(index)";
var name = transformUrl(url);
return (0, _utils.endTruncateStr)(name, 50);
}
function getFilenameFromURL(url) {
return resolveFileURL(url, initialUrl => (0, _path.basename)(initialUrl) || "(index)");
}
function getFormattedSourceId(id) {
var sourceId = id.split("/")[1];
return `SOURCE${sourceId}`;
}
/**
* Show a source url's filename.
* If the source does not have a url, use the source id.
@ -1066,13 +1085,30 @@ function getFilename(source) {
id = source.id;
if (!url) {
var sourceId = id.split("/")[1];
return `SOURCE${sourceId}`;
return getFormattedSourceId(id);
}
return getFilenameFromURL(url);
}
/**
* Show a source url.
* If the source does not have a url, use the source id.
*
* @memberof utils/source
* @static
*/
function getFileURL(source) {
var url = source.url,
id = source.id;
if (!url) {
return getFormattedSourceId(id);
}
return resolveFileURL(url);
}
var contentTypeModeMap = {
"text/javascript": { name: "javascript" },
"text/typescript": { name: "javascript", typescript: true },
@ -1184,6 +1220,7 @@ exports.getPrettySourceURL = getPrettySourceURL;
exports.getRawSourceURL = getRawSourceURL;
exports.getFilename = getFilename;
exports.getFilenameFromURL = getFilenameFromURL;
exports.getFileURL = getFileURL;
exports.getSourcePath = getSourcePath;
exports.getSourceLineCount = getSourceLineCount;
exports.getMode = getMode;
@ -2463,14 +2500,6 @@ module.exports = {
};
/***/ }),
/***/ 382:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1123);
/***/ }),
/***/ 6:

View File

@ -19,6 +19,9 @@ support-files =
examples/sum/sum.js
examples/sum/sum.min.js
examples/sum/sum.min.js.map
examples/reload/code_reload_1.js
examples/reload/code_reload_2.js
examples/reload/doc_reload.html
examples/doc-async.html
examples/doc-asm.html
examples/doc-scripts.html
@ -53,6 +56,7 @@ support-files =
examples/script-switching-02.js
examples/script-switching-01.js
examples/times2.js
examples/reload/sjs_code_reload.sjs
[browser_dbg-asm.js]
[browser_dbg-async-stepping.js]
@ -64,7 +68,6 @@ support-files =
skip-if = true # Bug 1383576
[browser_dbg-breakpoints-cond.js]
[browser_dbg-call-stack.js]
[browser_dbg-expressions.js]
[browser_dbg-scopes.js]
[browser_dbg-chrome-create.js]
[browser_dbg-chrome-debugging.js]
@ -74,6 +77,8 @@ skip-if = debug # bug 1374187
[browser_dbg-editor-gutter.js]
[browser_dbg-editor-select.js]
[browser_dbg-editor-highlight.js]
[browser_dbg-expressions.js]
[browser_dbg-expressions-error.js]
[browser_dbg-iframes.js]
[browser_dbg_keyboard_navigation.js]
[browser_dbg_keyboard-shortcuts.js]
@ -103,3 +108,4 @@ skip-if = true # Bug 1393121, 1393299
[browser_dbg-toggling-tools.js]
[browser_dbg-wasm-sourcemaps.js]
skip-if = true
[browser_dbg-reload.js]

View File

@ -0,0 +1,90 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* test pausing on an errored watch expression
* assert that you can:
* 1. resume
* 2. still evalutate expressions
* 3. expand properties
*/
const expressionSelectors = {
input: "input.input-expression"
};
function getLabel(dbg, index) {
return findElement(dbg, "expressionNode", index).innerText;
}
function getValue(dbg, index) {
return findElement(dbg, "expressionValue", index).innerText;
}
function assertEmptyValue(dbg, index) {
const value = findElement(dbg, "expressionValue", index);
if (value) {
is(value.innerText, "");
return;
}
is(value, null);
}
function toggleExpression(dbg, index) {
findElement(dbg, "expressionNode", index).click();
}
async function addExpression(dbg, input) {
info("Adding an expression");
findElementWithSelector(dbg, expressionSelectors.input).focus();
type(dbg, input);
pressKey(dbg, "Enter");
await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
}
async function editExpression(dbg, input) {
info("updating the expression");
dblClickElement(dbg, "expressionNode", 1);
// Position cursor reliably at the end of the text.
pressKey(dbg, "End");
type(dbg, input);
pressKey(dbg, "Enter");
await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
}
/*
* When we add a bad expression, we'll pause,
* resume, and wait for the expression to finish being evaluated.
*/
async function addBadExpression(dbg, input) {
const paused = waitForPaused(dbg);
const added = addExpression(dbg, input);
await paused;
ok(dbg.selectors.isEvaluatingExpression(dbg.getState()));
await resume(dbg);
await added;
}
add_task(async function() {
const dbg = await initDebugger("doc-script-switching.html");
await togglePauseOnExceptions(dbg, true, false);
// add a good expression, 2 bad expressions, and another good one
await addExpression(dbg, "location");
await addBadExpression(dbg, "foo.bar");
await addBadExpression(dbg, "foo.batt");
await addExpression(dbg, "2");
// check the value of
is(getValue(dbg, 2), "(unavailable)");
is(getValue(dbg, 3), "(unavailable)");
is(getValue(dbg, 4), 2);
toggleExpression(dbg, 1);
await waitForDispatch(dbg, "LOAD_OBJECT_PROPERTIES");
is(findAllElements(dbg, "expressionNodes").length, 20);
});

View File

@ -0,0 +1,29 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Test reloading:
* 1. reload the source
* 2. re-sync breakpoints
*/
add_task(async function() {
const dbg = await initDebugger("reload/doc_reload.html", "sjs_code_reload");
const sym = waitForDispatch(dbg, "SET_SYMBOLS");
await selectSource(dbg, "sjs_code_reload");
await sym;
await addBreakpoint(dbg, "sjs_code_reload", 2);
const sync = waitForDispatch(dbg, "SYNC_BREAKPOINT");
await reload(dbg, "sjs_code_reload");
await sync;
const breakpoints = dbg.selectors.getBreakpoints(dbg.getState());
const breakpointList = breakpoints.valueSeq().toJS();
const breakpoint = breakpointList[0];
is(breakpointList.length, 1);
is(breakpoint.location.line, 6);
});

View File

@ -11,6 +11,7 @@ add_task(async function() {
await waitForPaused(dbg);
assertPausedLocation(dbg);
await waitForSource(dbg, "wasm-sourcemaps/average.c");
await addBreakpoint(dbg, "wasm-sourcemaps/average.c", 12);
clickElement(dbg, "resume");

View File

@ -0,0 +1,3 @@
function foo(n) {
console.log("yo")
}

View File

@ -0,0 +1,7 @@
/*
* comments
*/
function foo() {
console.log("YO")
}

View File

@ -0,0 +1,15 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<script src="sjs_code_reload.sjs"></script>
<head>
<meta charset="utf-8"/>
<title>Empty test page 1</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,32 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* globals getState, setState */
/* exported handleRequest */
"use strict";
function _getUrl(request, counter) {
const { scheme, host, path } = request;
const newPath = path.substr(0, path.lastIndexOf("/") + 1);
const index = counter < 3 ? 1 : 2;
return `${scheme}://${host}${newPath}/code_reload_${index}.js`
}
function handleRequest(request, response) {
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "0");
response.setHeader("Access-Control-Allow-Origin", "*", false);
response.setHeader("Content-Type", "text/javascript", false);
// Redirect to a different file each time.
let counter = 1 + +getState("counter");
const newUrl = _getUrl(request, counter);
response.setStatusLine(request.httpVersion, 302, "Found");
response.setHeader("Location", newUrl);
setState("counter", "" + counter);
}

View File

@ -504,7 +504,7 @@ function stepOut(dbg) {
function resume(dbg) {
info("Resuming");
dbg.actions.resume();
return waitForThreadEvents(dbg, "resumed");
return waitForState(dbg, (state) => !dbg.selectors.isPaused(state));
}
function deleteExpression(dbg, input) {

View File

@ -441,11 +441,6 @@ sourceTabs.closeAllTabs.accesskey=a
sourceTabs.revealInTree=Reveal in tree
sourceTabs.revealInTree.accesskey=r
# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item
# for copying a link address.
sourceTabs.copyLink=Copy link address
sourceTabs.copyLink.accesskey=l
# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item
# for pretty printing the source.
sourceTabs.prettyPrint=Pretty print source
@ -790,3 +785,7 @@ shortcuts.projectSearch=Full Project Search
# LOCALIZATION NOTE (shortcuts.functionSearch): text describing
# keyboard shortcut action for function search
shortcuts.functionSearch=Function Search
# LOCALIZATION NOTE (shortcuts.buttonName): text describing
# keyboard shortcut button text
shortcuts.buttonName=Keyboard shortcuts

View File

@ -31,7 +31,6 @@ pref("devtools.debugger.ui.variables-only-enum-visible", false);
pref("devtools.debugger.ui.variables-searchbox-visible", false);
pref("devtools.debugger.ui.framework-grouping-on", true);
pref("devtools.debugger.call-stack-visible", false);
pref("devtools.debugger.scopes-visible", false);
pref("devtools.debugger.start-panel-collapsed", false);
pref("devtools.debugger.end-panel-collapsed", false);
pref("devtools.debugger.tabs", "[]");