--- a/devtools/client/debugger/new/debugger.css
+++ b/devtools/client/debugger/new/debugger.css
@@ -229,16 +229,17 @@
menu {
display: inline;
padding: 0;
}
menu > menuitem::after {
content: "\25BA";
float: right;
+ padding-left: 5px;
}
menu > menupopup {
display: none;
}
menu > menuitem:hover + menupopup,
menu > menupopup:hover {
@@ -402,16 +403,23 @@ body {
}
.search-container .close-button {
width: 16px;
margin-top: 25px;
margin-right: 20px;
}
+/* Utils */
+.absolute-center {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
menupopup {
position: fixed;
z-index: 10000;
background: white;
border: 1px solid #cccccc;
padding: 5px 0;
background: #f2f2f2;
border-radius: 5px;
@@ -725,35 +733,16 @@ menuseparator {
* Make sure splitter panels are not processing any mouse
* events. This is good for performance during splitter
* bar dragging.
*/
.split-box.dragging > .controlled,
.split-box.dragging > .uncontrolled {
pointer-events: none;
}
-.search-container {
- position: absolute;
- top: 30px;
- left: 0;
- width: calc(100% - 1px);
- height: calc(100% - 31px);
- display: flex;
- z-index: 200;
- background-color: var(--theme-body-background);
-}
-
-.searchinput-container {
- display: flex;
- border-bottom: 1px solid var(--theme-splitter-color);
-}
-
-.theme-dark .result-list li .subtitle {
- color: var(--theme-comment-alt);
-}
.arrow,
.folder,
.domain,
.file,
.worker,
.refresh,
.add-button {
fill: var(--theme-splitter-color);
@@ -1019,31 +1008,39 @@ html[dir="rtl"] .managed-tree .tree .nod
fill: var(--theme-comment-alt);
}
.search-field .search-nav-buttons .nav-btn path {
fill: var(--theme-comment);
}
.project-text-search {
flex-grow: 1;
+ display: flex;
+ flex-direction: column;
+ overflow-y: hidden;
}
.project-text-search .result {
display: flex;
cursor: default;
margin-bottom: 1px;
padding: 4px 0 4px 30px;
+ font-size: 10px;
}
.project-text-search .matches-summary {
- margin-left: 2px;
+ margin-left: 5px;
+}
+
+.project-text-search .result {
+ font-family: Menlo, monospace;
}
.project-text-search .result.focused {
- background-color: #eeeeee;
+ background-color: var(--theme-codemirror-gutter-background);
}
.project-text-search .result .query-match {
background-color: var(--theme-selection-background);
color: white;
padding: 1px 4px;
margin: 0 2px 0 2px;
border-radius: 2px;
@@ -1057,65 +1054,55 @@ html[dir="rtl"] .managed-tree .tree .nod
margin-right: 1em;
width: 2em;
}
.project-text-search .file-result {
font-weight: bold;
line-height: 20px;
cursor: default;
- margin: 2px 20px 2px 0;
+ margin: 2px 0;
padding: 3px 0 3px 5px;
+ font-size: 12px;
}
.project-text-search .file-result .arrow {
margin: 2px 0 2px 0;
}
.project-text-search .file-result.focused {
- background-color: #eeeeee;
+ background-color: var(--theme-codemirror-gutter-background);
}
.project-text-search .line-match {
display: "flex";
grow: 1;
}
.project-text-search .search-field {
display: flex;
align-self: stretch;
flex-grow: 1;
}
+
+.project-text-search .managed-tree {
+ overflow-y: auto;
+}
.autocomplete {
- flex: 1;
+ position: relative;
width: 100%;
+ height: 100%;
}
.autocomplete .no-result-msg {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100%;
- color: var(--theme-graphs-full-red);
+ color: var(--theme-body-color-inactive);
font-size: 24px;
padding: 4px;
word-break: break-all;
}
-
-.autocomplete .no-result-msg .sad-face {
- width: 24px;
- margin: 0 4px;
- line-height: 0;
- flex-shrink: 0;
-}
-
-.autocomplete .no-result-msg .sad-face svg {
- fill: var(--theme-graphs-full-red);
-}
.result-list {
list-style: none;
margin: 0px;
padding: 0px;
overflow: auto;
width: calc(100% - 1px); /* 1px fixes the hidden right border */
}
@@ -1188,16 +1175,64 @@ html[dir="rtl"] .managed-tree .tree .nod
.search-bar .result-list {
border-bottom: 1px solid var(--theme-splitter-color);
}
.theme-dark .result-list {
background-color: var(--theme-body-background);
}
+.search-container {
+ position: absolute;
+ top: 30px;
+ left: 0;
+ width: calc(100% - 1px);
+ height: calc(100% - 31px);
+ display: flex;
+ flex-direction: column;
+ z-index: 200;
+ background-color: var(--theme-body-background);
+ overflow-y: auto;
+}
+
+.searchinput-container {
+ display: flex;
+ border-bottom: 1px solid var(--theme-splitter-color);
+}
+
+.theme-dark .result-list li .subtitle {
+ color: var(--theme-comment-alt);
+}
+
+.toggle-search {
+ background-color: var(--theme-toolbar-background);
+ border-bottom: 1px solid var(--theme-splitter-color);
+ color: var(--theme-comment-alt);
+ display: flex;
+ flex-shrink: 0;
+ justify-content: flex-start;
+ line-height: 40px;
+ padding: 0 13px;
+ width: calc(100% - 1px);
+}
+
+.toggle-search .title {
+ font-weight: 500;
+ font-size: 120%;
+}
+
+.toggle-search .text {
+ margin-left: 1em;
+ cursor: pointer;
+}
+
+.toggle-search .active {
+ color: var(--theme-selection-background);
+ cursor: default;
+}
.sources-panel {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
@@ -1247,17 +1282,17 @@ html[dir="rtl"] .managed-tree .tree .nod
.sources-list .managed-tree {
flex: 1;
display: flex;
overflow-x: hidden;
overflow-y: auto;
}
.theme-dark .sources-list .tree .node:not(.focused) svg {
- fill: var(--theme-comment);
+ fill: var(--theme-content-color3);
}
.theme-dark .source-list .tree .node.focused {
background-color: var(--theme-tab-toolbar-background);
}
.no-sources-message {
font-size: 12px;
@@ -1335,17 +1370,16 @@ html[dir="rtl"] .managed-tree .tree .nod
padding-right: 0.5rem;
cursor: pointer;
}
.outline-list__element:hover {
background: var(--theme-toolbar-background-hover);
}
.function-signature {
- line-height: 20px;
align-self: center;
}
.function-signature .function-name {
color: var(--theme-highlight-blue);
}
.function-signature .param {
@@ -1575,21 +1609,18 @@ html .toggle-button-end.vertical svg {
}
.search-bottom-bar .search-modifiers button svg {
fill: var(--theme-comment-alt);
height: 16px;
width: 16px;
}
-.search-bottom-bar .search-modifiers button svg:hover {
+.search-bottom-bar .search-modifiers button:hover {
cursor: pointer;
-}
-
-.search-bottom-bar .search-modifiers button:hover {
background: var(--theme-toolbar-background-hover);
}
.search-bottom-bar .search-modifiers button:active {
outline: none;
}
.search-bottom-bar .search-modifiers button.active svg {
@@ -1601,33 +1632,28 @@ html .toggle-button-end.vertical svg {
}
.search-bottom-bar .search-type-toggles {
display: flex;
align-items: center;
max-width: 68%;
}
-.search-bottom-bar .search-type-toggles .search-toggle-title {
- color: var(--theme-body-color-inactive);
- font-size: 11px;
- font-weight: normal;
- margin: 0;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.search-bottom-bar .search-type-toggles .search-type-btn {
+.search-bottom-bar .search-type-name {
+ padding: 1px 0 0 0;
margin: 0 0 0 6px;
border: none;
background: transparent;
color: var(--theme-comment-alt);
}
+.search-bottom-bar .search-type-toggles .search-type-name:hover {
+ cursor: pointer;
+}
+
.search-bottom-bar .search-type-toggles .search-type-btn:hover {
cursor: pointer;
}
.search-bottom-bar .search-type-toggles .search-type-btn:active {
outline: none;
}
@@ -1702,16 +1728,20 @@ html .toggle-button-end.vertical svg {
}
.objectBox-textNode,
.objectBox-string,
.objectBox-symbol {
color: var(--string-color);
}
+.objectBox-string a, .objectBox-string a:visited {
+ color: currentColor;
+}
+
.objectBox-function,
.objectBox-stackTrace,
.objectBox-profile {
color: var(--object-color);
}
.objectBox-Location {
font-style: italic;
@@ -1830,22 +1860,31 @@ html .toggle-button-end.vertical svg {
vertical-align: middle;
}
.objectBox-node:hover .open-inspector svg,
.objectBox-textNode:hover .open-inspector svg,
.open-inspector svg:hover {
fill: rgb(65, 175, 230);
}
+
+/******************************************************************************/
+/* "more…" ellipsis */
+.more-ellipsis {
+ color: var(--theme-comment);
+}
/* 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/. */
.tree {
overflow: auto;
+}
+
+.tree.inline {
display: inline-block;
}
.tree.nowrap {
white-space: nowrap;
}
.tree.noselect {
@@ -1884,22 +1923,28 @@ html[dir="rtl"] .arrow svg,
.arrow svg:-moz-locale-dir(rtl) {
transform: rotate(90deg);
}
.arrow.expanded.expanded svg {
transform: rotate(0deg);
}
-.object-label {
+.object-label, .object-label * {
color: var(--theme-highlight-blue);
}
-.object-value .unavailable {
- color: var(--theme-comment);
-}
+
+.tree .node .unavailable {
+ color: var(--theme-content-color3);
+}
+
+.lessen {
+ opacity: 0.6;
+}
+
.bracket-arrow {
position: absolute;
}
.bracket-arrow:hover {
cursor: pointer;
}
@@ -2008,17 +2053,17 @@ html[dir="rtl"] .arrow svg,
padding-top: 10px;
}
.theme-dark .popover .preview {
border-color: var(--theme-body-color);
}
.theme-dark .popover .preview .arrow svg {
- fill: var(--theme-comment);
+ fill: var(--theme-content-color3);
}
.tooltip {
position: fixed;
z-index: 100;
}
.tooltip .preview {
@@ -2052,30 +2097,30 @@ html[dir="rtl"] .arrow svg,
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
font-size: 14px;
line-height: 30px;
background: var(--theme-toolbar-background);
color: var(--theme-comment-alt);
+ padding: 0 4px;
}
.add-to-expression-bar .prompt {
- padding-left: 3px;
width: 1em;
}
.add-to-expression-bar .expression-to-save-label {
width: calc(100% - 4em);
}
.add-to-expression-bar .expression-to-save-button {
font-size: 14px;
- color: var(--theme-comment);
+ color: var(--theme-content-color3);
cursor: pointer;
}
.call-site {
background: #f0f9ff;
cursor: pointer;
position: relative;
}
@@ -2136,17 +2181,17 @@ html[dir="rtl"] .arrow svg,
margin-right: -7px;
}
.theme-dark {
--theme-conditional-breakpoint-color: #9fa4a9;
}
.theme-light {
- --theme-conditional-breakpoint-color: #ccd1d5;
+ --theme-conditional-breakpoint-color: var(--theme-body-color);
}
.paused .in-scope .CodeMirror-line,
.paused .in-scope .CodeMirror-linenumber {
opacity: 1;
}
.paused .CodeMirror-line,
@@ -2156,17 +2201,17 @@ html[dir="rtl"] .arrow svg,
/**
* There's a known codemirror flex issue with chrome that this addresses.
* BUG https://github.com/devtools-html/debugger.html/issues/63
*/
.editor-wrapper {
position: absolute;
height: calc(100% - 31px);
- width: 100%;
+ width: calc(100% - 1.5px);
top: 30px;
left: 0px;
--editor-footer-height: 27px;
}
html[dir="rtl"] .editor-mount {
direction: ltr;
}
@@ -2669,18 +2714,18 @@ html .breakpoints-list .breakpoint.pause
font-weight: lighter;
display: flex;
justify-content: space-between;
flex-direction: row;
align-items: center;
margin: 0;
}
-:root.theme-light .frames .location,
-:root.theme-firebug .frames .location {
+.theme-light .frames .location,
+.theme-firebug .frames .location {
color: var(--theme-comment);
}
:root.theme-dark .frames .location {
color: var(--theme-body-color);
opacity: 0.6;
}
@@ -2884,17 +2929,17 @@ html[dir="rtl"] .command-bar {
cursor: pointer;
display: inline-block;
text-align: center;
padding: 8px 5px;
position: relative;
fill: currentColor;
}
-.command-bar > button:hover {
+.command-bar > button:not(.disabled):hover {
background: var(--theme-toolbar-background-hover);
}
:root.theme-dark .command-bar > button {
color: var(--theme-body-color);
}
.command-bar > button {
@@ -2996,17 +3041,17 @@ html .command-bar > button:disabled {
font-style: italic;
text-align: center;
padding: 0.5em;
-moz-user-select: none;
user-select: none;
}
.theme-dark .secondary-panes .accordion .arrow svg {
- fill: var(--theme-comment);
+ fill: var(--theme-content-color3);
}
.welcomebox {
width: calc(100% - 1px);
/* Offsetting it by 30px for the sources-header area */
height: calc(100% - 30px);
position: absolute;
top: 30px;
@@ -3043,17 +3088,17 @@ html .welcomebox .toggle-button-end.coll
-moz-user-select: none;
user-select: none;
}
.source-header .new-tab-btn {
padding: 0px 4px;
margin-top: 4px;
cursor: pointer;
- fill: var(--theme-comment);
+ fill: var(--theme-content-color3);
transition: 0.1s ease;
align-self: center;
}
.source-header .new-tab-btn svg {
width: 12px;
}
@@ -3153,31 +3198,32 @@ html .welcomebox .toggle-button-end.coll
border: 1px solid var(--theme-splitter-color);
box-shadow: 0 4px 4px 0 var(--search-overlays-semitransparent);
max-height: 300px;
position: absolute;
right: 0;
top: 23px;
width: var(--width);
z-index: 1000;
+ overflow: scroll;
}
html[dir="rtl"] .dropdown {
right: calc((var(--width) - 11px) * (-1));
}
.dropdown-block {
padding: 0px 2px;
position: relative;
align-self: center;
}
.dropdown-button {
cursor: pointer;
- color: var(--theme-comment);
+ color: var(--theme-content-color3);
background: none;
border: none;
padding: 0;
font-weight: 100;
font-size: 14px;
}
.dropdown li {
@@ -3206,54 +3252,78 @@ html[dir="rtl"] .dropdown {
position: fixed;
width: 100%;
height: 100%;
background: transparent;
z-index: 999;
left: 0;
top: 0;
}
+.modal-wrapper {
+ position: fixed;
+ display: flex;
+ justify-content: center;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ transition: z-index 200ms;
+ z-index: 9;
+}
+
+.modal {
+ top: 0;
+ z-index: 10;
+ width: 500px;
+ height: 230px;
+ background-color: var(--theme-codemirror-gutter-background);
+ transform: translateY(-250px);
+ transition: transform 150ms cubic-bezier(0.07, 0.95, 0, 1);
+ box-shadow: 2px 4px 6px var(--popup-shadow-color);
+}
+
+.modal.entering,
+.modal.exited {
+ transform: translateY(-250px);
+}
+
+.modal.entered,
+.modal.exiting {
+ transform: translateY(30px);
+}
+
+@media (max-width: 520px) {
+ .modal {
+ width: 80%;
+ left: 10%;
+ }
+}
.symbol-modal-wrapper {
position: fixed;
width: 100%;
height: 100%;
z-index: 9;
}
.symbol-modal {
position: absolute;
left: calc(50% - 250px);
z-index: 10;
width: 500px;
height: 230px;
background-color: var(--theme-codemirror-gutter-background);
- box-shadow: 2px 4px 6px var(--popup-shadow-color);
top: 30px;
}
-.theme-dark .symbol-modal {
- box-shadow: 2px 4px 6px var(--popup-shadow-color);
-}
-
-.symbol-modal .input-wrapper {
- display: -webkit-box;
- display: -ms-flexbox;
+.symbol-modal .input-wrapper,
+.modal .input-wrapper {
display: flex;
- -webkit-box-pack: center;
- -ms-flex-pack: center;
justify-content: center;
}
-.symbol-modal .close-btn {
+.modal .close-btn {
padding: 6px;
}
-.symbol-modal .result-list {
+.modal .result-list {
height: calc(100% - 28px);
overflow-y: auto;
}
-
-@media (max-width: 520px) {
- .symbol-modal {
- width: 80%;
- left: 10%;
- }
-}
--- a/devtools/client/debugger/new/search-worker.js
+++ b/devtools/client/debugger/new/search-worker.js
@@ -1,815 +1,464 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
+ module.exports = factory(require("devtools/client/shared/vendor/lodash"));
else if(typeof define === 'function' && define.amd)
- define([], factory);
+ define(["devtools/client/shared/vendor/lodash"], factory);
else {
- var a = factory();
+ var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/lodash")) : factory(root["devtools/client/shared/vendor/lodash"]);
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
-})(this, function() {
+})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
-
+/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
-
+/******/
/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId])
+/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
-
+/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
-/******/ exports: {},
-/******/ id: moduleId,
-/******/ loaded: false
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
/******/ };
-
+/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-
+/******/
/******/ // Flag the module as loaded
-/******/ module.loaded = true;
-
+/******/ module.l = true;
+/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
-
-
+/******/
+/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
-
+/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
-
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/assets/build";
-
+/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(0);
+/******/ return __webpack_require__(__webpack_require__.s = 382);
/******/ })
/************************************************************************/
/******/ ({
-/***/ 0:
-/***/ function(module, exports, __webpack_require__) {
+/***/ 1123:
+/***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(1123);
+"use strict";
-/***/ },
-
-/***/ 6:
-/***/ function(module, exports, __webpack_require__) {
+var _getMatches = __webpack_require__(1173);
- var Symbol = __webpack_require__(7),
- getRawTag = __webpack_require__(10),
- objectToString = __webpack_require__(11);
+var _getMatches2 = _interopRequireDefault(_getMatches);
- /** `Object#toString` result references. */
- var nullTag = '[object Null]',
- undefinedTag = '[object Undefined]';
-
- /** Built-in value references. */
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+var _projectSearch = __webpack_require__(1140);
- /**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? getRawTag(value)
- : objectToString(value);
- }
-
- module.exports = baseGetTag;
-
-
-/***/ },
+var _devtoolsUtils = __webpack_require__(900);
-/***/ 7:
-/***/ function(module, exports, __webpack_require__) {
-
- var root = __webpack_require__(8);
-
- /** Built-in value references. */
- var Symbol = root.Symbol;
-
- module.exports = Symbol;
-
-
-/***/ },
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-/***/ 8:
-/***/ function(module, exports, __webpack_require__) {
-
- var freeGlobal = __webpack_require__(9);
-
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
-
- module.exports = root;
+var workerHandler = _devtoolsUtils.workerUtils.workerHandler;
-/***/ },
-
-/***/ 9:
-/***/ function(module, exports) {
-
- /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
-
- module.exports = freeGlobal;
-
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ },
+self.onmessage = workerHandler({ getMatches: _getMatches2.default, findSourceMatches: _projectSearch.findSourceMatches });
-/***/ 10:
-/***/ function(module, exports, __webpack_require__) {
-
- var Symbol = __webpack_require__(7);
-
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
-
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
+/***/ }),
- /** Built-in value references. */
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-
- /**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
+/***/ 1138:
+/***/ (function(module, exports, __webpack_require__) {
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
-
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
-
- module.exports = getRawTag;
+"use strict";
-/***/ },
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = buildQuery;
-/***/ 11:
-/***/ function(module, exports) {
-
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
+var _lodash = __webpack_require__(2);
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
-
- /**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
-
- module.exports = objectToString;
+/**
+ * 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
+ );
+}
-/***/ },
-
-/***/ 14:
-/***/ function(module, exports) {
+function wholeMatch(query, wholeWord) {
+ if (query == "" || !wholeWord) {
+ return query;
+ }
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return value != null && typeof value == 'object';
- }
+ return `\\b${query}\\b`;
+}
- module.exports = isObjectLike;
-
-
-/***/ },
-
-/***/ 70:
-/***/ function(module, exports) {
+function buildFlags(caseSensitive, isGlobal) {
+ if (caseSensitive && isGlobal) {
+ return "g";
+ }
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
+ if (!caseSensitive && isGlobal) {
+ return "gi";
+ }
- module.exports = isArray;
-
-
-/***/ },
+ if (!caseSensitive && !isGlobal) {
+ return "i";
+ }
-/***/ 72:
-/***/ function(module, exports, __webpack_require__) {
-
- var baseGetTag = __webpack_require__(6),
- isObjectLike = __webpack_require__(14);
-
- /** `Object#toString` result references. */
- var symbolTag = '[object Symbol]';
+ return;
+}
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
- }
-
- module.exports = isSymbol;
+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);
+ }
-/***/ 108:
-/***/ function(module, exports, __webpack_require__) {
+ var query = originalQuery;
+ if (ignoreSpaces) {
+ query = ignoreWhiteSpace(query);
+ }
- var baseToString = __webpack_require__(109);
+ if (!regexMatch) {
+ query = (0, _lodash.escapeRegExp)(query);
+ }
- /**
- * Converts `value` to a string. An empty string is returned for `null`
- * and `undefined` values. The sign of `-0` is preserved.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.toString(null);
- * // => ''
- *
- * _.toString(-0);
- * // => '-0'
- *
- * _.toString([1, 2, 3]);
- * // => '1,2,3'
- */
- function toString(value) {
- return value == null ? '' : baseToString(value);
- }
+ query = wholeMatch(query, wholeWord);
+ var flags = buildFlags(caseSensitive, isGlobal);
+
+ if (flags) {
+ return new RegExp(query, flags);
+ }
- module.exports = toString;
+ return new RegExp(query);
+}
+
+/***/ }),
+
+/***/ 1140:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
-/***/ },
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.findSourceMatches = findSourceMatches;
-/***/ 109:
-/***/ function(module, exports, __webpack_require__) {
+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 Symbol = __webpack_require__(7),
- arrayMap = __webpack_require__(110),
- isArray = __webpack_require__(70),
- isSymbol = __webpack_require__(72);
+ var text = source.text,
+ loading = source.loading;
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0;
+ if (loading || !text || queryText == "") {
+ return [];
+ }
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = Symbol ? Symbol.prototype : undefined,
- symbolToString = symbolProto ? symbolProto.toString : undefined;
+ var lines = text.split("\n");
+ var result = undefined;
+ var query = new RegExp(queryText, "g");
- /**
- * The base implementation of `_.toString` which doesn't convert nullish
- * values to empty strings.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- // Exit early for strings to avoid a performance hit in some environments.
- if (typeof value == 'string') {
- return value;
- }
- if (isArray(value)) {
- // Recursively convert values (susceptible to call stack limits).
- return arrayMap(value, baseToString) + '';
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : '';
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- module.exports = baseToString;
-
+ var matches = lines.map((_text, line) => {
+ var indices = [];
-/***/ },
-
-/***/ 110:
-/***/ function(module, exports) {
+ 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);
- /**
- * A specialized version of `_.map` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length,
- result = Array(length);
+ matches = (_ref = []).concat.apply(_ref, _toConsumableArray(matches));
+ return matches;
+}
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
+/***/ }),
- module.exports = arrayMap;
+/***/ 1173:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
-/***/ },
-
-/***/ 259:
-/***/ function(module, exports, __webpack_require__) {
-
- var toString = __webpack_require__(108);
-
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
- reHasRegExpChar = RegExp(reRegExpChar.source);
-
- /**
- * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
- * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escapeRegExp('[lodash](https://lodash.com/)');
- * // => '\[lodash\]\(https://lodash\.com/\)'
- */
- function escapeRegExp(string) {
- string = toString(string);
- return (string && reHasRegExpChar.test(string))
- ? string.replace(reRegExpChar, '\\$&')
- : string;
- }
-
- module.exports = escapeRegExp;
-
-
-/***/ },
-
-/***/ 900:
-/***/ function(module, exports, __webpack_require__) {
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = getMatches;
- /* 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/. */
-
- const networkRequest = __webpack_require__(901);
- const workerUtils = __webpack_require__(902);
+var _buildQuery = __webpack_require__(1138);
- module.exports = {
- networkRequest,
- workerUtils
- };
-
-/***/ },
-
-/***/ 901:
-/***/ function(module, exports) {
-
- /* 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/. */
+var _buildQuery2 = _interopRequireDefault(_buildQuery);
- function networkRequest(url, opts) {
- return new Promise((resolve, reject) => {
- const req = new XMLHttpRequest();
-
- req.addEventListener("readystatechange", () => {
- if (req.readyState === XMLHttpRequest.DONE) {
- if (req.status === 200) {
- resolve({ content: req.responseText });
- } else {
- reject(req.statusText);
- }
- }
- });
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- // Not working yet.
- // if (!opts.loadFromCache) {
- // req.channel.loadFlags = (
- // Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE |
- // Components.interfaces.nsIRequest.INHIBIT_CACHING |
- // Components.interfaces.nsIRequest.LOAD_ANONYMOUS
- // );
- // }
-
- req.open("GET", url);
- req.send();
- });
- }
+var MAX_LENGTH = 100000;
- module.exports = networkRequest;
-
-/***/ },
-
-/***/ 902:
-/***/ function(module, exports) {
-
-
-
- function WorkerDispatcher() {
- this.msgId = 1;
- this.worker = null;
- } /* 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/. */
-
- WorkerDispatcher.prototype = {
- start(url) {
- this.worker = new Worker(url);
- this.worker.onerror = () => {
- console.error(`Error in worker ${url}`);
- };
- },
-
- stop() {
- if (!this.worker) {
- return;
- }
-
- this.worker.terminate();
- this.worker = null;
- },
-
- task(method) {
- return (...args) => {
- return new Promise((resolve, reject) => {
- const id = this.msgId++;
- this.worker.postMessage({ id, method, args });
-
- const listener = ({ data: result }) => {
- if (result.id !== id) {
- return;
- }
+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];
+ if (line.length <= MAX_LENGTH) {
+ while ((singleMatch = regexQuery.exec(line)) !== null) {
+ matchedLocations.push({ line: i, ch: singleMatch.index });
+ }
+ } else {
+ return [];
+ }
+ }
+ return matchedLocations;
+}
- this.worker.removeEventListener("message", listener);
- if (result.error) {
- reject(result.error);
- } else {
- resolve(result.response);
- }
- };
+/***/ }),
- this.worker.addEventListener("message", listener);
- });
- };
- }
- };
+/***/ 2:
+/***/ (function(module, exports) {
- function workerHandler(publicInterface) {
- return function workerHandler(msg) {
- const { id, method, args } = msg.data;
- const response = publicInterface[method].apply(undefined, args);
- if (response instanceof Promise) {
- response.then(val => self.postMessage({ id, response: val }), err => self.postMessage({ id, error: err }));
- } else {
- self.postMessage({ id, response });
- }
- };
- }
+module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
- module.exports = {
- WorkerDispatcher,
- workerHandler
- };
-
-/***/ },
-
-/***/ 1123:
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
+/***/ }),
- var _getMatches = __webpack_require__(1173);
-
- var _getMatches2 = _interopRequireDefault(_getMatches);
-
- var _projectSearch = __webpack_require__(1140);
+/***/ 382:
+/***/ (function(module, exports, __webpack_require__) {
- var _projectSearch2 = _interopRequireDefault(_projectSearch);
-
- var _devtoolsUtils = __webpack_require__(900);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var workerHandler = _devtoolsUtils.workerUtils.workerHandler;
+module.exports = __webpack_require__(1123);
- self.onmessage = workerHandler({ getMatches: _getMatches2.default, searchSources: _projectSearch2.default });
-
-/***/ },
+/***/ }),
-/***/ 1138:
-/***/ function(module, exports, __webpack_require__) {
+/***/ 900:
+/***/ (function(module, exports, __webpack_require__) {
- "use strict";
+/* 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/. */
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = buildQuery;
+const networkRequest = __webpack_require__(901);
+const workerUtils = __webpack_require__(902);
- var _escapeRegExp = __webpack_require__(259);
+module.exports = {
+ networkRequest,
+ workerUtils
+};
- 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
- );
- }
+/***/ 901:
+/***/ (function(module, exports) {
+/* 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/. */
- function wholeMatch(query, wholeWord) {
- if (query == "" || !wholeWord) {
- return query;
- }
+function networkRequest(url, opts) {
+ return fetch(url, {
+ cache: opts.loadFromCache ? "default" : "no-cache"
+ }).then(res => {
+ if (res.status >= 200 && res.status < 300) {
+ return res.text().then(text => ({ content: text }));
+ }
+ return Promise.reject(`request failed with status ${res.status}`);
+ });
+}
- return `\\b${query}\\b`;
- }
-
- function buildFlags(caseSensitive, isGlobal) {
- if (caseSensitive && isGlobal) {
- return "g";
- }
+module.exports = networkRequest;
- if (!caseSensitive && isGlobal) {
- return "gi";
- }
+/***/ }),
- if (!caseSensitive && !isGlobal) {
- return "i";
- }
+/***/ 902:
+/***/ (function(module, exports) {
- return;
- }
+function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
- 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);
- }
+function WorkerDispatcher() {
+ this.msgId = 1;
+ this.worker = null;
+} /* 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/. */
- var query = originalQuery;
- if (ignoreSpaces) {
- query = ignoreWhiteSpace(query);
- }
+WorkerDispatcher.prototype = {
+ start(url) {
+ this.worker = new Worker(url);
+ this.worker.onerror = () => {
+ console.error(`Error in worker ${url}`);
+ };
+ },
- if (!regexMatch) {
- query = (0, _escapeRegExp2.default)(query);
- }
-
- query = wholeMatch(query, wholeWord);
- var flags = buildFlags(caseSensitive, isGlobal);
+ stop() {
+ if (!this.worker) {
+ return;
+ }
- if (flags) {
- return new RegExp(query, flags);
- }
-
- return new RegExp(query);
- }
+ this.worker.terminate();
+ this.worker = null;
+ },
-/***/ },
+ task(method) {
+ return (...args) => {
+ return new Promise((resolve, reject) => {
+ const id = this.msgId++;
+ this.worker.postMessage({ id, method, args });
-/***/ 1140:
-/***/ function(module, exports) {
-
- "use strict";
+ const listener = ({ data: result }) => {
+ if (result.id !== id) {
+ return;
+ }
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.searchSource = searchSource;
- exports.default = searchSources;
-
- 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); } }
+ this.worker.removeEventListener("message", listener);
+ if (result.error) {
+ reject(result.error);
+ } else {
+ resolve(result.response);
+ }
+ };
- // Maybe reuse file search's functions?
- function searchSource(source, queryText) {
- var _ref;
-
- var text = source.text,
- loading = source.loading;
-
- if (loading || !text || queryText == "") {
- return [];
- }
+ this.worker.addEventListener("message", listener);
+ });
+ };
+ }
+};
- var lines = text.split("\n");
- var result = undefined;
- var query = new RegExp(queryText, "g");
-
- var matches = lines.map((_text, line) => {
- var indices = [];
+function workerHandler(publicInterface) {
+ return function (msg) {
+ const { id, method, args } = msg.data;
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+ if (response instanceof Promise) {
+ response.then(val => self.postMessage({ id, response: val }), err => self.postMessage({ id, error: err }));
+ } else {
+ self.postMessage({ id, response });
+ }
+ } catch (error) {
+ self.postMessage({ id, error });
+ }
+ };
+}
- while (result = query.exec(_text)) {
- indices.push({
- line: line + 1,
- column: result.index,
- match: result[0],
- value: _text,
- text: result.input
- });
- }
- return indices;
- }).filter(_matches => _matches.length > 0);
+function streamingWorkerHandler(publicInterface, { timeout = 100 } = {}, worker = self) {
+ let streamingWorker = (() => {
+ var _ref = _asyncToGenerator(function* (id, tasks) {
+ let isWorking = true;
- matches = (_ref = []).concat.apply(_ref, _toConsumableArray(matches));
- return matches;
- }
+ const intervalId = setTimeout(function () {
+ isWorking = false;
+ }, timeout);
- function searchSources(query, sources) {
- var validSources = sources.valueSeq().filter(s => s.has("text")).toJS();
- return validSources.map(source => ({
- source,
- filepath: source.url,
- matches: searchSource(source, query)
- }));
- }
-
-/***/ },
-
-/***/ 1173:
-/***/ function(module, exports, __webpack_require__) {
+ const results = [];
+ while (tasks.length !== 0 && isWorking) {
+ const { callback, context, args } = tasks.shift();
+ const result = yield callback.call(context, args);
+ results.push(result);
+ }
+ worker.postMessage({ id, status: "pending", data: results });
+ clearInterval(intervalId);
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = getMatches;
+ if (tasks.length !== 0) {
+ yield streamingWorker(id, tasks);
+ }
+ });
- var _buildQuery = __webpack_require__(1138);
-
- var _buildQuery2 = _interopRequireDefault(_buildQuery);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var MAX_LENGTH = 100000;
+ return function streamingWorker(_x, _x2) {
+ return _ref.apply(this, arguments);
+ };
+ })();
- 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];
- if (line.length <= MAX_LENGTH) {
- while ((singleMatch = regexQuery.exec(line)) !== null) {
- matchedLocations.push({ line: i, ch: singleMatch.index });
- }
- } else {
- return [];
- }
- }
- return matchedLocations;
- }
+ return (() => {
+ var _ref2 = _asyncToGenerator(function* (msg) {
+ const { id, method, args } = msg.data;
+ const workerMethod = publicInterface[method];
+ if (!workerMethod) {
+ console.error(`Could not find ${method} defined in worker.`);
+ }
+ worker.postMessage({ id, status: "start" });
-/***/ }
+ try {
+ const tasks = workerMethod(args);
+ yield streamingWorker(id, tasks);
+ worker.postMessage({ id, status: "done" });
+ } catch (error) {
+ worker.postMessage({ id, status: "error", error });
+ }
+ });
-/******/ })
-});
-;
\ No newline at end of file
+ return function (_x3) {
+ return _ref2.apply(this, arguments);
+ };
+ })();
+}
+
+module.exports = {
+ WorkerDispatcher,
+ workerHandler,
+ streamingWorkerHandler
+};
+
+/***/ })
+
+/******/ });
+});
\ No newline at end of file
--- a/devtools/client/debugger/new/test/mochitest/browser.ini
+++ b/devtools/client/debugger/new/test/mochitest/browser.ini
@@ -64,15 +64,19 @@ skip-if = debug # bug 1374187
skip-if = os == "linux" # bug 1351952
[browser_dbg-pause-exceptions.js]
[browser_dbg-navigation.js]
[browser_dbg-pretty-print.js]
[browser_dbg-pretty-print-paused.js]
[browser_dbg-scopes-mutations.js]
[browser_dbg-searching.js]
skip-if = true
+[browser_dbg-search-file.js]
+[browser_dbg-search-sources.js]
+[browser_dbg-search-symbols.js]
+[browser_dbg-search-project.js]
[browser_dbg-sourcemaps.js]
[browser_dbg-sourcemaps-reloading.js]
[browser_dbg-sourcemaps2.js]
[browser_dbg-sourcemaps-bogus.js]
[browser_dbg-sources.js]
[browser_dbg-tabs.js]
[browser_dbg-toggling-tools.js]
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking-from-console.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking-from-console.js
@@ -24,10 +24,10 @@ add_task(function*() {
// Create a dbg context
const dbg = createDebuggerContext(toolbox);
const { selectors: { getSelectedSource }, getState } = dbg;
// Make sure the thread is paused in the right source and location
yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
is(dbg.win.cm.getValue(), "debugger");
const source = getSelectedSource(getState()).toJS();
- assertPausedLocation(dbg, source, 1);
+ assertPausedLocation(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking.js
@@ -1,32 +1,32 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests the breakpoints are hit in various situations.
-add_task(function* () {
+add_task(function*() {
const dbg = yield initDebugger("doc-scripts.html");
const { selectors: { getSelectedSource }, getState } = dbg;
// 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);
+ assertPausedLocation(dbg);
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);
+ assertPausedLocation(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js
@@ -29,14 +29,18 @@ add_task(function*() {
const dbg = yield initDebugger("doc-scripts.html");
const { selectors: { getBreakpoints, getBreakpoint }, getState } = dbg;
const source = findSource(dbg, "simple1.js");
yield selectSource(dbg, source.url);
yield addBreakpoint(dbg, 5);
yield addBreakpoint(dbg, 2);
+ const syncedBps = waitForDispatch(dbg, "SYNC_BREAKPOINT", 2);
yield reload(dbg, "simple1");
yield waitForSelectedSource(dbg);
yield waitForDispatch(dbg, "SYNC_BREAKPOINT", 2);
+ yield syncedBps;
+
+ yield waitForDispatch(dbg, "SYNC_BREAKPOINT", 2);
assertEditorBreakpoint(dbg, 4);
assertEditorBreakpoint(dbg, 5);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-debugger-buttons.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-debugger-buttons.js
@@ -19,36 +19,36 @@ function clickStepOut(dbg) {
/**
* Test debugger buttons
* 1. resume
* 2. stepOver
* 3. stepIn
* 4. stepOver to the end of a function
* 5. stepUp at the end of a function
*/
-add_task(function* () {
+add_task(function*() {
const dbg = yield initDebugger("doc-debugger-statements.html");
yield reload(dbg);
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 8);
+ assertPausedLocation(dbg);
// resume
clickElement(dbg, "resume");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 12);
+ assertPausedLocation(dbg);
// step over
yield clickStepOver(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 13);
+ assertPausedLocation(dbg);
// step into
yield clickStepIn(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 18);
+ assertPausedLocation(dbg);
// step over
yield clickStepOver(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 20);
+ assertPausedLocation(dbg);
// step out
yield clickStepOut(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 20);
+ assertPausedLocation(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js
@@ -24,31 +24,31 @@ add_task(function*() {
// Set the initial breakpoint.
yield addBreakpoint(dbg, simple1, 4);
ok(!getSelectedSource(getState()), "No selected source");
// Call the function that we set a breakpoint in.
invokeInTab("main");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, simple1, 4);
+ assertPausedLocation(dbg);
// Step through to another file and make sure it's paused in the
// right place.
yield stepIn(dbg);
- assertPausedLocation(dbg, simple2, 2);
+ assertPausedLocation(dbg);
// Step back out to the initial file.
yield stepOut(dbg);
yield stepOut(dbg);
- assertPausedLocation(dbg, simple1, 5);
+ assertPausedLocation(dbg);
yield resume(dbg);
// Make sure that we can set a breakpoint on a line out of the
// viewport, and that pausing there scrolls the editor to it.
let longSrc = findSource(dbg, "long.js");
yield addBreakpoint(dbg, longSrc, 66);
invokeInTab("testModel");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, longSrc, 66);
+ assertPausedLocation(dbg);
ok(isElementVisible(dbg, "breakpoint"), "Breakpoint is visible");
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js
@@ -50,17 +50,18 @@ add_task(function*() {
yield waitForPaused(dbg);
yield addExpression(dbg, "f");
is(getLabel(dbg, 1), "f");
is(getValue(dbg, 1), "(unavailable)");
yield editExpression(dbg, "oo");
is(getLabel(dbg, 1), "foo()");
- is(getValue(dbg, 1), "");
+ // There is no "value" element for functions.
+ is(findElement(dbg, "expressionValue", 1), null);
yield addExpression(dbg, "location");
is(getLabel(dbg, 2), "location");
ok(getValue(dbg, 2).includes("Location"), "has a value");
// can expand an expression
toggleExpression(dbg, 2);
yield waitForDispatch(dbg, "LOAD_OBJECT_PROPERTIES");
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-iframes.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-iframes.js
@@ -1,26 +1,26 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test debugging a page with iframes
* 1. pause in the main thread
* 2. pause in the iframe
*/
-add_task(function* () {
+add_task(function*() {
const dbg = yield initDebugger("doc-iframes.html");
// test pausing in the main thread
yield reload(dbg);
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "iframes.html", 8);
+ assertPausedLocation(dbg);
// test pausing in the iframe
yield resume(dbg);
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 8);
+ assertPausedLocation(dbg);
// test pausing in the iframe
yield resume(dbg);
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 12);
+ assertPausedLocation(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-navigation.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-navigation.js
@@ -5,43 +5,46 @@ function countSources(dbg) {
const sources = dbg.selectors.getSources(dbg.getState());
return sources.size;
}
/**
* Test navigating
* navigating while paused will reset the pause state and sources
*/
-add_task(function* () {
+add_task(function*() {
const dbg = yield initDebugger("doc-script-switching.html");
const { selectors: { getSelectedSource, getPause }, getState } = dbg;
invokeInTab("firstCall");
yield waitForPaused(dbg);
yield navigate(dbg, "doc-scripts.html", "simple1.js");
yield addBreakpoint(dbg, "simple1.js", 4);
invokeInTab("main");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "simple1.js", 4);
+ assertPausedLocation(dbg);
is(countSources(dbg), 4, "4 sources are loaded.");
yield navigate(dbg, "about:blank");
yield waitForDispatch(dbg, "NAVIGATE");
is(countSources(dbg), 0, "0 sources are loaded.");
ok(!getPause(getState()), "No pause state exists");
- yield navigate(dbg,
+ yield navigate(
+ dbg,
"doc-scripts.html",
"simple1.js",
"simple2.js",
"long.js",
"scripts.html"
);
is(countSources(dbg), 4, "4 sources are loaded.");
// Test that the current select source persists across reloads
yield selectSource(dbg, "long.js");
yield reload(dbg, "long.js");
- ok(getSelectedSource(getState()).get("url").includes("long.js"),
- "Selected source is long.js");
+ ok(
+ getSelectedSource(getState()).get("url").includes("long.js"),
+ "Selected source is long.js"
+ );
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-pause-exceptions.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-pause-exceptions.js
@@ -11,35 +11,35 @@ function caughtException() {
/*
Tests Pausing on exception
1. skip an uncaught exception
2. pause on an uncaught exception
3. pause on a caught error
4. skip a caught error
*/
-add_task(function* () {
+add_task(function*() {
const dbg = yield initDebugger("doc-exceptions.html");
// test skipping an uncaught exception
yield uncaughtException();
ok(!isPaused(dbg));
// Test pausing on an uncaught exception
yield togglePauseOnExceptions(dbg, true, false);
uncaughtException();
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "exceptions.js", 2);
+ assertPausedLocation(dbg);
yield resume(dbg);
// Test pausing on a caught Error
caughtException();
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "exceptions.js", 15);
+ assertPausedLocation(dbg);
yield resume(dbg);
// Test skipping a caught error
yield togglePauseOnExceptions(dbg, true, true);
caughtException();
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "exceptions.js", 17);
+ assertPausedLocation(dbg);
yield resume(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print-paused.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print-paused.js
@@ -1,22 +1,23 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests pretty-printing a source that is currently paused.
-add_task(function* () {
+add_task(function*() {
const dbg = yield initDebugger("doc-minified.html");
yield selectSource(dbg, "math.min.js");
yield addBreakpoint(dbg, "math.min.js", 2);
invokeInTab("arithmetic");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "math.min.js", 2);
+ assertPausedLocation(dbg);
clickElement(dbg, "prettyPrintButton");
- yield waitForDispatch(dbg, "TOGGLE_PRETTY_PRINT");
+ yield waitForDispatch(dbg, "SELECT_SOURCE");
- assertPausedLocation(dbg, "math.min.js:formatted", 18);
+ // this doesnt work yet
+ // assertPausedLocation(dbg);
yield resume(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print.js
@@ -1,30 +1,34 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests basic pretty-printing functionality.
add_task(function*() {
const dbg = yield initDebugger("doc-minified.html");
- yield selectSource(dbg, "math.min.js");
+ yield selectSource(dbg, "math.min.js", 2);
clickElement(dbg, "prettyPrintButton");
- yield waitForDispatch(dbg, "TOGGLE_PRETTY_PRINT");
+
+ yield waitForSource(dbg, "math.min.js:formatted");
+ const ppSrc = findSource(dbg, "math.min.js:formatted");
- const ppSrc = findSource(dbg, "math.min.js:formatted");
ok(ppSrc, "Pretty-printed source exists");
+ // this is not implemented yet
+ // assertHighlightLocation(dbg, "math.min.js:formatted", 18);
+
yield addBreakpoint(dbg, ppSrc, 18);
invokeInTab("arithmetic");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, ppSrc, 18);
+ assertPausedLocation(dbg);
yield stepOver(dbg);
- assertPausedLocation(dbg, ppSrc, 27);
+ assertPausedLocation(dbg);
yield resume(dbg);
// The pretty-print button should go away in the pretty-printed
// source.
ok(!findElement(dbg, "editorFooter"), "Footer is hidden");
yield selectSource(dbg, "math.min.js");
ok(findElement(dbg, "editorFooter"), "Footer is hidden");
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-scopes-mutations.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-scopes-mutations.js
@@ -6,86 +6,86 @@ function getScopeNodeLabel(dbg, index) {
}
function getScopeNodeValue(dbg, index) {
return findElement(dbg, "scopeValue", index).innerText;
}
function expandNode(dbg, index) {
let onLoadProperties = onLoadObjectProperties(dbg);
- clickElement(dbg, "scopeNode", index);
+ findElement(dbg, "scopeNode", index).click();
return onLoadProperties;
}
function toggleScopes(dbg) {
return findElement(dbg, "scopesHeader").click();
}
function onLoadObjectProperties(dbg) {
return waitForDispatch(dbg, "LOAD_OBJECT_PROPERTIES");
}
-add_task(async function() {
- const dbg = await initDebugger("doc-script-mutate.html");
+add_task(function*() {
+ const dbg = yield initDebugger("doc-script-mutate.html");
toggleScopes(dbg);
let onPaused = waitForPaused(dbg);
invokeInTab("mutate");
- await onPaused;
+ yield onPaused;
is(
getScopeNodeLabel(dbg, 2),
"<this>",
'The second element in the scope panel is "<this>"'
);
is(
getScopeNodeLabel(dbg, 3),
"phonebook",
'The third element in the scope panel is "phonebook"'
);
- // Expand `phonebook`
- await expandNode(dbg, 3);
+ info("Expand `phonebook`");
+ yield expandNode(dbg, 3);
is(
getScopeNodeLabel(dbg, 4),
"S",
'The fourth element in the scope panel is "S"'
);
- // Expand `S`
- await expandNode(dbg, 4);
+ info("Expand `S`");
+ yield expandNode(dbg, 4);
is(
getScopeNodeLabel(dbg, 5),
"sarah",
'The fifth element in the scope panel is "sarah"'
);
is(
getScopeNodeLabel(dbg, 6),
"serena",
'The sixth element in the scope panel is "serena"'
);
- // Expand `sarah`
- await expandNode(dbg, 5);
+ info("Expand `sarah`");
+ yield expandNode(dbg, 5);
is(
getScopeNodeLabel(dbg, 6),
"lastName",
'The sixth element in the scope panel is now "lastName"'
);
is(
getScopeNodeValue(dbg, 6),
'"Doe"',
'The "lastName" element has the expected "Doe" value'
);
info("Resuming");
onPaused = waitForPaused(dbg);
- await resume(dbg);
- await onPaused;
+ yield resume(dbg);
+ yield onPaused;
is(
getScopeNodeLabel(dbg, 2),
"<this>",
'The second element in the scope panel is "<this>"'
);
is(
getScopeNodeLabel(dbg, 3),
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-search-file.js
@@ -0,0 +1,61 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Tests the search bar correctly responds to queries, enter, shift enter
+
+function waitForDebounce() {
+ return new Promise(re => setTimeout(re, 200));
+}
+
+function getFocusedEl(dbg) {
+ let doc = dbg.win.document;
+ return doc.activeElement;
+}
+
+add_task(function*() {
+ const dbg = yield initDebugger("doc-scripts.html");
+ const {
+ selectors: { getBreakpoints, getBreakpoint, getActiveSearch },
+ getState
+ } = dbg;
+ const source = findSource(dbg, "simple1.js");
+
+ yield selectSource(dbg, source.url);
+
+ const cm = getCM(dbg);
+ pressKey(dbg, "fileSearch");
+ is(dbg.selectors.getActiveSearchState(dbg.getState()), "file");
+
+ // test closing and re-opening
+ pressKey(dbg, "Escape");
+ is(dbg.selectors.getActiveSearchState(dbg.getState()), null);
+
+ pressKey(dbg, "fileSearch");
+
+ const el = getFocusedEl(dbg);
+
+ type(dbg, "con");
+ yield waitForDebounce();
+
+ const state = cm.state.search;
+
+ pressKey(dbg, "Enter");
+ is(state.posFrom.line, 3);
+
+ pressKey(dbg, "Enter");
+ is(state.posFrom.line, 4);
+
+ pressKey(dbg, "ShiftEnter");
+ is(state.posFrom.line, 3);
+
+ pressKey(dbg, "fileSearch");
+ type(dbg, "fun");
+
+ pressKey(dbg, "Enter");
+ is(state.posFrom.line, 4);
+
+ // selecting another source keeps search open
+ yield selectSource(dbg, "simple2");
+ pressKey(dbg, "Enter");
+ is(state.posFrom.line, 0);
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-search-project.js
@@ -0,0 +1,71 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function openProjectSearch(dbg) {
+ synthesizeKeyShortcut("CmdOrCtrl+Shift+F");
+ return waitForState(
+ dbg,
+ state => dbg.selectors.getActiveSearchState(state) === "project"
+ );
+}
+
+function closeProjectSearch(dbg) {
+ pressKey(dbg, "Escape");
+ return waitForState(dbg, state => !dbg.selectors.getActiveSearchState(state));
+}
+
+function getResult(dbg) {
+ return findElementWithSelector(dbg, ".managed-tree .result");
+}
+
+async function selectResult(dbg) {
+ const item = getResult(dbg);
+ const select = waitForDispatch(dbg, "SELECT_SOURCE");
+ item.click();
+ return select;
+}
+
+function getResultsCount(dbg) {
+ const matches = dbg.selectors
+ .getTextSearchResults(dbg.getState())
+ .valueSeq()
+ .map(file => file.matches)
+ .toJS();
+
+ return [...matches].length;
+}
+
+// Testing project search
+add_task(function*() {
+ Services.prefs.setBoolPref(
+ "devtools.debugger.project-text-search-enabled",
+ true
+ );
+
+ const dbg = yield initDebugger("doc-script-switching.html", "switching-01");
+
+ yield selectSource(dbg, "switching-01");
+
+ // test opening and closing
+ yield openProjectSearch(dbg);
+ yield closeProjectSearch(dbg);
+
+ yield openProjectSearch(dbg);
+ type(dbg, "first");
+ pressKey(dbg, "Enter");
+
+ yield waitForState(dbg, () => getResultsCount(dbg) === 1);
+
+ yield selectResult(dbg);
+ is(dbg.selectors.getActiveSearchState(dbg.getState()), null);
+
+ const selectedSource = dbg.selectors.getSelectedSource(dbg.getState());
+ ok(selectedSource.get("url").includes("switching-01"));
+});
+
+registerCleanupFunction(() => {
+ Services.prefs.clearUserPref(
+ "devtools.debugger.project-text-search-enabled",
+ false
+ );
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-search-sources.js
@@ -0,0 +1,34 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Testing source search
+add_task(function*() {
+ const dbg = yield initDebugger("doc-script-switching.html");
+
+ // test opening and closing
+ pressKey(dbg, "sourceSearch");
+ is(dbg.selectors.getActiveSearchState(dbg.getState()), "source");
+ pressKey(dbg, "Escape");
+ is(dbg.selectors.getActiveSearchState(dbg.getState()), null);
+
+ pressKey(dbg, "sourceSearch");
+ yield waitForElement(dbg, "input");
+ findElementWithSelector(dbg, "input").focus();
+ type(dbg, "sw");
+ pressKey(dbg, "Enter");
+
+ yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
+ let source = dbg.selectors.getSelectedSource(dbg.getState());
+ ok(source.get("url").match(/switching-01/), "first source is selected");
+
+ // 2. arrow keys and check to see if source is selected
+ pressKey(dbg, "sourceSearch");
+ findElementWithSelector(dbg, "input").focus();
+ type(dbg, "sw");
+ pressKey(dbg, "Down");
+ pressKey(dbg, "Enter");
+
+ yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
+ source = dbg.selectors.getSelectedSource(dbg.getState());
+ ok(source.get("url").match(/switching-02/), "second source is selected");
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-search-symbols.js
@@ -0,0 +1,30 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+async function openFunctionSearch(dbg) {
+ synthesizeKeyShortcut("CmdOrCtrl+Shift+O");
+ return new Promise(r => setTimeout(r, 200));
+}
+
+function resultCount(dbg) {
+ return findAllElements(dbg, "resultItems").length;
+}
+
+// Testing function search
+add_task(function*() {
+ const dbg = yield initDebugger("doc-script-switching.html", "switching-01");
+
+ yield selectSource(dbg, "switching-01");
+
+ // test opening and closing
+ yield openFunctionSearch(dbg);
+ is(dbg.selectors.getActiveSearchState(dbg.getState()), "symbol");
+ pressKey(dbg, "Escape");
+ is(dbg.selectors.getActiveSearchState(dbg.getState()), null);
+
+ yield openFunctionSearch(dbg);
+ is(resultCount(dbg), 1);
+
+ type(dbg, "x");
+ is(resultCount(dbg), 0);
+});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps-bogus.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps-bogus.js
@@ -13,14 +13,14 @@ add_task(function*() {
yield selectSource(dbg, "bogus-map.js");
// We should still be able to set breakpoints and pause in the
// generated source.
yield addBreakpoint(dbg, "bogus-map.js", 4);
invokeInTab("runCode");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "bogus-map.js", 4);
+ assertPausedLocation(dbg);
// Make sure that only the single generated source exists. The
// sourcemap failed to download.
is(getSources(getState()).size, 1, "Only 1 source exists");
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps.js
@@ -70,19 +70,19 @@ add_task(function*() {
// Test breaking on a breakpoint
yield addBreakpoint(dbg, "entry.js", 15);
is(getBreakpoints(getState()).size, 2, "Two breakpoints exist");
assertBreakpointExists(dbg, entrySrc, 15);
invokeInTab("keepMeAlive");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, entrySrc, 15);
+ assertPausedLocation(dbg);
yield stepIn(dbg);
- assertPausedLocation(dbg, "times2.js", 2);
+ assertPausedLocation(dbg);
yield stepOver(dbg);
- assertPausedLocation(dbg, "times2.js", 3);
+ assertPausedLocation(dbg);
yield stepOut(dbg);
yield stepOut(dbg);
- assertPausedLocation(dbg, "entry.js", 16);
+ assertPausedLocation(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps2.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps2.js
@@ -26,10 +26,10 @@ add_task(function*() {
ok(
getBreakpoint(getState(), { sourceId: mainSrc.id, line: 4, column: 2 }),
"Breakpoint has correct line"
);
invokeInTab("logMessage");
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "main.js", 4);
+ assertPausedLocation(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg_keyboard-shortcuts.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg_keyboard-shortcuts.js
@@ -25,22 +25,22 @@ function pressStepOut(dbg) {
return waitForPaused(dbg);
}
add_task(function*() {
const dbg = yield initDebugger("doc-debugger-statements.html");
yield reload(dbg);
yield waitForPaused(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 8);
+ assertPausedLocation(dbg);
yield pressResume(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 12);
+ assertPausedLocation(dbg);
yield pressStepIn(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 13);
+ assertPausedLocation(dbg);
yield pressStepOut(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 14);
+ assertPausedLocation(dbg);
yield pressStepOver(dbg);
- assertPausedLocation(dbg, "debugger-statements.html", 9);
+ assertPausedLocation(dbg);
});
--- a/devtools/client/debugger/new/test/mochitest/head.js
+++ b/devtools/client/debugger/new/test/mochitest/head.js
@@ -142,16 +142,20 @@ function waitForThreadEvents(dbg, eventN
* @memberof mochitest/waits
* @param {Object} dbg
* @param {Function} predicate
* @return {Promise}
* @static
*/
function waitForState(dbg, predicate) {
return new Promise(resolve => {
+ if (predicate(dbg.store.getState())) {
+ return resolve();
+ }
+
const unsubscribe = dbg.store.subscribe(() => {
if (predicate(dbg.store.getState())) {
unsubscribe();
resolve();
}
});
});
}
@@ -182,52 +186,68 @@ function waitForSources(dbg, ...sources)
if (!sourceExists(store.getState())) {
return waitForState(dbg, sourceExists);
}
})
);
}
+/**
+ * Waits for a source to be loaded.
+ *
+ * @memberof mochitest/waits
+ * @param {Object} dbg
+ * @param {String} source
+ * @return {Promise}
+ * @static
+ */
+function waitForSource(dbg, url) {
+ return waitForState(dbg, state => {
+ const sources = dbg.selectors.getSources(state);
+ return sources.find(s => (s.get("url") || "").includes(url));
+ });
+}
+
function waitForElement(dbg, selector) {
return waitUntil(() => findElementWithSelector(dbg, selector));
}
-function waitForSelectedSource(dbg) {
+function waitForSelectedSource(dbg, sourceId) {
return waitForState(dbg, state => {
const source = dbg.selectors.getSelectedSource(state);
- return source && source.has("loading") && !source.get("loading");
+ const isLoaded = source && source.has("loading") && !source.get("loading");
+ if (sourceId) {
+ return isLoaded && sourceId == source.get("id");
+ }
+
+ return isLoaded;
});
}
/**
* Assert that the debugger is paused at the correct location.
*
* @memberof mochitest/asserts
* @param {Object} dbg
* @param {String} source
* @param {Number} line
* @static
*/
-function assertPausedLocation(dbg, source, line) {
+function assertPausedLocation(dbg) {
const { selectors: { getSelectedSource, getPause }, getState } = dbg;
- source = findSource(dbg, source);
- // Check the selected source
- is(getSelectedSource(getState()).get("id"), source.id);
+ ok(isTopFrameSelected(dbg, getState()), "top frame's source is selected");
// Check the pause location
const pause = getPause(getState());
- const location = pause && pause.frame && pause.frame.location;
-
- is(location.sourceId, source.id);
- is(location.line, line);
+ const pauseLine = pause && pause.frame && pause.frame.location.line;
// Check the debug line
- const lineInfo = getCM(dbg).lineInfo(line - 1);
+ const lineInfo = getCM(dbg).lineInfo(pauseLine - 1);
ok(
lineInfo.wrapClass.includes("debug-line"),
"Line is highlighted as paused"
);
const markedSpans = lineInfo.handle.markedSpans;
if (markedSpans && markedSpans.length > 0) {
const marker = markedSpans[0].marker;
@@ -281,34 +301,47 @@ function isPaused(dbg) {
/**
* Waits for the debugger to be fully paused.
*
* @memberof mochitest/waits
* @param {Object} dbg
* @static
*/
-function waitForPaused(dbg) {
- return Task.spawn(function*() {
- // We want to make sure that we get both a real paused event and
- // that the state is fully populated. The client may do some more
- // work (call other client methods) before populating the state.
- yield waitForThreadEvents(dbg, "paused"), yield waitForState(dbg, state => {
- const pause = dbg.selectors.getPause(state);
- // Make sure we have the paused state.
- if (!pause) {
- return false;
- }
- // Make sure the source text is completely loaded for the
- // source we are paused in.
- const sourceId = pause && pause.frame && pause.frame.location.sourceId;
- const source = dbg.selectors.getSource(dbg.getState(), sourceId);
- return source && source.has("loading") && !source.get("loading");
- });
- });
+async function waitForPaused(dbg) {
+ // We want to make sure that we get both a real paused event and
+ // that the state is fully populated. The client may do some more
+ // work (call other client methods) before populating the state.
+ await waitForThreadEvents(dbg, "paused");
+ await waitForState(dbg, state => isTopFrameSelected(dbg, state));
+}
+
+function isTopFrameSelected(dbg, state) {
+ const pause = dbg.selectors.getPause(state);
+
+ // Make sure we have the paused state.
+ if (!pause) {
+ return false;
+ }
+
+ // Make sure the source text is completely loaded for the
+ // source we are paused in.
+ const sourceId = pause.frame && pause.frame.location.sourceId;
+ const source = dbg.selectors.getSelectedSource(state);
+
+ if (!source) {
+ return false;
+ }
+
+ const isLoaded = source.has("loading") && !source.get("loading");
+ if (!isLoaded) {
+ return false;
+ }
+
+ return source.get("id") == sourceId;
}
function createDebuggerContext(toolbox) {
const panel = toolbox.getPanel("jsdebugger");
const win = panel.panelWin;
const { store, client, selectors, actions } = panel.getVarsForTests();
return {
@@ -459,17 +492,17 @@ function stepOut(dbg) {
*/
function resume(dbg) {
info("Resuming");
dbg.actions.resume();
return waitForThreadEvents(dbg, "resumed");
}
function deleteExpression(dbg, input) {
- info("Resuming");
+ info(`Delete expression "${input}"`);
return dbg.actions.deleteExpression({ input });
}
/**
* Reloads the debuggee.
*
* @memberof mochitest/actions
* @param {Object} dbg
@@ -582,40 +615,47 @@ function invokeInTab(fnc) {
const isLinux = Services.appinfo.OS === "Linux";
const isMac = Services.appinfo.OS === "Darwin";
const cmdOrCtrl = isLinux ? { ctrlKey: true } : { metaKey: true };
const shiftOrAlt = isMac
? { accelKey: true, shiftKey: true }
: { accelKey: true, altKey: true };
+const cmdShift = isMac
+ ? { accelKey: true, shiftKey: true, metaKey: true }
+ : { accelKey: true, altKey: true, ctrlKey: true };
+
// On Mac, going to beginning/end only works with meta+left/right. On
// Windows, it only works with home/end. On Linux, apparently, either
// ctrl+left/right or home/end work.
const endKey = isMac
? { code: "VK_RIGHT", modifiers: cmdOrCtrl }
: { code: "VK_END" };
const startKey = isMac
? { code: "VK_LEFT", modifiers: cmdOrCtrl }
: { code: "VK_HOME" };
const keyMappings = {
debugger: { code: "s", modifiers: shiftOrAlt },
inspector: { code: "c", modifiers: shiftOrAlt },
sourceSearch: { code: "p", modifiers: cmdOrCtrl },
fileSearch: { code: "f", modifiers: cmdOrCtrl },
+ functionSearch: { code: "o", modifiers: cmdShift },
Enter: { code: "VK_RETURN" },
+ ShiftEnter: { code: "VK_RETURN", modifiers: shiftOrAlt },
Up: { code: "VK_UP" },
Down: { code: "VK_DOWN" },
Right: { code: "VK_RIGHT" },
Left: { code: "VK_LEFT" },
End: endKey,
Start: startKey,
Tab: { code: "VK_TAB" },
Escape: { code: "VK_ESCAPE" },
+ Delete: { code: "VK_DELETE" },
pauseKey: { code: "VK_F8" },
resumeKey: { code: "VK_F8" },
stepOverKey: { code: "VK_F10" },
stepInKey: { code: "VK_F11", modifiers: { ctrlKey: isLinux } },
stepOutKey: {
code: "VK_F11",
modifiers: { ctrlKey: isLinux, shiftKey: true }
}
@@ -626,48 +666,47 @@ const keyMappings = {
*
* @memberof mochitest/helpers
* @param {Object} dbg
* @param {String} keyName
* @return {Promise}
* @static
*/
function pressKey(dbg, keyName) {
- let keyEvent = keyMappings[keyName];
+ const keyEvent = keyMappings[keyName];
const { code, modifiers } = keyEvent;
return EventUtils.synthesizeKey(code, modifiers || {}, dbg.win);
}
function type(dbg, string) {
- string.split("").forEach(char => {
- EventUtils.synthesizeKey(char, {}, dbg.win);
- });
+ string.split("").forEach(char => EventUtils.synthesizeKey(char, {}, dbg.win));
}
function isVisibleWithin(outerEl, innerEl) {
const innerRect = innerEl.getBoundingClientRect();
const outerRect = outerEl.getBoundingClientRect();
return innerRect.top > outerRect.top && innerRect.bottom < outerRect.bottom;
}
const selectors = {
callStackHeader: ".call-stack-pane ._header",
callStackBody: ".call-stack-pane .pane",
expressionNode: i =>
`.expressions-list .expression-container:nth-child(${i}) .object-label`,
expressionValue: i =>
- `.expressions-list .expression-container:nth-child(${i}) .object-value`,
+ `.expressions-list .expression-container:nth-child(${i}) .object-delimiter + *`,
expressionClose: i =>
`.expressions-list .expression-container:nth-child(${i}) .close`,
expressionNodes: ".expressions-list .tree-node",
scopesHeader: ".scopes-pane ._header",
breakpointItem: i => `.breakpoints-list .breakpoint:nth-child(${i})`,
scopeNode: i => `.scopes-list .tree-node:nth-child(${i}) .object-label`,
- scopeValue: i => `.scopes-list .tree-node:nth-child(${i}) .object-value`,
+ scopeValue: i =>
+ `.scopes-list .tree-node:nth-child(${i}) .object-delimiter + *`,
frame: i => `.frames ul li:nth-child(${i})`,
frames: ".frames ul li",
gutter: i => `.CodeMirror-code *:nth-child(${i}) .CodeMirror-linenumber`,
menuitem: i => `menupopup menuitem:nth-child(${i})`,
pauseOnExceptions: ".pause-exceptions",
breakpoint: ".CodeMirror-code > .new-breakpoint",
highlightLine: ".CodeMirror-code > .highlight-line",
codeMirror: ".CodeMirror",
@@ -677,17 +716,18 @@ const selectors = {
stepOut: ".stepOut.active",
stepIn: ".stepIn.active",
toggleBreakpoints: ".breakpoints-toggle",
prettyPrintButton: ".prettyPrint",
sourcesFooter: ".sources-panel .source-footer",
editorFooter: ".editor-pane .source-footer",
sourceNode: i => `.sources-list .tree-node:nth-child(${i})`,
sourceNodes: ".sources-list .tree-node",
- sourceArrow: i => `.sources-list .tree-node:nth-child(${i}) .arrow`
+ sourceArrow: i => `.sources-list .tree-node:nth-child(${i}) .arrow`,
+ resultItems: `.result-list .result-item`
};
function getSelector(elementName, ...args) {
let selector = selectors[elementName];
if (!selector) {
throw new Error(`The selector ${elementName} is not defined`);
}
--- a/devtools/client/locales/en-US/debugger.properties
+++ b/devtools/client/locales/en-US/debugger.properties
@@ -135,28 +135,24 @@ sources.search.key2=CmdOrCtrl+P
# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the
# search for searching all the source files the debugger has seen.
sources.search.alt.key=CmdOrCtrl+O
# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the
# full project text search for searching all the files the debugger has seen.
projectTextSearch.key=CmdOrCtrl+Shift+F
+# LOCALIZATION NOTE (projectTextSearch.placeholder): A placeholder shown
+# when searching across all of the files in a project.
+projectTextSearch.placeholder=Find in files…
+
# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger
# does not have any sources.
sources.noSourcesAvailable=This page has no sources
-# LOCALIZATION NOTE (sourcesPane.showSourcesTooltip): The tooltip shown when
-# the user will navigate to the source tree view.
-sourcesPane.showSourcesTooltip=Show sources
-
-# LOCALIZATION NOTE (sourcesPane.showOutlineTooltip): The tooltip shown when
-# the user will navigate to the source outline view.
-sourcesPane.showOutlineTooltip=Show outline
-
# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search
# for searching within a the currently opened files in the editor
sourceSearch.search.key2=CmdOrCtrl+F
# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in
# the source search input bar
sourceSearch.search.placeholder=Search in file…
@@ -220,16 +216,52 @@ breakpointMenuItem.disableSelf=Disable b
breakpointMenuItem.deleteSelf=Remove breakpoint
breakpointMenuItem.enableOthers=Enable others
breakpointMenuItem.disableOthers=Disable others
breakpointMenuItem.deleteOthers=Remove others
breakpointMenuItem.enableAll=Enable all breakpoints
breakpointMenuItem.disableAll=Disable all breakpoints
breakpointMenuItem.deleteAll=Remove all breakpoints
+# LOCALIZATION NOTE (breakpointMenuItem.deleteSelf.accesskey): Access key to remove the
+# currently selected breakpoint from the context menu
+breakpointMenuItem.deleteSelf.accesskey=r
+
+# LOCALIZATION NOTE (breakpointMenuItem.enableSelf.accesskey): Access key to enable the
+# currently selected breakpoint from the context menu
+breakpointMenuItem.enableSelf.accesskey=e
+
+# LOCALIZATION NOTE (breakpointMenuItem.disableSelf.accesskey): Access key to disable the
+# currently selected breakpoint from the context menu
+breakpointMenuItem.disableSelf.accesskey=d
+
+# LOCALIZATION NOTE (breakpointMenuItem.deleteAll.accesskey): Access key to remove all
+# the breakpoints from the context menu
+breakpointMenuItem.deleteAll.accesskey=a
+
+# LOCALIZATION NOTE (breakpointMenuItem.enableAll.accesskey): Access key to enable all
+# the breakpoints from the context menu
+breakpointMenuItem.enableAll.accesskey=b
+
+# LOCALIZATION NOTE (breakpointMenuItem.disableAll.accesskey): Access key to disable all
+# the breakpoints from the context menu
+breakpointMenuItem.disableAll.accesskey=c
+
+# LOCALIZATION NOTE (breakpointMenuItem.deleteOthers.accesskey): Access key to remove
+# other breakpoints from the context menu
+breakpointMenuItem.deleteOthers.accesskey=p
+
+# LOCALIZATION NOTE (breakpointMenuItem.enableOthers.accesskey): Access key to enable
+# other breakpoints from the context menu
+breakpointMenuItem.enableOthers.accesskey=q
+
+# LOCALIZATION NOTE (breakpointMenuItem.disableOthers.accesskey): Access key to disable
+# other breakpoints from the context menu
+breakpointMenuItem.disableOthers.accesskey=s
+
# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.
breakpoints.header=Breakpoints
# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are
# no breakpoints present
breakpoints.none=No Breakpoints
# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip
@@ -465,17 +497,17 @@ watchExpressions.refreshButton=Refresh
welcome.search=%S to search for sources
# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search
# prompt for searching for files.
sourceSearch.search=Search Sources…
# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search
# message when the query did not match any of the sources.
-sourceSearch.noResults=No files matching %S found
+sourceSearch.noResults2=No results found
# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip
# when the debugger will not pause on exceptions.
ignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions
# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button
# tooltip when the debugger will pause on uncaught exceptions.
pauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions
@@ -591,16 +623,20 @@ symbolSearch.search.functionsPlaceholder=Search functions…
# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder
# text displayed when the user searches for variables in a file
symbolSearch.search.variablesPlaceholder=Search variables…
# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for
# searching for a function or variable
symbolSearch.search.key2=CmdOrCtrl+Shift+O
+# LOCALIZATION NOTE(symbolSearch.searchModifier.modifiersLabel): A label
+# preceding the group of modifiers
+symbolSearch.searchModifier.modifiersLabel=Modifiers:
+
# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option
# when searching text in a file
symbolSearch.searchModifier.regex=Regex
# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option
# when searching text in a file
symbolSearch.searchModifier.caseSensitive=Case sensitive
--- a/devtools/client/preferences/debugger.js
+++ b/devtools/client/preferences/debugger.js
@@ -1,12 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+#ifdef RELEASE_OR_BETA
+pref("devtools.debugger.new-debugger-frontend", false);
+#else
pref("devtools.debugger.new-debugger-frontend", true);
+#endif
// Enable the Debugger
pref("devtools.debugger.enabled", true);
pref("devtools.debugger.chrome-debugging-host", "localhost");
pref("devtools.debugger.chrome-debugging-port", 6080);
pref("devtools.debugger.chrome-debugging-websocket", false);
pref("devtools.debugger.remote-host", "localhost");
pref("devtools.debugger.remote-timeout", 20000);
@@ -34,8 +38,9 @@ pref("devtools.debugger.start-panel-coll
pref("devtools.debugger.end-panel-collapsed", false);
pref("devtools.debugger.tabs", "[]");
pref("devtools.debugger.pending-selected-location", "{}");
pref("devtools.debugger.pending-breakpoints", "{}");
pref("devtools.debugger.expressions", "[]");
pref("devtools.debugger.file-search-case-sensitive", false);
pref("devtools.debugger.file-search-whole-word", false);
pref("devtools.debugger.file-search-regex-match", false);
+pref("devtools.debugger.project-text-search-enabled", true);