diff --git a/Gruntfile.js b/Gruntfile.js index 67334ed270a..678ea2a1c7d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -142,7 +142,8 @@ module.exports = function (grunt) { shell: { repo: grunt.option("shell-repo") || "../brackets-shell", mac: "<%= shell.repo %>/installer/mac/staging/<%= pkg.name %>.app", - win: "<%= shell.repo %>/installer/win/staging/<%= pkg.name %>.exe" + win: "<%= shell.repo %>/installer/win/staging/<%= pkg.name %>.exe", + linux: "<%= shell.repo %>/installer/linux/debian/package-root/opt/brackets/brackets" } }); diff --git a/src/brackets.js b/src/brackets.js index ed125580826..0a3e2ab5514 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -284,12 +284,13 @@ define(function (require, exports, module) { if (brackets.nativeMenus) { $("body").addClass("has-appshell-menus"); } else { - // Prevent the menu item to grab the focus -- override focus implementation + // (issue #5310) workaround for bootstrap dropdown: prevent the menu item to grab + // the focus -- override jquery focus implementation for top-level menu items (function () { var defaultFocus = $.fn.focus; $.fn.focus = function () { if (!this.hasClass("dropdown-toggle")) { - defaultFocus.apply(this, arguments); + return defaultFocus.apply(this, arguments); } }; }()); diff --git a/src/editor/CodeHintList.js b/src/editor/CodeHintList.js index 3608799482f..2a98f5fdb36 100644 --- a/src/editor/CodeHintList.js +++ b/src/editor/CodeHintList.js @@ -87,6 +87,13 @@ define(function (require, exports, module) { */ this.insertHintOnTab = insertHintOnTab; + /** + * Pending text insertion + * + * @type {string} + */ + this.pendingText = ""; + /** * The hint selection callback function * @@ -145,6 +152,26 @@ define(function (require, exports, module) { } }; + /** + * Appends text to end of pending text. + * + * @param {string} text + */ + CodeHintList.prototype.addPendingText = function (text) { + this.pendingText += text; + }; + + /** + * Removes text from beginning of pending text. + * + * @param {string} text + */ + CodeHintList.prototype.removePendingText = function (text) { + if (this.pendingText.indexOf(text) === 0) { + this.pendingText = this.pendingText.slice(text.length); + } + }; + /** * Rebuilds the list items for the hint list. * @@ -346,7 +373,7 @@ define(function (require, exports, module) { return itemsPerPage; } - + // If we're no longer visible, skip handling the key and end the session. if (!this.isOpen()) { this.handleClose(); @@ -377,6 +404,27 @@ define(function (require, exports, module) { } else if (this.selectedIndex !== -1 && (keyCode === KeyEvent.DOM_VK_RETURN || (keyCode === KeyEvent.DOM_VK_TAB && this.insertHintOnTab))) { + + if (this.pendingText) { + // Issues #5003: We received a "selection" key while there is "pending + // text". This is rare but can happen because CM uses polling, so we + // can receive key events while CM is waiting for timeout to expire. + // Pending text may dismiss the list, or it may cause a valid selection + // which keeps open hint list. We can compare pending text against + // list to determine whether list is dismissed or not, but to handle + // inserting selection in the page we'd need to either: + // 1. Synchronously force CodeMirror to poll (but there is not + // yet a public API for that). + // 2. Pass pending text back to where text gets inserted, which + // means it would need to be implemented for every HintProvider! + // You have to be typing so fast to hit this case, that's it's + // highly unlikely that inserting something from list was the intent, + // which makes this pretty rare, so case #2 is not worth implementing. + // If case #1 gets implemented, then we may want to use it here. + // So, assume that pending text dismisses hints and let event bubble. + return false; + } + // Trigger a click handler to commmit the selected item $(this.$hintMenu.find("li")[this.selectedIndex]).trigger("click"); } else { diff --git a/src/editor/CodeHintManager.js b/src/editor/CodeHintManager.js index f1aeade4156..560c6dc1782 100644 --- a/src/editor/CodeHintManager.js +++ b/src/editor/CodeHintManager.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ /* @@ -91,39 +91,39 @@ * to show hints. Because implicit hints can be triggered by every * character insertion, hasHints may be called frequently; consequently, * the provider should endeavor to return a value as quickly as possible. - * + * * Because calls to hasHints imply that a hinting session is about to * begin, a provider may wish to clean up cached data from previous * sessions in this method. Similarly, if the provider returns true, it * may wish to prepare to cache data suitable for the current session. In * particular, it should keep a reference to the editor object so that it * can access the editor in future calls to getHints and insertHints. - * - * param {Editor} editor + * + * param {Editor} editor * A non-null editor object for the active window. * - * param {string} implicitChar + * param {string} implicitChar * Either null, if the hinting request was explicit, or a single character * that represents the last insertion and that indicates an implicit * hinting request. * - * return {boolean} + * return {boolean} * Determines whether the current provider is able to provide hints for * the given editor context and, in case implicitChar is non- null, * whether it is appropriate to do so. - * - * + * + * * # CodeHintProvider.getHints(implicitChar) - * + * * The method by which a provider provides hints for the editor context * associated with the current session. The getHints method is called only * if the provider asserted its willingness to provide hints in an earlier - * call to hasHints. The provider may return null or false, which indicates + * call to hasHints. The provider may return null or false, which indicates * that the manager should end the current hinting session and close the hint - * list window; or true, which indicates that the manager should end the + * list window; or true, which indicates that the manager should end the * current hinting session but immediately attempt to begin a new hinting * session by querying registered providers. Otherwise, the provider should - * return a response object that contains three properties: + * return a response object that contains the following properties: * * 1. hints, a sorted array hints that the provider could later insert * into the editor; @@ -131,6 +131,8 @@ * hints in the hint list; and * 3. selectInitial, a boolean that indicates whether or not the the * first hint in the list should be selected by default. + * 4. handleWideResults, a boolean (or undefined) that indicates whether + * to allow result string to stretch width of display. * * If the array of * hints is empty, then the manager will render an empty list, but the @@ -154,7 +156,7 @@ * deferred object from the current call has resolved or been rejected. If * the provider rejects the deferred, the manager will end the hinting * session. - * + * * The getHints method may be called by the manager repeatedly during a * hinting session. Providers may wish to cache information for efficiency * that may be useful throughout these sessions. The same editor context @@ -173,8 +175,9 @@ * return {jQuery.Deferred|{ * hints: Array., * match: string, - * selectInitial: boolean}} - * + * selectInitial: boolean, + * handleWideResults: boolean}} + * * Null if the provider wishes to end the hinting session. Otherwise, a * response object, possibly deferred, that provides 1. a sorted array * hints that consists either of strings or jQuery objects; 2. a string @@ -182,17 +185,17 @@ * matching substrings when rendering the hint list; and 3. a boolean that * indicates whether the first result, if one exists, should be selected * by default in the hint list window. If match is non-null, then the - * hints should be strings. - * - * If the match is null, the manager will not - * attempt to emphasize any parts of the hints when rendering the hint - * list; instead the provider may return strings or jQuery objects for + * hints should be strings. + * + * If the match is null, the manager will not + * attempt to emphasize any parts of the hints when rendering the hint + * list; instead the provider may return strings or jQuery objects for * which emphasis is self-contained. For example, the strings may contain - * substrings that wrapped in bold tags. In this way, the provider can + * substrings that wrapped in bold tags. In this way, the provider can * choose to let the manager handle emphasis for the simple and common case - * of prefix matching, or can provide its own emphasis if it wishes to use + * of prefix matching, or can provide its own emphasis if it wishes to use * a more sophisticated matching algorithm. - * + * * * # CodeHintProvider.insertHint(hint) * @@ -206,18 +209,18 @@ * explicit hinting request, which may result in a new hinting session * being opened with some provider, but not necessarily the current one. * - * param {string} hint + * param {string} hint * The hint to be inserted into the editor context for the current session. - * - * return {boolean} + * + * return {boolean} * Indicates whether the manager should follow hint insertion with an * explicit hint request. * * * # CodeHintProvider.insertHintOnTab - * + * * type {?boolean} insertHintOnTab - * Indicates whether the CodeHintManager should request that the provider of + * Indicates whether the CodeHintManager should request that the provider of * the current session insert the currently selected hint on tab key events, * or if instead a tab character should be inserted into the editor. If omitted, * the fallback behavior is determined by the CodeHintManager. The default @@ -272,12 +275,12 @@ define(function (require, exports, module) { return b.priority - a.priority; } - /** + /** * The method by which a CodeHintProvider registers its willingness to * providing hints for editors in a given language. * * @param {!CodeHintProvider} provider - * The hint provider to be registered, described below. + * The hint provider to be registered, described below. * * @param {!Array.} languageIds * The set of language ids for which the provider is capable of @@ -350,7 +353,7 @@ define(function (require, exports, module) { }); } - /** + /** * Return the array of hint providers for the given language id. * This gets called (potentially) on every keypress. So, it should be fast. * @@ -381,14 +384,14 @@ define(function (require, exports, module) { } } - /** + /** * Is there a hinting session active for a given editor? - * + * * NOTE: the sessionEditor, sessionProvider and hintList objects are - * only guaranteed to be initialized during an active session. - * + * only guaranteed to be initialized during an active session. + * * @param {Editor} editor - * @return boolean + * @return boolean */ function _inSession(editor) { if (sessionEditor) { @@ -430,7 +433,7 @@ define(function (require, exports, module) { _beginSession(previousEditor); } else if (response.hasOwnProperty("hints")) { // a synchronous response if (hintList.isOpen()) { - // the session is open + // the session is open hintList.update(response); } else { hintList.open(response); @@ -439,7 +442,7 @@ define(function (require, exports, module) { deferredHints = response; response.done(function (hints) { if (hintList.isOpen()) { - // the session is open + // the session is open hintList.update(hints); } else { hintList.open(hints); @@ -450,7 +453,7 @@ define(function (require, exports, module) { } /** - * Try to begin a new hinting session. + * Try to begin a new hinting session. * @param {Editor} editor */ _beginSession = function (editor) { @@ -494,7 +497,7 @@ define(function (require, exports, module) { }; /** - * Explicitly start a new session. If we have an existing session, + * Explicitly start a new session. If we have an existing session, * then close the current one and restart a new one. * @param {Editor} editor */ @@ -514,7 +517,7 @@ define(function (require, exports, module) { } /** - * Handles keys related to displaying, searching, and navigating the hint list. + * Handles keys related to displaying, searching, and navigating the hint list. * This gets called before handleChange. * * TODO: Ideally, we'd get a more semantic event from the editor that told us @@ -537,6 +540,11 @@ define(function (require, exports, module) { } else if (event.type === "keypress") { // Last inserted character, used later by handleChange lastChar = String.fromCharCode(event.charCode); + + // Pending Text is used in hintList._keydownHook() + if (hintList) { + hintList.addPendingText(lastChar); + } } else if (event.type === "keyup" && _inSession(editor)) { if (event.keyCode === KeyEvent.DOM_VK_HOME || event.keyCode === KeyEvent.DOM_VK_END) { _endSession(); @@ -552,19 +560,19 @@ define(function (require, exports, module) { } /** - * Start a new implicit hinting session, or update the existing hint list. + * Start a new implicit hinting session, or update the existing hint list. * Called by the editor after handleKeyEvent, which is responsible for setting * the lastChar. */ - function handleChange(editor) { + function handleChange(editor, changeList) { if (lastChar && editor === keyDownEditor) { keyDownEditor = null; if (_inSession(editor)) { var charToRetest = lastChar; _updateHintList(); - // _updateHintList() may end a hinting session and clear lastChar, but a - // different provider may want to start a new session with the same character. + // _updateHintList() may end a hinting session and clear lastChar, but a + // different provider may want to start a new session with the same character. // So check whether current provider terminates the current hinting // session. If so, then restore lastChar and restart a new session. if (!_inSession(editor)) { @@ -574,6 +582,11 @@ define(function (require, exports, module) { } else { _beginSession(editor); } + + // Pending Text is used in hintList._keydownHook() + if (hintList && changeList.text.length && changeList.text[0].length) { + hintList.removePendingText(changeList.text[0]); + } } } @@ -606,8 +619,8 @@ define(function (require, exports, module) { } function activeEditorChangeHandler(event, current, previous) { - var changeHandler = function (event, editor) { - handleChange(editor); + var changeHandler = function (event, editor, changeList) { + handleChange(editor, changeList); }, keyEventHandler = function (jqEvent, editor, event) { handleKeyEvent(editor, event); @@ -626,8 +639,8 @@ define(function (require, exports, module) { $(EditorManager).on("activeEditorChange", activeEditorChangeHandler); // Dismiss code hints before executing any command since the command - // may make the current hinting session irrevalent after execution. - // For example, when the user hits Ctrl+K to open Quick Doc, it is + // may make the current hinting session irrevalent after execution. + // For example, when the user hits Ctrl+K to open Quick Doc, it is // pointless to keep the hint list since the user wants to view the Quick Doc. $(CommandManager).on("beforeExecuteCommand", _endSession); diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 9e6d9191b43..b809d2a7089 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -600,7 +600,7 @@ define(function (require, exports, module) { // whereas the "change" event should be listend to on the document. Also the // Editor dispatches a change event before this event is dispatched, because // CodeHintManager needs to hook in here when other things are already done. - $(this).triggerHandler("editorChange", [this]); + $(this).triggerHandler("editorChange", [this, changeList]); }; /** diff --git a/src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip.js b/src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip.js index 0f8556d9e6b..ee800c5aa5f 100755 --- a/src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip.js +++ b/src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip.js @@ -8,4 +8,8 @@ zip.on('file', function (file) { console.log(file.name); }); +zip.on('error', function (error) { + console.error(error.message, error.stack); +}); + zip.extract(); diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/coverage.json b/src/extensibility/node/node_modules/decompress-zip/coverage/coverage.json deleted file mode 100644 index 8121ebfdcbc..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/coverage.json +++ /dev/null @@ -1 +0,0 @@ -{"/usr/local/google/home/mscales/Projects/decompress/lib/decompress-zip.js":{"path":"/usr/local/google/home/mscales/Projects/decompress/lib/decompress-zip.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":13,"19":13,"20":13,"21":13,"22":13,"23":1,"24":1,"25":1,"26":13,"27":1,"28":12,"29":12,"30":1,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":1,"40":13,"41":13,"42":13,"43":13,"44":12,"45":12,"46":12,"47":2106,"48":2106,"49":2106,"50":12,"51":12,"52":1,"53":13,"54":1,"55":12,"56":12,"57":12,"58":1,"59":12,"60":12,"61":12,"62":268,"63":268,"64":12,"65":0,"66":12,"67":1,"68":12,"69":12,"70":12,"71":12,"72":1,"73":13,"74":13,"75":13,"76":1,"77":12,"78":12,"79":12,"80":12,"81":2106,"82":2106,"83":2106,"84":2106,"85":2106,"86":2106,"87":12,"88":12,"89":1,"90":2106,"91":2106,"92":163,"93":1943,"94":19,"95":1924,"96":0,"97":1},"b":{"1":[1,0],"2":[13,0],"3":[13,0],"4":[280,280],"5":[0,12],"6":[13,0],"7":[163,1943],"8":[19,1924,0]},"f":{"1":13,"2":13,"3":12,"4":0,"5":0,"6":0,"7":0,"8":13,"9":12,"10":2106,"11":2106,"12":12,"13":1,"14":12,"15":12,"16":12,"17":12,"18":13,"19":12,"20":2106,"21":2106,"22":12,"23":2106},"fnMap":{"1":{"name":"DecompressZip","line":30,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":33}}},"2":{"name":"(anonymous_2)","line":47,"loc":{"start":{"line":47,"column":35},"end":{"line":47,"column":47}}},"3":{"name":"(anonymous_3)","line":51,"loc":{"start":{"line":51,"column":35},"end":{"line":51,"column":49}}},"4":{"name":"(anonymous_4)","line":56,"loc":{"start":{"line":56,"column":31},"end":{"line":56,"column":43}}},"5":{"name":"(anonymous_5)","line":60,"loc":{"start":{"line":60,"column":10},"end":{"line":60,"column":27}}},"6":{"name":"(anonymous_6)","line":63,"loc":{"start":{"line":63,"column":22},"end":{"line":63,"column":38}}},"7":{"name":"(anonymous_7)","line":69,"loc":{"start":{"line":69,"column":10},"end":{"line":69,"column":27}}},"8":{"name":"(anonymous_8)","line":76,"loc":{"start":{"line":76,"column":34},"end":{"line":76,"column":53}}},"9":{"name":"(anonymous_9)","line":83,"loc":{"start":{"line":83,"column":10},"end":{"line":83,"column":27}}},"10":{"name":"(anonymous_10)","line":87,"loc":{"start":{"line":87,"column":22},"end":{"line":87,"column":38}}},"11":{"name":"(anonymous_11)","line":89,"loc":{"start":{"line":89,"column":18},"end":{"line":89,"column":36}}},"12":{"name":"(anonymous_12)","line":97,"loc":{"start":{"line":97,"column":14},"end":{"line":97,"column":26}}},"13":{"name":"(anonymous_13)","line":101,"loc":{"start":{"line":101,"column":10},"end":{"line":101,"column":27}}},"14":{"name":"(anonymous_14)","line":109,"loc":{"start":{"line":109,"column":42},"end":{"line":109,"column":59}}},"15":{"name":"(anonymous_15)","line":112,"loc":{"start":{"line":112,"column":10},"end":{"line":112,"column":28}}},"16":{"name":"(anonymous_16)","line":117,"loc":{"start":{"line":117,"column":45},"end":{"line":117,"column":63}}},"17":{"name":"(anonymous_17)","line":139,"loc":{"start":{"line":139,"column":40},"end":{"line":139,"column":64}}},"18":{"name":"(anonymous_18)","line":151,"loc":{"start":{"line":151,"column":35},"end":{"line":151,"column":47}}},"19":{"name":"(anonymous_19)","line":164,"loc":{"start":{"line":164,"column":42},"end":{"line":164,"column":63}}},"20":{"name":"(anonymous_20)","line":169,"loc":{"start":{"line":169,"column":22},"end":{"line":169,"column":55}}},"21":{"name":"(anonymous_21)","line":175,"loc":{"start":{"line":175,"column":14},"end":{"line":175,"column":35}}},"22":{"name":"(anonymous_22)","line":190,"loc":{"start":{"line":190,"column":10},"end":{"line":190,"column":22}}},"23":{"name":"(anonymous_23)","line":195,"loc":{"start":{"line":195,"column":35},"end":{"line":195,"column":64}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":8,"column":0},"end":{"line":8,"column":23}},"3":{"start":{"line":9,"column":0},"end":{"line":9,"column":31}},"4":{"start":{"line":10,"column":0},"end":{"line":12,"column":1}},"5":{"start":{"line":11,"column":4},"end":{"line":11,"column":44}},"6":{"start":{"line":13,"column":0},"end":{"line":13,"column":21}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":27}},"8":{"start":{"line":15,"column":0},"end":{"line":15,"column":27}},"9":{"start":{"line":16,"column":0},"end":{"line":16,"column":31}},"10":{"start":{"line":17,"column":0},"end":{"line":17,"column":41}},"11":{"start":{"line":18,"column":0},"end":{"line":18,"column":41}},"12":{"start":{"line":19,"column":0},"end":{"line":19,"column":41}},"13":{"start":{"line":20,"column":0},"end":{"line":20,"column":20}},"14":{"start":{"line":24,"column":0},"end":{"line":24,"column":34}},"15":{"start":{"line":25,"column":0},"end":{"line":25,"column":32}},"16":{"start":{"line":26,"column":0},"end":{"line":26,"column":33}},"17":{"start":{"line":30,"column":0},"end":{"line":41,"column":1}},"18":{"start":{"line":31,"column":4},"end":{"line":31,"column":35}},"19":{"start":{"line":33,"column":4},"end":{"line":33,"column":29}},"20":{"start":{"line":34,"column":4},"end":{"line":34,"column":27}},"21":{"start":{"line":35,"column":4},"end":{"line":35,"column":19}},"22":{"start":{"line":40,"column":4},"end":{"line":40,"column":17}},"23":{"start":{"line":43,"column":0},"end":{"line":43,"column":50}},"24":{"start":{"line":45,"column":0},"end":{"line":45,"column":59}},"25":{"start":{"line":47,"column":0},"end":{"line":49,"column":2}},"26":{"start":{"line":48,"column":4},"end":{"line":48,"column":37}},"27":{"start":{"line":51,"column":0},"end":{"line":54,"column":2}},"28":{"start":{"line":52,"column":4},"end":{"line":52,"column":17}},"29":{"start":{"line":53,"column":4},"end":{"line":53,"column":21}},"30":{"start":{"line":56,"column":0},"end":{"line":74,"column":2}},"31":{"start":{"line":57,"column":4},"end":{"line":57,"column":20}},"32":{"start":{"line":59,"column":4},"end":{"line":71,"column":7}},"33":{"start":{"line":61,"column":8},"end":{"line":61,"column":24}},"34":{"start":{"line":63,"column":8},"end":{"line":65,"column":11}},"35":{"start":{"line":64,"column":12},"end":{"line":64,"column":35}},"36":{"start":{"line":67,"column":8},"end":{"line":67,"column":34}},"37":{"start":{"line":70,"column":8},"end":{"line":70,"column":34}},"38":{"start":{"line":73,"column":4},"end":{"line":73,"column":16}},"39":{"start":{"line":76,"column":0},"end":{"line":106,"column":2}},"40":{"start":{"line":77,"column":4},"end":{"line":77,"column":20}},"41":{"start":{"line":79,"column":4},"end":{"line":79,"column":28}},"42":{"start":{"line":80,"column":4},"end":{"line":80,"column":39}},"43":{"start":{"line":82,"column":4},"end":{"line":103,"column":7}},"44":{"start":{"line":84,"column":8},"end":{"line":84,"column":26}},"45":{"start":{"line":85,"column":8},"end":{"line":85,"column":25}},"46":{"start":{"line":87,"column":8},"end":{"line":94,"column":11}},"47":{"start":{"line":88,"column":12},"end":{"line":91,"column":15}},"48":{"start":{"line":90,"column":16},"end":{"line":90,"column":37}},"49":{"start":{"line":93,"column":12},"end":{"line":93,"column":35}},"50":{"start":{"line":96,"column":8},"end":{"line":99,"column":11}},"51":{"start":{"line":98,"column":12},"end":{"line":98,"column":42}},"52":{"start":{"line":102,"column":8},"end":{"line":102,"column":34}},"53":{"start":{"line":105,"column":4},"end":{"line":105,"column":16}},"54":{"start":{"line":109,"column":0},"end":{"line":115,"column":2}},"55":{"start":{"line":110,"column":4},"end":{"line":110,"column":46}},"56":{"start":{"line":111,"column":4},"end":{"line":114,"column":7}},"57":{"start":{"line":113,"column":8},"end":{"line":113,"column":25}},"58":{"start":{"line":117,"column":0},"end":{"line":136,"column":2}},"59":{"start":{"line":118,"column":4},"end":{"line":118,"column":34}},"60":{"start":{"line":119,"column":4},"end":{"line":119,"column":19}},"61":{"start":{"line":126,"column":4},"end":{"line":129,"column":5}},"62":{"start":{"line":127,"column":8},"end":{"line":127,"column":16}},"63":{"start":{"line":128,"column":8},"end":{"line":128,"column":43}},"64":{"start":{"line":131,"column":4},"end":{"line":133,"column":5}},"65":{"start":{"line":132,"column":8},"end":{"line":132,"column":78}},"66":{"start":{"line":135,"column":4},"end":{"line":135,"column":31}},"67":{"start":{"line":139,"column":0},"end":{"line":149,"column":2}},"68":{"start":{"line":140,"column":4},"end":{"line":140,"column":56}},"69":{"start":{"line":142,"column":4},"end":{"line":142,"column":48}},"70":{"start":{"line":143,"column":4},"end":{"line":146,"column":8}},"71":{"start":{"line":148,"column":4},"end":{"line":148,"column":81}},"72":{"start":{"line":151,"column":0},"end":{"line":162,"column":2}},"73":{"start":{"line":152,"column":4},"end":{"line":159,"column":5}},"74":{"start":{"line":153,"column":8},"end":{"line":158,"column":47}},"75":{"start":{"line":161,"column":4},"end":{"line":161,"column":28}},"76":{"start":{"line":164,"column":0},"end":{"line":193,"column":2}},"77":{"start":{"line":165,"column":4},"end":{"line":165,"column":22}},"78":{"start":{"line":166,"column":4},"end":{"line":166,"column":19}},"79":{"start":{"line":167,"column":4},"end":{"line":167,"column":20}},"80":{"start":{"line":169,"column":4},"end":{"line":187,"column":7}},"81":{"start":{"line":170,"column":8},"end":{"line":170,"column":43}},"82":{"start":{"line":171,"column":8},"end":{"line":173,"column":12}},"83":{"start":{"line":174,"column":8},"end":{"line":184,"column":11}},"84":{"start":{"line":176,"column":12},"end":{"line":181,"column":14}},"85":{"start":{"line":183,"column":12},"end":{"line":183,"column":44}},"86":{"start":{"line":186,"column":8},"end":{"line":186,"column":31}},"87":{"start":{"line":189,"column":4},"end":{"line":192,"column":7}},"88":{"start":{"line":191,"column":8},"end":{"line":191,"column":21}},"89":{"start":{"line":195,"column":0},"end":{"line":237,"column":2}},"90":{"start":{"line":196,"column":4},"end":{"line":196,"column":52}},"91":{"start":{"line":199,"column":4},"end":{"line":201,"column":5}},"92":{"start":{"line":200,"column":8},"end":{"line":200,"column":52}},"93":{"start":{"line":227,"column":4},"end":{"line":236,"column":5}},"94":{"start":{"line":229,"column":8},"end":{"line":229,"column":66}},"95":{"start":{"line":232,"column":8},"end":{"line":232,"column":68}},"96":{"start":{"line":235,"column":8},"end":{"line":235,"column":56}},"97":{"start":{"line":240,"column":0},"end":{"line":240,"column":31}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":0},"end":{"line":10,"column":0}},{"start":{"line":10,"column":0},"end":{"line":10,"column":0}}]},"2":{"line":79,"type":"binary-expr","locations":[{"start":{"line":79,"column":14},"end":{"line":79,"column":21}},{"start":{"line":79,"column":25},"end":{"line":79,"column":27}}]},"3":{"line":80,"type":"binary-expr","locations":[{"start":{"line":80,"column":19},"end":{"line":80,"column":31}},{"start":{"line":80,"column":35},"end":{"line":80,"column":38}}]},"4":{"line":126,"type":"binary-expr","locations":[{"start":{"line":126,"column":11},"end":{"line":126,"column":56}},{"start":{"line":126,"column":60},"end":{"line":126,"column":105}}]},"5":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":4},"end":{"line":131,"column":4}},{"start":{"line":131,"column":4},"end":{"line":131,"column":4}}]},"6":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":4},"end":{"line":152,"column":4}},{"start":{"line":152,"column":4},"end":{"line":152,"column":4}}]},"7":{"line":199,"type":"if","locations":[{"start":{"line":199,"column":4},"end":{"line":199,"column":4}},{"start":{"line":199,"column":4},"end":{"line":199,"column":4}}]},"8":{"line":227,"type":"switch","locations":[{"start":{"line":228,"column":4},"end":{"line":229,"column":66}},{"start":{"line":231,"column":4},"end":{"line":232,"column":68}},{"start":{"line":234,"column":4},"end":{"line":235,"column":56}}]}}},"/usr/local/google/home/mscales/Projects/decompress/lib/structures.js":{"path":"/usr/local/google/home/mscales/Projects/decompress/lib/structures.js","s":{"1":1,"2":1,"3":1,"4":1,"5":2106,"6":2106,"7":2106,"8":2106,"9":2106,"10":2106,"11":2106,"12":2106,"13":1,"14":12,"15":12,"16":12,"17":1,"18":12,"19":12,"20":12,"21":12,"22":12,"23":27,"24":27,"25":2109,"26":2109,"27":2109,"28":3,"29":2106,"30":2106,"31":2106,"32":33696,"33":2106,"34":2106,"35":2106,"36":2106,"37":2106,"38":2106,"39":2106,"40":2106,"41":0,"42":2106,"43":2106,"44":2106,"45":2106,"46":945,"47":945,"48":0,"49":945,"50":2106,"51":2106,"52":2106,"53":0,"54":0,"55":0,"56":0,"57":2106,"58":2106,"59":12,"60":12,"61":2106,"62":12,"63":12,"64":12,"65":0,"66":12,"67":1,"68":2106,"69":2106,"70":2106,"71":2106,"72":4212,"73":4212,"74":2106,"75":2106,"76":0,"77":2106,"78":2106,"79":2106,"80":2106,"81":4212,"82":2106,"83":2106,"84":2106,"85":0,"86":2106,"87":2106,"88":4212,"89":4212,"90":1902,"91":1902,"92":951,"93":951,"94":3261,"95":3261,"96":2106,"97":2106,"98":2106,"99":2106,"100":2106,"101":0,"102":2106,"103":1},"b":{"1":[2109,0],"2":[3,2106],"3":[2106,0],"4":[2106,0],"5":[0,2106],"6":[2106,0],"7":[945,1161],"8":[0,945],"9":[2106,0],"10":[0,2106],"11":[0,0],"12":[12,2094],"13":[2106,2106],"14":[0,2106],"15":[2106,2106],"16":[2106,0],"17":[0,2106],"18":[4212,0],"19":[1902,2310],"20":[951,951]},"f":{"1":2106,"2":12,"3":12,"4":27,"5":12,"6":0,"7":2106,"8":4212,"9":2106,"10":2106,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":50}}},"2":{"name":"(anonymous_2)","line":20,"loc":{"start":{"line":20,"column":20},"end":{"line":20,"column":38}}},"3":{"name":"(anonymous_3)","line":38,"loc":{"start":{"line":38,"column":20},"end":{"line":38,"column":45}}},"4":{"name":"(anonymous_4)","line":44,"loc":{"start":{"line":44,"column":26},"end":{"line":44,"column":38}}},"5":{"name":"(anonymous_5)","line":136,"loc":{"start":{"line":136,"column":21},"end":{"line":136,"column":33}}},"6":{"name":"(anonymous_6)","line":140,"loc":{"start":{"line":140,"column":23},"end":{"line":140,"column":38}}},"7":{"name":"(anonymous_7)","line":147,"loc":{"start":{"line":147,"column":20},"end":{"line":147,"column":38}}},"8":{"name":"(anonymous_8)","line":152,"loc":{"start":{"line":152,"column":26},"end":{"line":152,"column":38}}},"9":{"name":"(anonymous_9)","line":211,"loc":{"start":{"line":211,"column":21},"end":{"line":211,"column":33}}},"10":{"name":"(anonymous_10)","line":215,"loc":{"start":{"line":215,"column":23},"end":{"line":215,"column":35}}},"11":{"name":"(anonymous_11)","line":219,"loc":{"start":{"line":219,"column":23},"end":{"line":219,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":31}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":21}},"4":{"start":{"line":6,"column":0},"end":{"line":18,"column":2}},"5":{"start":{"line":7,"column":4},"end":{"line":7,"column":46}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":38}},"7":{"start":{"line":9,"column":4},"end":{"line":9,"column":29}},"8":{"start":{"line":11,"column":4},"end":{"line":11,"column":31}},"9":{"start":{"line":12,"column":4},"end":{"line":12,"column":39}},"10":{"start":{"line":13,"column":4},"end":{"line":13,"column":38}},"11":{"start":{"line":15,"column":4},"end":{"line":15,"column":73}},"12":{"start":{"line":17,"column":4},"end":{"line":17,"column":18}},"13":{"start":{"line":20,"column":0},"end":{"line":36,"column":2}},"14":{"start":{"line":21,"column":4},"end":{"line":31,"column":10}},"15":{"start":{"line":33,"column":4},"end":{"line":33,"column":43}},"16":{"start":{"line":35,"column":4},"end":{"line":35,"column":16}},"17":{"start":{"line":38,"column":0},"end":{"line":145,"column":2}},"18":{"start":{"line":39,"column":4},"end":{"line":39,"column":29}},"19":{"start":{"line":40,"column":4},"end":{"line":40,"column":23}},"20":{"start":{"line":41,"column":4},"end":{"line":41,"column":23}},"21":{"start":{"line":42,"column":4},"end":{"line":42,"column":16}},"22":{"start":{"line":44,"column":4},"end":{"line":134,"column":7}},"23":{"start":{"line":45,"column":8},"end":{"line":45,"column":18}},"24":{"start":{"line":47,"column":8},"end":{"line":133,"column":9}},"25":{"start":{"line":48,"column":12},"end":{"line":87,"column":13}},"26":{"start":{"line":49,"column":16},"end":{"line":49,"column":40}},"27":{"start":{"line":50,"column":16},"end":{"line":52,"column":17}},"28":{"start":{"line":51,"column":20},"end":{"line":51,"column":27}},"29":{"start":{"line":54,"column":16},"end":{"line":74,"column":22}},"30":{"start":{"line":76,"column":16},"end":{"line":76,"column":49}},"31":{"start":{"line":78,"column":16},"end":{"line":80,"column":17}},"32":{"start":{"line":79,"column":20},"end":{"line":79,"column":94}},"33":{"start":{"line":82,"column":16},"end":{"line":82,"column":105}},"34":{"start":{"line":83,"column":16},"end":{"line":83,"column":81}},"35":{"start":{"line":84,"column":16},"end":{"line":84,"column":122}},"36":{"start":{"line":86,"column":16},"end":{"line":86,"column":35}},"37":{"start":{"line":89,"column":12},"end":{"line":100,"column":13}},"38":{"start":{"line":90,"column":16},"end":{"line":97,"column":17}},"39":{"start":{"line":91,"column":20},"end":{"line":91,"column":64}},"40":{"start":{"line":92,"column":20},"end":{"line":94,"column":21}},"41":{"start":{"line":93,"column":24},"end":{"line":93,"column":31}},"42":{"start":{"line":96,"column":20},"end":{"line":96,"column":56}},"43":{"start":{"line":99,"column":16},"end":{"line":99,"column":37}},"44":{"start":{"line":102,"column":12},"end":{"line":113,"column":13}},"45":{"start":{"line":103,"column":16},"end":{"line":110,"column":17}},"46":{"start":{"line":104,"column":20},"end":{"line":104,"column":66}},"47":{"start":{"line":105,"column":20},"end":{"line":107,"column":21}},"48":{"start":{"line":106,"column":24},"end":{"line":106,"column":31}},"49":{"start":{"line":109,"column":20},"end":{"line":109,"column":58}},"50":{"start":{"line":112,"column":16},"end":{"line":112,"column":38}},"51":{"start":{"line":115,"column":12},"end":{"line":132,"column":13}},"52":{"start":{"line":116,"column":16},"end":{"line":122,"column":17}},"53":{"start":{"line":117,"column":20},"end":{"line":117,"column":67}},"54":{"start":{"line":118,"column":20},"end":{"line":120,"column":21}},"55":{"start":{"line":119,"column":24},"end":{"line":119,"column":31}},"56":{"start":{"line":121,"column":20},"end":{"line":121,"column":59}},"57":{"start":{"line":124,"column":16},"end":{"line":124,"column":40}},"58":{"start":{"line":126,"column":16},"end":{"line":129,"column":17}},"59":{"start":{"line":127,"column":20},"end":{"line":127,"column":48}},"60":{"start":{"line":128,"column":20},"end":{"line":128,"column":36}},"61":{"start":{"line":131,"column":16},"end":{"line":131,"column":31}},"62":{"start":{"line":136,"column":4},"end":{"line":138,"column":7}},"63":{"start":{"line":137,"column":8},"end":{"line":137,"column":36}},"64":{"start":{"line":140,"column":4},"end":{"line":142,"column":7}},"65":{"start":{"line":141,"column":8},"end":{"line":141,"column":29}},"66":{"start":{"line":144,"column":4},"end":{"line":144,"column":28}},"67":{"start":{"line":147,"column":0},"end":{"line":224,"column":2}},"68":{"start":{"line":148,"column":4},"end":{"line":148,"column":29}},"69":{"start":{"line":149,"column":4},"end":{"line":149,"column":23}},"70":{"start":{"line":150,"column":4},"end":{"line":150,"column":13}},"71":{"start":{"line":152,"column":4},"end":{"line":209,"column":7}},"72":{"start":{"line":153,"column":8},"end":{"line":153,"column":18}},"73":{"start":{"line":155,"column":8},"end":{"line":180,"column":9}},"74":{"start":{"line":156,"column":12},"end":{"line":156,"column":36}},"75":{"start":{"line":157,"column":12},"end":{"line":159,"column":13}},"76":{"start":{"line":158,"column":16},"end":{"line":158,"column":23}},"77":{"start":{"line":161,"column":12},"end":{"line":173,"column":18}},"78":{"start":{"line":175,"column":12},"end":{"line":175,"column":49}},"79":{"start":{"line":177,"column":12},"end":{"line":177,"column":80}},"80":{"start":{"line":179,"column":12},"end":{"line":179,"column":31}},"81":{"start":{"line":182,"column":8},"end":{"line":193,"column":9}},"82":{"start":{"line":183,"column":12},"end":{"line":190,"column":13}},"83":{"start":{"line":184,"column":16},"end":{"line":184,"column":57}},"84":{"start":{"line":185,"column":16},"end":{"line":187,"column":17}},"85":{"start":{"line":186,"column":20},"end":{"line":186,"column":27}},"86":{"start":{"line":189,"column":16},"end":{"line":189,"column":49}},"87":{"start":{"line":192,"column":12},"end":{"line":192,"column":33}},"88":{"start":{"line":195,"column":8},"end":{"line":208,"column":9}},"89":{"start":{"line":196,"column":12},"end":{"line":203,"column":13}},"90":{"start":{"line":197,"column":16},"end":{"line":197,"column":59}},"91":{"start":{"line":198,"column":16},"end":{"line":200,"column":17}},"92":{"start":{"line":199,"column":20},"end":{"line":199,"column":27}},"93":{"start":{"line":202,"column":16},"end":{"line":202,"column":51}},"94":{"start":{"line":205,"column":12},"end":{"line":205,"column":35}},"95":{"start":{"line":207,"column":12},"end":{"line":207,"column":28}},"96":{"start":{"line":211,"column":4},"end":{"line":213,"column":7}},"97":{"start":{"line":212,"column":8},"end":{"line":212,"column":31}},"98":{"start":{"line":215,"column":4},"end":{"line":217,"column":7}},"99":{"start":{"line":216,"column":8},"end":{"line":216,"column":31}},"100":{"start":{"line":219,"column":4},"end":{"line":221,"column":7}},"101":{"start":{"line":220,"column":8},"end":{"line":220,"column":29}},"102":{"start":{"line":223,"column":4},"end":{"line":223,"column":28}},"103":{"start":{"line":226,"column":0},"end":{"line":230,"column":2}}},"branchMap":{"1":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":12},"end":{"line":48,"column":12}},{"start":{"line":48,"column":12},"end":{"line":48,"column":12}}]},"2":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":16},"end":{"line":50,"column":16}},{"start":{"line":50,"column":16},"end":{"line":50,"column":16}}]},"3":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":12},"end":{"line":89,"column":12}},{"start":{"line":89,"column":12},"end":{"line":89,"column":12}}]},"4":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":16},"end":{"line":90,"column":16}},{"start":{"line":90,"column":16},"end":{"line":90,"column":16}}]},"5":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":20},"end":{"line":92,"column":20}},{"start":{"line":92,"column":20},"end":{"line":92,"column":20}}]},"6":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":12},"end":{"line":102,"column":12}},{"start":{"line":102,"column":12},"end":{"line":102,"column":12}}]},"7":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":16},"end":{"line":103,"column":16}},{"start":{"line":103,"column":16},"end":{"line":103,"column":16}}]},"8":{"line":105,"type":"if","locations":[{"start":{"line":105,"column":20},"end":{"line":105,"column":20}},{"start":{"line":105,"column":20},"end":{"line":105,"column":20}}]},"9":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":12},"end":{"line":115,"column":12}},{"start":{"line":115,"column":12},"end":{"line":115,"column":12}}]},"10":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":16},"end":{"line":116,"column":16}},{"start":{"line":116,"column":16},"end":{"line":116,"column":16}}]},"11":{"line":118,"type":"if","locations":[{"start":{"line":118,"column":20},"end":{"line":118,"column":20}},{"start":{"line":118,"column":20},"end":{"line":118,"column":20}}]},"12":{"line":126,"type":"if","locations":[{"start":{"line":126,"column":16},"end":{"line":126,"column":16}},{"start":{"line":126,"column":16},"end":{"line":126,"column":16}}]},"13":{"line":155,"type":"if","locations":[{"start":{"line":155,"column":8},"end":{"line":155,"column":8}},{"start":{"line":155,"column":8},"end":{"line":155,"column":8}}]},"14":{"line":157,"type":"if","locations":[{"start":{"line":157,"column":12},"end":{"line":157,"column":12}},{"start":{"line":157,"column":12},"end":{"line":157,"column":12}}]},"15":{"line":182,"type":"if","locations":[{"start":{"line":182,"column":8},"end":{"line":182,"column":8}},{"start":{"line":182,"column":8},"end":{"line":182,"column":8}}]},"16":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":12},"end":{"line":183,"column":12}},{"start":{"line":183,"column":12},"end":{"line":183,"column":12}}]},"17":{"line":185,"type":"if","locations":[{"start":{"line":185,"column":16},"end":{"line":185,"column":16}},{"start":{"line":185,"column":16},"end":{"line":185,"column":16}}]},"18":{"line":195,"type":"if","locations":[{"start":{"line":195,"column":8},"end":{"line":195,"column":8}},{"start":{"line":195,"column":8},"end":{"line":195,"column":8}}]},"19":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":12},"end":{"line":196,"column":12}},{"start":{"line":196,"column":12},"end":{"line":196,"column":12}}]},"20":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":16},"end":{"line":198,"column":16}},{"start":{"line":198,"column":16},"end":{"line":198,"column":16}}]}}},"/usr/local/google/home/mscales/Projects/decompress/lib/signatures.js":{"path":"/usr/local/google/home/mscales/Projects/decompress/lib/signatures.js","s":{"1":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":10,"column":2}}},"branchMap":{}},"/usr/local/google/home/mscales/Projects/decompress/lib/extractors.js":{"path":"/usr/local/google/home/mscales/Projects/decompress/lib/extractors.js","s":{"1":1,"2":1,"3":0,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":2364,"13":2364,"14":259,"15":259,"16":1,"17":258,"18":259,"19":259,"20":2364,"21":1,"22":163,"23":163,"24":19,"25":19,"26":1,"27":18,"28":18,"29":18,"30":19,"31":19,"32":1924,"33":1924,"34":1924,"35":1924,"36":1924,"37":1924,"38":1,"39":1942,"40":1942,"41":1942,"42":0,"43":1942,"44":1942,"45":1942,"46":1942,"47":1942,"48":1942,"49":1942,"50":1},"b":{"1":[0,1],"2":[259,2105],"3":[1,258],"4":[1,18]},"f":{"1":2364,"2":259,"3":163,"4":163,"5":19,"6":19,"7":1924,"8":1924,"9":1924,"10":1942,"11":0,"12":1942,"13":1942},"fnMap":{"1":{"name":"(anonymous_1)","line":16,"loc":{"start":{"line":16,"column":12},"end":{"line":16,"column":27}}},"2":{"name":"(anonymous_2)","line":28,"loc":{"start":{"line":28,"column":33},"end":{"line":28,"column":45}}},"3":{"name":"(anonymous_3)","line":38,"loc":{"start":{"line":38,"column":12},"end":{"line":38,"column":43}}},"4":{"name":"(anonymous_4)","line":40,"loc":{"start":{"line":40,"column":14},"end":{"line":40,"column":26}}},"5":{"name":"(anonymous_5)","line":44,"loc":{"start":{"line":44,"column":11},"end":{"line":44,"column":52}}},"6":{"name":"(anonymous_6)","line":57,"loc":{"start":{"line":57,"column":14},"end":{"line":57,"column":26}}},"7":{"name":"(anonymous_7)","line":61,"loc":{"start":{"line":61,"column":13},"end":{"line":61,"column":54}}},"8":{"name":"(anonymous_8)","line":67,"loc":{"start":{"line":67,"column":14},"end":{"line":67,"column":26}}},"9":{"name":"(anonymous_9)","line":77,"loc":{"start":{"line":77,"column":14},"end":{"line":77,"column":26}}},"10":{"name":"(anonymous_10)","line":83,"loc":{"start":{"line":83,"column":18},"end":{"line":83,"column":48}}},"11":{"name":"(anonymous_11)","line":86,"loc":{"start":{"line":86,"column":23},"end":{"line":86,"column":40}}},"12":{"name":"(anonymous_12)","line":94,"loc":{"start":{"line":94,"column":20},"end":{"line":94,"column":32}}},"13":{"name":"(anonymous_13)","line":95,"loc":{"start":{"line":95,"column":19},"end":{"line":95,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}},"2":{"start":{"line":2,"column":0},"end":{"line":4,"column":1}},"3":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":23}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":21}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":27}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":42}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":44}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":15}},"11":{"start":{"line":16,"column":0},"end":{"line":34,"column":2}},"12":{"start":{"line":17,"column":4},"end":{"line":17,"column":70}},"13":{"start":{"line":19,"column":4},"end":{"line":31,"column":5}},"14":{"start":{"line":20,"column":8},"end":{"line":20,"column":19}},"15":{"start":{"line":22,"column":8},"end":{"line":26,"column":9}},"16":{"start":{"line":23,"column":12},"end":{"line":23,"column":29}},"17":{"start":{"line":25,"column":12},"end":{"line":25,"column":46}},"18":{"start":{"line":28,"column":8},"end":{"line":30,"column":11}},"19":{"start":{"line":29,"column":12},"end":{"line":29,"column":31}},"20":{"start":{"line":33,"column":4},"end":{"line":33,"column":22}},"21":{"start":{"line":37,"column":0},"end":{"line":81,"column":2}},"22":{"start":{"line":39,"column":8},"end":{"line":42,"column":11}},"23":{"start":{"line":41,"column":12},"end":{"line":41,"column":41}},"24":{"start":{"line":45,"column":8},"end":{"line":45,"column":19}},"25":{"start":{"line":47,"column":8},"end":{"line":53,"column":9}},"26":{"start":{"line":48,"column":12},"end":{"line":48,"column":51}},"27":{"start":{"line":50,"column":12},"end":{"line":50,"column":46}},"28":{"start":{"line":51,"column":12},"end":{"line":51,"column":147}},"29":{"start":{"line":52,"column":12},"end":{"line":52,"column":64}},"30":{"start":{"line":55,"column":8},"end":{"line":59,"column":11}},"31":{"start":{"line":58,"column":12},"end":{"line":58,"column":39}},"32":{"start":{"line":66,"column":8},"end":{"line":79,"column":11}},"33":{"start":{"line":71,"column":12},"end":{"line":71,"column":46}},"34":{"start":{"line":72,"column":12},"end":{"line":72,"column":82}},"35":{"start":{"line":73,"column":12},"end":{"line":73,"column":89}},"36":{"start":{"line":75,"column":12},"end":{"line":75,"column":54}},"37":{"start":{"line":78,"column":12},"end":{"line":78,"column":41}},"38":{"start":{"line":83,"column":0},"end":{"line":103,"column":2}},"39":{"start":{"line":84,"column":4},"end":{"line":84,"column":29}},"40":{"start":{"line":85,"column":4},"end":{"line":85,"column":51}},"41":{"start":{"line":86,"column":4},"end":{"line":88,"column":6}},"42":{"start":{"line":87,"column":8},"end":{"line":87,"column":31}},"43":{"start":{"line":90,"column":4},"end":{"line":90,"column":36}},"44":{"start":{"line":91,"column":4},"end":{"line":91,"column":37}},"45":{"start":{"line":94,"column":4},"end":{"line":98,"column":7}},"46":{"start":{"line":95,"column":8},"end":{"line":97,"column":11}},"47":{"start":{"line":96,"column":12},"end":{"line":96,"column":31}},"48":{"start":{"line":100,"column":4},"end":{"line":100,"column":37}},"49":{"start":{"line":102,"column":4},"end":{"line":102,"column":28}},"50":{"start":{"line":106,"column":0},"end":{"line":106,"column":28}}},"branchMap":{"1":{"line":2,"type":"if","locations":[{"start":{"line":2,"column":0},"end":{"line":2,"column":0}},{"start":{"line":2,"column":0},"end":{"line":2,"column":0}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":4},"end":{"line":19,"column":4}},{"start":{"line":19,"column":4},"end":{"line":19,"column":4}}]},"3":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":8},"end":{"line":22,"column":8}},{"start":{"line":22,"column":8},"end":{"line":22,"column":8}}]},"4":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]}}}} \ No newline at end of file diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/index.html b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/index.html deleted file mode 100644 index 3c750950be0..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/index.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-

Code coverage report for All files

-

- - Statements: 91.24% (229 / 251)      - - - Branches: 67.69% (44 / 65)      - - - Functions: 85.11% (40 / 47)      - - - Lines: 91.24% (229 / 251)      - -

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
lib/91.24%(229 / 251)67.69%(44 / 65)85.11%(40 / 47)91.24%(229 / 251)
-
-
- - - - - - - - diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/decompress-zip.js.html b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/decompress-zip.js.html deleted file mode 100644 index 6ada3768750..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/decompress-zip.js.html +++ /dev/null @@ -1,1025 +0,0 @@ - - - - Code coverage report for lib/decompress-zip.js - - - - - - - -
-

Code coverage report for lib/decompress-zip.js

-

- - Statements: 89.69% (87 / 97)      - - - Branches: 64.71% (11 / 17)      - - - Functions: 82.61% (19 / 23)      - - - Lines: 89.69% (87 / 97)      - -

-
All files » lib/ » decompress-zip.js
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -2411 -  -  -  -  -  -  -1 -1 -1 -1 -  -1 -1 -1 -1 -1 -1 -1 -1 -  -  -  -1 -1 -1 -  -  -  -1 -13 -  -13 -13 -13 -  -  -  -  -13 -  -  -1 -  -1 -  -1 -13 -  -  -1 -12 -12 -  -  -1 -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1 -13 -  -13 -13 -  -13 -  -12 -12 -  -12 -2106 -  -2106 -  -  -2106 -  -  -12 -  -12 -  -  -  -1 -  -  -13 -  -  -  -1 -12 -12 -  -12 -  -  -  -1 -12 -12 -  -  -  -  -  -  -12 -268 -268 -  -  -12 -  -  -  -12 -  -  -  -1 -12 -  -12 -12 -  -  -  -  -12 -  -  -1 -13 -13 -  -  -  -  -  -  -  -13 -  -  -1 -12 -12 -12 -  -12 -2106 -2106 -  -  -2106 -  -2106 -  -  -  -  -  -  -2106 -  -  -2106 -  -  -12 -  -12 -  -  -  -1 -2106 -  -  -2106 -163 -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1943 -  -19 -  -  -1924 -  -  -  -  -  -  -  -1 - 
'use strict';
- 
-// The zip file spec is at http://www.pkware.com/documents/casestudies/APPNOTE.TXT
-// TODO: There is fair chunk of the spec that I have ignored. Need to add
-// assertions everywhere to make sure that we are not dealing with a ZIP type
-// that I haven't designed for. Things like spanning archives, non-DEFLATE
-// compression, encryption, etc.
-var fs = require('fs');
-var stream = require('stream');
-Eif (!stream.Readable) {
-    var stream = require('readable-stream');
-}
-var Q = require('q');
-var path = require('path');
-var util = require('util');
-var events = require('events');
-var structures = require('./structures');
-var signatures = require('./signatures');
-var extractors = require('./extractors');
-var huntSize = 1024; // We will search the last 1kb for END_OF_CENTRAL_DIRECTORY
- 
-// Denodify some node lib methods
- 
-var fstat = Q.denodeify(fs.fstat);
-var read = Q.denodeify(fs.read);
-var fopen = Q.denodeify(fs.open);
- 
-// Class definition
- 
-function DecompressZip(filename) {
-    events.EventEmitter.call(this);
- 
-    this.filename = filename;
-    this.fileBuffer = null;
-    this.fd = null;
- 
-    // When we need a resource, we should check if there is a promise for it
-    // already and use that. If the promise is already fulfilled we don't do the
-    // async work again and we get to queue up dependant tasks.
-    this._p = {}; // _p instead of _promises because it is a lot easier to read
-}
- 
-util.inherits(DecompressZip, events.EventEmitter);
- 
-DecompressZip.version = require('../package.json').version;
- 
-DecompressZip.prototype.openFile = function () {
-    return fopen(this.filename, 'r');
-};
- 
-DecompressZip.prototype.statFile = function (fd) {
-    this.fd = fd;
-    return fstat(fd);
-};
- 
-DecompressZip.prototype.list = function () {
-    var self = this;
- 
-    this.getFiles()
-    .then(function (files) {
-        var result = [];
- 
-        files.forEach(function (file) {
-            result.push(file.name);
-        });
- 
-        self.emit('list', result);
-    })
-    .fail(function (error) {
-        self.emit('error', error);
-    });
- 
-    return this;
-};
- 
-DecompressZip.prototype.extract = function (options) {
-    var self = this;
- 
-    options = options || {};
-    options.path = options.path || '.';
- 
-    this.getFiles()
-    .then(function (files) {
-        var promises = [];
-        var results = [];
- 
-        files.forEach(function (file) {
-            var promise = self._extract(file, options.path)
-            .then(function (result) {
-                results.push(result);
-            });
- 
-            promises.push(promise);
-        });
- 
-        return Q.all(promises)
-        .then(function () {
-            self.emit('extract', results);
-        });
-    })
-    .fail(function (error) {
-        self.emit('error', error);
-    });
- 
-    return this;
-};
- 
-// Utility methods
-DecompressZip.prototype.getSearchBuffer = function (stats) {
-    var size = Math.min(stats.size, huntSize);
-    return read(this.fd, new Buffer(size), 0, size, stats.size - size)
-    .then(function (result) {
-        return result[1];
-    });
-};
- 
-DecompressZip.prototype.findEndOfDirectory = function (buffer) {
-    var index = buffer.length - 3;
-    var chunk = '';
- 
-    // Apparently the ZIP spec is not very good and it is impossible to
-    // guarantee that you have read a zip file correctly, or to determine
-    // the location of the CD without hunting.
-    // Search backwards through the buffer, as it is very likely to be near the
-    // end of the file.
-    while (index > Math.max(buffer.length - huntSize, 0) && chunk !== signatures.END_OF_CENTRAL_DIRECTORY) {
-        index--;
-        chunk = buffer.readUInt32LE(index);
-    }
- 
-    Iif (chunk !== signatures.END_OF_CENTRAL_DIRECTORY) {
-        throw new Error('Could not find the End of Central Directory Record');
-    }
- 
-    return buffer.slice(index);
-};
- 
-// Directory here means the ZIP Central Directory, not a folder
-DecompressZip.prototype.readDirectory = function (recordBuffer) {
-    var record = structures.readEndRecord(recordBuffer);
- 
-    var directoryStream = new stream.Readable();
-    directoryStream.wrap(fs.createReadStream(this.filename, {
-        start: record.directoryOffset,
-        end: record.directoryOffset + record.directorySize
-    }));
- 
-    return structures.readDirectory(directoryStream, record.directoryEntryCount);
-};
- 
-DecompressZip.prototype.getFiles = function () {
-    Eif (!this._p.getFiles) {
-        this._p.getFiles = this.openFile()
-        .then(this.statFile.bind(this))
-        .then(this.getSearchBuffer.bind(this))
-        .then(this.findEndOfDirectory.bind(this))
-        .then(this.readDirectory.bind(this))
-        .then(this.readFileEntries.bind(this));
-    }
- 
-    return this._p.getFiles;
-};
- 
-DecompressZip.prototype.readFileEntries = function (directory) {
-    var promises = [];
-    var files = [];
-    var self = this;
- 
-    directory.forEach(function (directoryEntry, index) {
-        var fileStream = stream.Readable();
-        fileStream.wrap(fs.createReadStream(self.filename, {
-            start: directoryEntry.relativeOffsetOfLocalHeader
-        }));
-        var promise = structures.readFileEntry(fileStream, directoryEntry.relativeOffsetOfLocalHeader)
-        .then(function (fileEntry) {
-            files[index] = {
-                name: directoryEntry.fileName,
-                directoryEntry: directoryEntry,
-                fileEntry: fileEntry,
-                dataOffset: directoryEntry.relativeOffsetOfLocalHeader + fileEntry.entryLength
-            };
- 
-            self.emit('file', files[index]);
-        });
- 
-        promises.push(promise);
-    });
- 
-    return Q.all(promises)
-    .then(function () {
-        return files;
-    });
-};
- 
-DecompressZip.prototype._extract = function (file, destination) {
-    destination = path.join(destination, file.name);
- 
-    // TODO: This actually needs to come from the externalAttributes
-    if (file.name.substr(-1) === '/') {
-        return extractors.folder(file, destination);
-    }
- 
-    // Possible compression methods:
-    //    0 - The file is stored (no compression)
-    //    1 - The file is Shrunk
-    //    2 - The file is Reduced with compression factor 1
-    //    3 - The file is Reduced with compression factor 2
-    //    4 - The file is Reduced with compression factor 3
-    //    5 - The file is Reduced with compression factor 4
-    //    6 - The file is Imploded
-    //    7 - Reserved for Tokenizing compression algorithm
-    //    8 - The file is Deflated
-    //    9 - Enhanced Deflating using Deflate64(tm)
-    //   10 - PKWARE Data Compression Library Imploding (old IBM TERSE)
-    //   11 - Reserved by PKWARE
-    //   12 - File is compressed using BZIP2 algorithm
-    //   13 - Reserved by PKWARE
-    //   14 - LZMA (EFS)
-    //   15 - Reserved by PKWARE
-    //   16 - Reserved by PKWARE
-    //   17 - Reserved by PKWARE
-    //   18 - File is compressed using IBM TERSE (new)
-    //   19 - IBM LZ77 z Architecture (PFS)
-    //   97 - WavPack compressed data
-    //   98 - PPMd version I, Rev 1
- 
-    switch (file.directoryEntry.compressionMethod) {
-    case 0:
-        return extractors.store(file, destination, this.filename);
- 
-    case 8:
-        return extractors.deflate(file, destination, this.filename);
- 
-    default:
-        throw new Error('Unsupported compression type');
-    }
-};
- 
- 
-module.exports = DecompressZip;
- 
- -
- - - - - - - - diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/extractors.js.html b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/extractors.js.html deleted file mode 100644 index 2dcd31065ee..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/extractors.js.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - Code coverage report for lib/extractors.js - - - - - - - -
-

Code coverage report for lib/extractors.js

-

- - Statements: 96% (48 / 50)      - - - Branches: 87.5% (7 / 8)      - - - Functions: 92.31% (12 / 13)      - - - Lines: 96% (48 / 50)      - -

-
All files » lib/ » extractors.js
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -1071 -1 -  -  -1 -1 -1 -1 -1 -1 -1 -  -  -  -  -1 -2364 -  -2364 -259 -  -259 -1 -  -258 -  -  -259 -259 -  -  -  -2364 -  -  -  -1 -  -163 -  -163 -  -  -  -19 -  -19 -1 -  -18 -18 -18 -  -  -19 -  -  -19 -  -  -  -  -  -  -  -1924 -  -  -  -  -1924 -1924 -1924 -  -1924 -  -  -1924 -  -  -  -  -1 -1942 -1942 -1942 -  -  -  -1942 -1942 -  -  -1942 -1942 -1942 -  -  -  -1942 -  -1942 -  -  -  -1 - 
var stream = require('stream');
-Iif (!stream.Readable) {
-    var stream = require('readable-stream');
-}
-var fs = require('fs');
-var Q = require('q');
-var path = require('path');
-var zlib = require('zlib');
-var touch = Q.denodeify(require('touch'));
-var mkpath = Q.denodeify(require('mkpath'));
-var cache = {};
- 
-// Use a cache of promises for building the directory tree. This allows us to
-// correctly queue up file extractions for after their path has been created,
-// avoid trying to create the path twice and still be async.
-var mkdir = function (dir) {
-    dir = path.normalize(path.resolve(process.cwd(), dir) + path.sep);
- 
-    if (!cache[dir]) {
-        var parent;
- 
-        if (dir === '/') {
-            parent = new Q();
-        } else {
-            parent = mkdir(path.dirname(dir));
-        }
- 
-        cache[dir] = parent.then(function () {
-            return mkpath(dir);
-        });
-    }
- 
-    return cache[dir];
-};
- 
-// Utility methods for writing output files
-var extractors = {
-    folder: function (folder, destination) {
-        return mkdir(destination)
-        .then(function () {
-            return {folder: folder.name};
-        });
-    },
-    store: function (file, destination, sourceFile) {
-        var writer;
- 
-        if (file.directoryEntry.uncompressedSize === 0) {
-            writer = touch.bind(null, destination);
-        } else {
-            var input = new stream.Readable();
-            input.wrap(fs.createReadStream(sourceFile, {start: file.dataOffset, end: file.dataOffset + file.directoryEntry.uncompressedSize - 1}));
-            writer = pipePromise.bind(null, input, destination);
-        }
- 
-        return mkdir(path.dirname(destination))
-        .then(writer)
-        .then(function () {
-            return {stored: file.name};
-        });
-    },
-    deflate: function (file, destination, sourceFile) {
-        // For Deflate you don't actually need to specify the end offset - and
-        // in fact many ZIP files don't include compressed file sizes for
-        // Deflated files so we don't even know what the end offset is.
- 
-        return mkdir(path.dirname(destination))
-        .then(function () {
-            // For node 0.8 we need to create the Zlib stream and attach
-            // handlers in the same tick of the event loop, which is why we do
-            // the creation in here
-            var input = new stream.Readable();
-            input.wrap(fs.createReadStream(sourceFile, {start: file.dataOffset}));
-            var inflater = input.pipe(zlib.createInflateRaw({highWaterMark: 32 * 1024}));
- 
-            return pipePromise(inflater, destination);
-        })
-        .then(function () {
-            return {deflated: file.name};
-        });
-    }
-};
- 
-var pipePromise = function (input, destination) {
-    var deferred = Q.defer();
-    var output = fs.createWriteStream(destination);
-    var errorHandler = function (error) {
-        deferred.reject(error);
-    };
- 
-    input.on('error', errorHandler);
-    output.on('error', errorHandler);
- 
-    // For node 0.8 we can't just use the 'finish' event of the pipe
-    input.on('end', function () {
-        output.end(function () {
-            deferred.resolve();
-        });
-    });
- 
-    input.pipe(output, {end: false});
- 
-    return deferred.promise;
-};
- 
- 
-module.exports = extractors;
- 
- -
- - - - - - - - diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/index.html b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/index.html deleted file mode 100644 index 783b56a3447..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/index.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - Code coverage report for lib/ - - - - - - - -
-

Code coverage report for lib/

-

- - Statements: 91.24% (229 / 251)      - - - Branches: 67.69% (44 / 65)      - - - Functions: 85.11% (40 / 47)      - - - Lines: 91.24% (229 / 251)      - -

-
All files » lib/
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
decompress-zip.js89.69%(87 / 97)64.71%(11 / 17)82.61%(19 / 23)89.69%(87 / 97)
extractors.js96%(48 / 50)87.5%(7 / 8)92.31%(12 / 13)96%(48 / 50)
signatures.js100%(1 / 1)100%(0 / 0)100%(0 / 0)100%(1 / 1)
structures.js90.29%(93 / 103)65%(26 / 40)81.82%(9 / 11)90.29%(93 / 103)
-
-
- - - - - - - - diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/signatures.js.html b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/signatures.js.html deleted file mode 100644 index 422b7138e6a..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/signatures.js.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - Code coverage report for lib/signatures.js - - - - - - - -
-

Code coverage report for lib/signatures.js

-

- - Statements: 100% (1 / 1)      - - - Branches: 100% (0 / 0)      - - - Functions: 100% (0 / 0)      - - - Lines: 100% (1 / 1)      - -

-
All files » lib/ » signatures.js
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -111 -  -  -  -  -  -  -  -  -  - 
module.exports = {
-    LOCAL_FILE_HEADER: 0x04034b50,
-    DATA_DESCRIPTOR_RECORD: 0x08074b50,
-    ARCHIVE_EXTRA_DATA: 0x08064b50,
-    CENTRAL_FILE_HEADER: 0x02014b50,
-    HEADER: 0x05054b50,
-    ZIP64_END_OF_CENTRAL_DIRECTORY: 0x06064b50,
-    ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR: 0x07064b50,
-    END_OF_CENTRAL_DIRECTORY: 0x06054b50
-};
- 
- -
- - - - - - - - diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/structures.js.html b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/structures.js.html deleted file mode 100644 index 2ddd9fa9fcf..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/lib/structures.js.html +++ /dev/null @@ -1,995 +0,0 @@ - - - - Code coverage report for lib/structures.js - - - - - - - -
-

Code coverage report for lib/structures.js

-

- - Statements: 90.29% (93 / 103)      - - - Branches: 65% (26 / 40)      - - - Functions: 81.82% (9 / 11)      - - - Lines: 90.29% (93 / 103)      - -

-
All files » lib/ » structures.js
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -2311 -  -1 -1 -  -1 -2106 -2106 -2106 -  -2106 -2106 -2106 -  -2106 -  -2106 -  -  -1 -12 -  -  -  -  -  -  -  -  -  -  -  -12 -  -12 -  -  -1 -12 -12 -12 -12 -  -12 -27 -  -27 -2109 -2109 -2109 -3 -  -  -2106 -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2106 -  -2106 -33696 -  -  -2106 -2106 -2106 -  -2106 -  -  -2106 -2106 -2106 -2106 -  -  -  -2106 -  -  -2106 -  -  -2106 -2106 -945 -945 -  -  -  -945 -  -  -2106 -  -  -2106 -2106 -  -  -  -  -  -  -  -2106 -  -2106 -12 -12 -  -  -2106 -  -  -  -  -12 -12 -  -  -12 -  -  -  -12 -  -  -1 -2106 -2106 -2106 -  -2106 -4212 -  -4212 -2106 -2106 -  -  -  -2106 -  -  -  -  -  -  -  -  -  -  -  -  -  -2106 -  -2106 -  -2106 -  -  -4212 -2106 -2106 -2106 -  -  -  -2106 -  -  -2106 -  -  -4212 -4212 -1902 -1902 -951 -  -  -951 -  -  -3261 -  -3261 -  -  -  -2106 -2106 -  -  -2106 -2106 -  -  -2106 -  -  -  -2106 -  -  -1 -  -  -  -  - 
'use strict';
- 
-var binary = require('binary');
-var Q = require('q');
- 
-var convertDateTime = function (dosDate, dosTime) {
-    var year = ((dosDate >> 9) & 0x7F) + 1980;
-    var month = (dosDate >> 5) & 0x0F;
-    var day = dosDate & 0x1F;
- 
-    var hour = (dosTime >> 11);
-    var minute = (dosTime >> 5) & 0x3F;
-    var second = (dosTime & 0x1F) * 2;
- 
-    var result = new Date(year, month - 1, day, hour, minute, second, 0);
- 
-    return result;
-};
- 
-var readEndRecord = function (buffer) {
-    var data = binary.parse(buffer)
-    .word32lu('signature')
-    .word16lu('diskNumber')
-    .word16lu('directoryStartDisk')
-    .word16lu('directoryEntryCountDisk')
-    .word16lu('directoryEntryCount')
-    .word32lu('directorySize')
-    .word32lu('directoryOffset')
-    .word16lu('commentLength')
-    .buffer('comment', 'commentLength')
-    .vars;
- 
-    data.comment = data.comment.toString();
- 
-    return data;
-};
- 
-var readDirectory = function (stream, count) {
-    var deferred = Q.defer();
-    var stage = 'main';
-    var directory = [];
-    var current;
- 
-    stream.on('readable', function () {
-        var chunk;
- 
-        while (directory.length < count) {
-            Eif (stage === 'main') {
-                chunk = stream.read(46);
-                if (chunk === null) {
-                    return;
-                }
- 
-                current = binary.parse(chunk)
-                .word32lu('signature')
-                .word8lu('creatorSpecVersion')
-                .word8lu('creatorPlatform')
-                .word8lu('requiredSpecVersion')
-                .word8lu('requiredPlatform')
-                .word16lu('generalPurposeBitFlag')
-                .word16lu('compressionMethod')
-                .word16lu('lastModFileTime')
-                .word16lu('lastModFileDate')
-                .word32lu('crc32')
-                .word32lu('compressedSize')
-                .word32lu('uncompressedSize')
-                .word16lu('fileNameLength')
-                .word16lu('extraFieldLength')
-                .word16lu('fileCommentLength')
-                .word16lu('diskNumberStart')
-                .word16lu('internalFileAttributes')
-                .word32lu('externalFileAttributes')
-                .word32lu('relativeOffsetOfLocalHeader')
-                .vars;
- 
-                current.generalPurposeFlags = [];
- 
-                for (var i = 0; i < 16; i++) {
-                    current.generalPurposeFlags[i] = (current.generalPurposeBitFlag >> i) & 1;
-                }
- 
-                current.modifiedTime = convertDateTime(current.lastModFileDate, current.lastModFileTime);
-                current.fileName = current.extraField = current.fileComment = '';
-                current.headerLength = 46 + current.fileNameLength + current.extraFieldLength + current.fileCommentLength;
- 
-                stage = 'fileName';
-            }
- 
-            Eif (stage === 'fileName') {
-                Eif (current.fileNameLength > 0) {
-                    chunk = stream.read(current.fileNameLength);
-                    Iif (chunk === null) {
-                        return;
-                    }
- 
-                    current.fileName = chunk.toString();
-                }
- 
-                stage = 'extraField';
-            }
- 
-            Eif (stage === 'extraField') {
-                if (current.extraFieldLength > 0) {
-                    chunk = stream.read(current.extraFieldLength);
-                    Iif (chunk === null) {
-                        return;
-                    }
- 
-                    current.extraField = chunk.toString();
-                }
- 
-                stage = 'fileComment';
-            }
- 
-            Eif (stage === 'fileComment') {
-                Iif (current.fileCommentLength > 0) {
-                    chunk = stream.read(current.fileCommentLength);
-                    if (chunk === null) {
-                        return;
-                    }
-                    current.fileComment = chunk.toString();
-                }
- 
-                directory.push(current);
- 
-                if (directory.length === count) {
-                    deferred.resolve(directory);
-                    stream.resume();
-                }
- 
-                stage = 'main';
-            }
-        }
-    });
- 
-    stream.on('end', function () {
-        deferred.resolve(directory);
-    });
- 
-    stream.on('error', function (err) {
-        deferred.reject(err);
-    });
- 
-    return deferred.promise;
-};
- 
-var readFileEntry = function (stream) {
-    var deferred = Q.defer();
-    var stage = 'main';
-    var data;
- 
-    stream.on('readable', function () {
-        var chunk;
- 
-        if (stage === 'main') {
-            chunk = stream.read(30);
-            Iif (chunk === null) {
-                return;
-            }
- 
-            data = binary.parse(chunk)
-            .word32lu('signature')
-            .word16lu('versionNeededToExtract')
-            .word16lu('generalPurposeBitFlag')
-            .word16lu('compressionMethod')
-            .word16lu('lastModFileTime')
-            .word16lu('lastModFileDate')
-            .word32lu('crc32')
-            .word32lu('compressedSize')
-            .word32lu('uncompressedSize')
-            .word16lu('fileNameLength')
-            .word16lu('extraFieldLength')
-            .vars;
- 
-            data.fileName = data.extraField = '';
- 
-            data.entryLength = 30 + data.fileNameLength + data.extraFieldLength;
- 
-            stage = 'fileName';
-        }
- 
-        if (stage === 'fileName') {
-            Eif (data.fileNameLength > 0) {
-                chunk = stream.read(data.fileNameLength);
-                Iif (chunk === null) {
-                    return;
-                }
- 
-                data.fileName = chunk.toString();
-            }
- 
-            stage = 'extraField';
-        }
- 
-        Eif (stage === 'extraField') {
-            if (data.extraFieldLength > 0) {
-                chunk = stream.read(data.extraFieldLength);
-                if (chunk === null) {
-                    return;
-                }
- 
-                data.extraField = chunk.toString();
-            }
- 
-            deferred.resolve(data);
-            // Run the stream to the end so that it can be closed
-            stream.resume();
-        }
-    });
- 
-    stream.on('end', function () {
-        deferred.resolve(data);
-    });
- 
-    stream.on('close', function () {
-        deferred.resolve(data);
-    });
- 
-    stream.on('error', function (err) {
-        deferred.reject(err);
-    });
- 
-    return deferred.promise;
-};
- 
-module.exports = {
-    readEndRecord: readEndRecord,
-    readDirectory: readDirectory,
-    readFileEntry: readFileEntry
-};
- 
- -
- - - - - - - - diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/prettify.css b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7cda31..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/prettify.js b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e038668..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov.info b/src/extensibility/node/node_modules/decompress-zip/coverage/lcov.info deleted file mode 100644 index a86666f2481..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/coverage/lcov.info +++ /dev/null @@ -1,446 +0,0 @@ -TN: -SF:/usr/local/google/home/mscales/Projects/decompress/lib/decompress-zip.js -FN:30,DecompressZip -FN:47,(anonymous_2) -FN:51,(anonymous_3) -FN:56,(anonymous_4) -FN:60,(anonymous_5) -FN:63,(anonymous_6) -FN:69,(anonymous_7) -FN:76,(anonymous_8) -FN:83,(anonymous_9) -FN:87,(anonymous_10) -FN:89,(anonymous_11) -FN:97,(anonymous_12) -FN:101,(anonymous_13) -FN:109,(anonymous_14) -FN:112,(anonymous_15) -FN:117,(anonymous_16) -FN:139,(anonymous_17) -FN:151,(anonymous_18) -FN:164,(anonymous_19) -FN:169,(anonymous_20) -FN:175,(anonymous_21) -FN:190,(anonymous_22) -FN:195,(anonymous_23) -FNF:23 -FNH:19 -FNDA:13,DecompressZip -FNDA:13,(anonymous_2) -FNDA:12,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:13,(anonymous_8) -FNDA:12,(anonymous_9) -FNDA:2106,(anonymous_10) -FNDA:2106,(anonymous_11) -FNDA:12,(anonymous_12) -FNDA:1,(anonymous_13) -FNDA:12,(anonymous_14) -FNDA:12,(anonymous_15) -FNDA:12,(anonymous_16) -FNDA:12,(anonymous_17) -FNDA:13,(anonymous_18) -FNDA:12,(anonymous_19) -FNDA:2106,(anonymous_20) -FNDA:2106,(anonymous_21) -FNDA:12,(anonymous_22) -FNDA:2106,(anonymous_23) -DA:1,1 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:13,1 -DA:14,1 -DA:15,1 -DA:16,1 -DA:17,1 -DA:18,1 -DA:19,1 -DA:20,1 -DA:24,1 -DA:25,1 -DA:26,1 -DA:30,1 -DA:31,13 -DA:33,13 -DA:34,13 -DA:35,13 -DA:40,13 -DA:43,1 -DA:45,1 -DA:47,1 -DA:48,13 -DA:51,1 -DA:52,12 -DA:53,12 -DA:56,1 -DA:57,0 -DA:59,0 -DA:61,0 -DA:63,0 -DA:64,0 -DA:67,0 -DA:70,0 -DA:73,0 -DA:76,1 -DA:77,13 -DA:79,13 -DA:80,13 -DA:82,13 -DA:84,12 -DA:85,12 -DA:87,12 -DA:88,2106 -DA:90,2106 -DA:93,2106 -DA:96,12 -DA:98,12 -DA:102,1 -DA:105,13 -DA:109,1 -DA:110,12 -DA:111,12 -DA:113,12 -DA:117,1 -DA:118,12 -DA:119,12 -DA:126,12 -DA:127,268 -DA:128,268 -DA:131,12 -DA:132,0 -DA:135,12 -DA:139,1 -DA:140,12 -DA:142,12 -DA:143,12 -DA:148,12 -DA:151,1 -DA:152,13 -DA:153,13 -DA:161,13 -DA:164,1 -DA:165,12 -DA:166,12 -DA:167,12 -DA:169,12 -DA:170,2106 -DA:171,2106 -DA:174,2106 -DA:176,2106 -DA:183,2106 -DA:186,2106 -DA:189,12 -DA:191,12 -DA:195,1 -DA:196,2106 -DA:199,2106 -DA:200,163 -DA:227,1943 -DA:229,19 -DA:232,1924 -DA:235,0 -DA:240,1 -LF:97 -LH:87 -BRDA:10,1,0,1 -BRDA:10,1,1,0 -BRDA:79,2,0,13 -BRDA:79,2,1,0 -BRDA:80,3,0,13 -BRDA:80,3,1,0 -BRDA:126,4,0,280 -BRDA:126,4,1,280 -BRDA:131,5,0,0 -BRDA:131,5,1,12 -BRDA:152,6,0,13 -BRDA:152,6,1,0 -BRDA:199,7,0,163 -BRDA:199,7,1,1943 -BRDA:227,8,0,19 -BRDA:227,8,1,1924 -BRDA:227,8,2,0 -BRF:17 -BRH:11 -end_of_record -TN: -SF:/usr/local/google/home/mscales/Projects/decompress/lib/structures.js -FN:6,(anonymous_1) -FN:20,(anonymous_2) -FN:38,(anonymous_3) -FN:44,(anonymous_4) -FN:136,(anonymous_5) -FN:140,(anonymous_6) -FN:147,(anonymous_7) -FN:152,(anonymous_8) -FN:211,(anonymous_9) -FN:215,(anonymous_10) -FN:219,(anonymous_11) -FNF:11 -FNH:9 -FNDA:2106,(anonymous_1) -FNDA:12,(anonymous_2) -FNDA:12,(anonymous_3) -FNDA:27,(anonymous_4) -FNDA:12,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:2106,(anonymous_7) -FNDA:4212,(anonymous_8) -FNDA:2106,(anonymous_9) -FNDA:2106,(anonymous_10) -FNDA:0,(anonymous_11) -DA:1,1 -DA:3,1 -DA:4,1 -DA:6,1 -DA:7,2106 -DA:8,2106 -DA:9,2106 -DA:11,2106 -DA:12,2106 -DA:13,2106 -DA:15,2106 -DA:17,2106 -DA:20,1 -DA:21,12 -DA:33,12 -DA:35,12 -DA:38,1 -DA:39,12 -DA:40,12 -DA:41,12 -DA:42,12 -DA:44,12 -DA:45,27 -DA:47,27 -DA:48,2109 -DA:49,2109 -DA:50,2109 -DA:51,3 -DA:54,2106 -DA:76,2106 -DA:78,2106 -DA:79,33696 -DA:82,2106 -DA:83,2106 -DA:84,2106 -DA:86,2106 -DA:89,2106 -DA:90,2106 -DA:91,2106 -DA:92,2106 -DA:93,0 -DA:96,2106 -DA:99,2106 -DA:102,2106 -DA:103,2106 -DA:104,945 -DA:105,945 -DA:106,0 -DA:109,945 -DA:112,2106 -DA:115,2106 -DA:116,2106 -DA:117,0 -DA:118,0 -DA:119,0 -DA:121,0 -DA:124,2106 -DA:126,2106 -DA:127,12 -DA:128,12 -DA:131,2106 -DA:136,12 -DA:137,12 -DA:140,12 -DA:141,0 -DA:144,12 -DA:147,1 -DA:148,2106 -DA:149,2106 -DA:150,2106 -DA:152,2106 -DA:153,4212 -DA:155,4212 -DA:156,2106 -DA:157,2106 -DA:158,0 -DA:161,2106 -DA:175,2106 -DA:177,2106 -DA:179,2106 -DA:182,4212 -DA:183,2106 -DA:184,2106 -DA:185,2106 -DA:186,0 -DA:189,2106 -DA:192,2106 -DA:195,4212 -DA:196,4212 -DA:197,1902 -DA:198,1902 -DA:199,951 -DA:202,951 -DA:205,3261 -DA:207,3261 -DA:211,2106 -DA:212,2106 -DA:215,2106 -DA:216,2106 -DA:219,2106 -DA:220,0 -DA:223,2106 -DA:226,1 -LF:103 -LH:93 -BRDA:48,1,0,2109 -BRDA:48,1,1,0 -BRDA:50,2,0,3 -BRDA:50,2,1,2106 -BRDA:89,3,0,2106 -BRDA:89,3,1,0 -BRDA:90,4,0,2106 -BRDA:90,4,1,0 -BRDA:92,5,0,0 -BRDA:92,5,1,2106 -BRDA:102,6,0,2106 -BRDA:102,6,1,0 -BRDA:103,7,0,945 -BRDA:103,7,1,1161 -BRDA:105,8,0,0 -BRDA:105,8,1,945 -BRDA:115,9,0,2106 -BRDA:115,9,1,0 -BRDA:116,10,0,0 -BRDA:116,10,1,2106 -BRDA:118,11,0,0 -BRDA:118,11,1,0 -BRDA:126,12,0,12 -BRDA:126,12,1,2094 -BRDA:155,13,0,2106 -BRDA:155,13,1,2106 -BRDA:157,14,0,0 -BRDA:157,14,1,2106 -BRDA:182,15,0,2106 -BRDA:182,15,1,2106 -BRDA:183,16,0,2106 -BRDA:183,16,1,0 -BRDA:185,17,0,0 -BRDA:185,17,1,2106 -BRDA:195,18,0,4212 -BRDA:195,18,1,0 -BRDA:196,19,0,1902 -BRDA:196,19,1,2310 -BRDA:198,20,0,951 -BRDA:198,20,1,951 -BRF:40 -BRH:26 -end_of_record -TN: -SF:/usr/local/google/home/mscales/Projects/decompress/lib/signatures.js -FNF:0 -FNH:0 -DA:1,1 -LF:1 -LH:1 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/usr/local/google/home/mscales/Projects/decompress/lib/extractors.js -FN:16,(anonymous_1) -FN:28,(anonymous_2) -FN:38,(anonymous_3) -FN:40,(anonymous_4) -FN:44,(anonymous_5) -FN:57,(anonymous_6) -FN:61,(anonymous_7) -FN:67,(anonymous_8) -FN:77,(anonymous_9) -FN:83,(anonymous_10) -FN:86,(anonymous_11) -FN:94,(anonymous_12) -FN:95,(anonymous_13) -FNF:13 -FNH:12 -FNDA:2364,(anonymous_1) -FNDA:259,(anonymous_2) -FNDA:163,(anonymous_3) -FNDA:163,(anonymous_4) -FNDA:19,(anonymous_5) -FNDA:19,(anonymous_6) -FNDA:1924,(anonymous_7) -FNDA:1924,(anonymous_8) -FNDA:1924,(anonymous_9) -FNDA:1942,(anonymous_10) -FNDA:0,(anonymous_11) -FNDA:1942,(anonymous_12) -FNDA:1942,(anonymous_13) -DA:1,1 -DA:2,1 -DA:3,0 -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:16,1 -DA:17,2364 -DA:19,2364 -DA:20,259 -DA:22,259 -DA:23,1 -DA:25,258 -DA:28,259 -DA:29,259 -DA:33,2364 -DA:37,1 -DA:39,163 -DA:41,163 -DA:45,19 -DA:47,19 -DA:48,1 -DA:50,18 -DA:51,18 -DA:52,18 -DA:55,19 -DA:58,19 -DA:66,1924 -DA:71,1924 -DA:72,1924 -DA:73,1924 -DA:75,1924 -DA:78,1924 -DA:83,1 -DA:84,1942 -DA:85,1942 -DA:86,1942 -DA:87,0 -DA:90,1942 -DA:91,1942 -DA:94,1942 -DA:95,1942 -DA:96,1942 -DA:100,1942 -DA:102,1942 -DA:106,1 -LF:50 -LH:48 -BRDA:2,1,0,0 -BRDA:2,1,1,1 -BRDA:19,2,0,259 -BRDA:19,2,1,2105 -BRDA:22,3,0,1 -BRDA:22,3,1,258 -BRDA:47,4,0,1 -BRDA:47,4,1,18 -BRF:8 -BRH:7 -end_of_record diff --git a/src/extensibility/node/node_modules/decompress-zip/download-test-assets.js b/src/extensibility/node/node_modules/decompress-zip/download-test-assets.js index 4b6917c209b..5c27e47d97c 100644 --- a/src/extensibility/node/node_modules/decompress-zip/download-test-assets.js +++ b/src/extensibility/node/node_modules/decompress-zip/download-test-assets.js @@ -11,7 +11,7 @@ var errorHandler = function (error) { }; var extract = function (filename) { - exec('tar -xvzf ' + filename, {cwd: path.join(__dirname, 'test')}, function (err, stdout, stderr) { + exec('tar -xvzf ' + filename, {cwd: path.join(__dirname, 'test'), maxBuffer: 1024*1024}, function (err, stdout, stderr) { if (err) { throw err; } diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js b/src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js index 7136da6a51d..08c21ecdc8f 100644 --- a/src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js +++ b/src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js @@ -6,10 +6,6 @@ // that I haven't designed for. Things like spanning archives, non-DEFLATE // compression, encryption, etc. var fs = require('fs'); -var stream = require('stream'); -if (!stream.Readable) { - var stream = require('readable-stream'); -} var Q = require('q'); var path = require('path'); var util = require('util'); @@ -17,7 +13,7 @@ var events = require('events'); var structures = require('./structures'); var signatures = require('./signatures'); var extractors = require('./extractors'); -var huntSize = 1024; // We will search the last 1kb for END_OF_CENTRAL_DIRECTORY +var FileDetails = require('./file-details'); // Denodify some node lib methods @@ -31,8 +27,9 @@ function DecompressZip(filename) { events.EventEmitter.call(this); this.filename = filename; - this.fileBuffer = null; + this.stats = null; this.fd = null; + this.chunkSize = 1024 * 1024; // Buffer up to 1Mb at a time // When we need a resource, we should check if there is a promise for it // already and use that. If the promise is already fulfilled we don't do the @@ -61,7 +58,7 @@ DecompressZip.prototype.list = function () { var result = []; files.forEach(function (file) { - result.push(file.name); + result.push(file.path); }); self.emit('list', result); @@ -84,6 +81,10 @@ DecompressZip.prototype.extract = function (options) { var promises = []; var results = []; + if (options.filter) { + files = files.filter(options.filter); + } + files.forEach(function (file) { var promise = self._extract(file, options.path) .then(function (result) { @@ -107,8 +108,14 @@ DecompressZip.prototype.extract = function (options) { // Utility methods DecompressZip.prototype.getSearchBuffer = function (stats) { - var size = Math.min(stats.size, huntSize); - return read(this.fd, new Buffer(size), 0, size, stats.size - size) + var size = Math.min(stats.size, this.chunkSize); + this.stats = stats; + return this.getBuffer(stats.size - size, stats.size); +}; + +DecompressZip.prototype.getBuffer = function (start, end) { + var size = end - start; + return read(this.fd, new Buffer(size), 0, size, start) .then(function (result) { return result[1]; }); @@ -123,7 +130,7 @@ DecompressZip.prototype.findEndOfDirectory = function (buffer) { // the location of the CD without hunting. // Search backwards through the buffer, as it is very likely to be near the // end of the file. - while (index > Math.max(buffer.length - huntSize, 0) && chunk !== signatures.END_OF_CENTRAL_DIRECTORY) { + while (index > Math.max(buffer.length - this.chunkSize, 0) && chunk !== signatures.END_OF_CENTRAL_DIRECTORY) { index--; chunk = buffer.readUInt32LE(index); } @@ -139,13 +146,8 @@ DecompressZip.prototype.findEndOfDirectory = function (buffer) { DecompressZip.prototype.readDirectory = function (recordBuffer) { var record = structures.readEndRecord(recordBuffer); - var directoryStream = new stream.Readable(); - directoryStream.wrap(fs.createReadStream(this.filename, { - start: record.directoryOffset, - end: record.directoryOffset + record.directorySize - })); - - return structures.readDirectory(directoryStream, record.directoryEntryCount); + return this.getBuffer(record.directoryOffset, record.directoryOffset + record.directorySize) + .then(structures.readDirectory.bind(null)); }; DecompressZip.prototype.getFiles = function () { @@ -167,20 +169,32 @@ DecompressZip.prototype.readFileEntries = function (directory) { var self = this; directory.forEach(function (directoryEntry, index) { - var fileStream = stream.Readable(); - fileStream.wrap(fs.createReadStream(self.filename, { - start: directoryEntry.relativeOffsetOfLocalHeader - })); - var promise = structures.readFileEntry(fileStream, directoryEntry.relativeOffsetOfLocalHeader) + var start = directoryEntry.relativeOffsetOfLocalHeader; + var end = Math.min(self.stats.size, start + structures.maxFileEntrySize); + var fileDetails = new FileDetails(directoryEntry); + + var promise = self.getBuffer(start, end) + .then(structures.readFileEntry.bind(null)) .then(function (fileEntry) { - files[index] = { - name: directoryEntry.fileName, - directoryEntry: directoryEntry, - fileEntry: fileEntry, - dataOffset: directoryEntry.relativeOffsetOfLocalHeader + fileEntry.entryLength - }; - - self.emit('file', files[index]); + var maxSize; + + if (fileDetails.compressedSize > 0) { + maxSize = fileDetails.compressedSize; + } else { + maxSize = self.stats.size; + + if (index < directory.length - 1) { + maxSize = directory[index + 1].relativeOffsetOfLocalHeader; + } + + maxSize -= start + fileEntry.entryLength; + } + + fileDetails._offset = start + fileEntry.entryLength; + fileDetails._maxSize = maxSize; + + self.emit('file', fileDetails); + files[index] = fileDetails; }); promises.push(promise); @@ -193,12 +207,7 @@ DecompressZip.prototype.readFileEntries = function (directory) { }; DecompressZip.prototype._extract = function (file, destination) { - destination = path.join(destination, file.name); - - // TODO: This actually needs to come from the externalAttributes - if (file.name.substr(-1) === '/') { - return extractors.folder(file, destination); - } + destination = path.join(destination, file.path); // Possible compression methods: // 0 - The file is stored (no compression) @@ -224,16 +233,24 @@ DecompressZip.prototype._extract = function (file, destination) { // 97 - WavPack compressed data // 98 - PPMd version I, Rev 1 - switch (file.directoryEntry.compressionMethod) { - case 0: - return extractors.store(file, destination, this.filename); + if (file.type === 'Directory') { + return extractors.folder(file, destination); + } - case 8: - return extractors.deflate(file, destination, this.filename); + if (file.type === 'File') { + switch (file.compressionMethod) { + case 0: + return extractors.store(file, destination, this); - default: - throw new Error('Unsupported compression type'); + case 8: + return extractors.deflate(file, destination, this); + + default: + throw new Error('Unsupported compression type'); + } } + + throw new Error('Unsupported file type "' + file.type + '"'); }; diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/extractors.js b/src/extensibility/node/node_modules/decompress-zip/lib/extractors.js index f3061b58af3..c43a6228453 100644 --- a/src/extensibility/node/node_modules/decompress-zip/lib/extractors.js +++ b/src/extensibility/node/node_modules/decompress-zip/lib/extractors.js @@ -8,19 +8,20 @@ var path = require('path'); var zlib = require('zlib'); var touch = Q.denodeify(require('touch')); var mkpath = Q.denodeify(require('mkpath')); +var writeFile = Q.denodeify(fs.writeFile); +var inflateRaw = Q.denodeify(zlib.inflateRaw); var cache = {}; // Use a cache of promises for building the directory tree. This allows us to // correctly queue up file extractions for after their path has been created, // avoid trying to create the path twice and still be async. -var windowsRoot = /^[A-Z]:\\$/; var mkdir = function (dir) { dir = path.normalize(path.resolve(process.cwd(), dir) + path.sep); if (!cache[dir]) { var parent; - if (dir === '/' || (process.platform === "win32" && dir.match(windowsRoot))) { + if (fs.existsSync(dir)) { parent = new Q(); } else { parent = mkdir(path.dirname(dir)); @@ -39,44 +40,57 @@ var extractors = { folder: function (folder, destination) { return mkdir(destination) .then(function () { - return {folder: folder.name}; + return {folder: folder.path}; }); }, - store: function (file, destination, sourceFile) { + store: function (file, destination, zip) { var writer; - if (file.directoryEntry.uncompressedSize === 0) { + if (file.uncompressedSize === 0) { writer = touch.bind(null, destination); + } else if (file.uncompressedSize <= zip.chunkSize) { + writer = function () { + return zip.getBuffer(file._offset, file._offset + file.uncompressedSize) + .then(writeFile.bind(null, destination)); + }; } else { var input = new stream.Readable(); - input.wrap(fs.createReadStream(sourceFile, {start: file.dataOffset, end: file.dataOffset + file.directoryEntry.uncompressedSize - 1})); + input.wrap(fs.createReadStream(zip.filename, {start: file._offset, end: file._offset + file.uncompressedSize - 1})); writer = pipePromise.bind(null, input, destination); } return mkdir(path.dirname(destination)) .then(writer) .then(function () { - return {stored: file.name}; + return {stored: file.path}; }); }, - deflate: function (file, destination, sourceFile) { + deflate: function (file, destination, zip) { // For Deflate you don't actually need to specify the end offset - and // in fact many ZIP files don't include compressed file sizes for // Deflated files so we don't even know what the end offset is. return mkdir(path.dirname(destination)) .then(function () { - // For node 0.8 we need to create the Zlib stream and attach - // handlers in the same tick of the event loop, which is why we do - // the creation in here - var input = new stream.Readable(); - input.wrap(fs.createReadStream(sourceFile, {start: file.dataOffset})); - var inflater = input.pipe(zlib.createInflateRaw({highWaterMark: 32 * 1024})); - - return pipePromise(inflater, destination); + if (file._maxSize <= zip.chunkSize) { + return zip.getBuffer(file._offset, file._offset + file._maxSize) + .then(inflateRaw) + .then(function (buffer) { + return writeFile(destination, buffer); + }); + } else { + // For node 0.8 we need to create the Zlib stream and attach + // handlers in the same tick of the event loop, which is why we do + // the creation in here + var input = new stream.Readable(); + input.wrap(fs.createReadStream(zip.filename, {start: file._offset})); + var inflater = input.pipe(zlib.createInflateRaw({highWaterMark: 32 * 1024})); + + return pipePromise(inflater, destination); + } }) .then(function () { - return {deflated: file.name}; + return {deflated: file.path}; }); } }; diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/file-details.js b/src/extensibility/node/node_modules/decompress-zip/lib/file-details.js new file mode 100644 index 00000000000..1f3ca689817 --- /dev/null +++ b/src/extensibility/node/node_modules/decompress-zip/lib/file-details.js @@ -0,0 +1,37 @@ +// Objects with this prototype are used as the public representation of a file +var path = require('path'); + +var FileDetails = function (directoryEntry) { + // TODO: Add 'extra field' support + + this._offset = 0; + this._maxSize = 0; + + this.parent = path.dirname(directoryEntry.fileName); + this.filename = path.basename(directoryEntry.fileName); + this.path = path.normalize(directoryEntry.fileName); + + this.type = directoryEntry.fileAttributes.type; + this.mode = directoryEntry.fileAttributes.mode; + this.compressionMethod = directoryEntry.compressionMethod; + this.modified = directoryEntry.modifiedTime; + this.crc32 = directoryEntry.crc32; + this.compressedSize = directoryEntry.compressedSize; + this.uncompressedSize = directoryEntry.uncompressedSize; + this.comment = directoryEntry.fileComment; + + this.flags = { + encrypted: directoryEntry.generalPurposeFlags.encrypted, + compressionFlag1: directoryEntry.generalPurposeFlags.compressionFlag1, + compressionFlag2: directoryEntry.generalPurposeFlags.compressionFlag2, + useDataDescriptor: directoryEntry.generalPurposeFlags.useDataDescriptor, + enhancedDeflating: directoryEntry.generalPurposeFlags.enhancedDeflating, + compressedPatched: directoryEntry.generalPurposeFlags.compressedPatched, + strongEncryption: directoryEntry.generalPurposeFlags.strongEncryption, + utf8: directoryEntry.generalPurposeFlags.utf8, + encryptedCD: directoryEntry.generalPurposeFlags.encryptedCD + }; + +}; + +module.exports = FileDetails; diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/structures.js b/src/extensibility/node/node_modules/decompress-zip/lib/structures.js index dfe03308380..66096ec4ae7 100644 --- a/src/extensibility/node/node_modules/decompress-zip/lib/structures.js +++ b/src/extensibility/node/node_modules/decompress-zip/lib/structures.js @@ -1,7 +1,6 @@ 'use strict'; var binary = require('binary'); -var Q = require('q'); var convertDateTime = function (dosDate, dosTime) { var year = ((dosDate >> 9) & 0x7F) + 1980; @@ -17,6 +16,81 @@ var convertDateTime = function (dosDate, dosTime) { return result; }; +var convertGeneralPurposeFlags = function (value) { + var bits = []; + + for (var i = 0; i < 16; i++) { + bits[i] = (value >> i) & 1; + } + + return { + encrypted: !!bits[0], + compressionFlag1: !!bits[1], + compressionFlag2: !!bits[2], + useDataDescriptor: !!bits[3], + enhancedDeflating: !!bits[4], + compressedPatched: !!bits[5], + strongEncryption: !!bits[6], + utf8: !!bits[11], + encryptedCD: !!bits[13] + }; +}; + +var parseExternalFileAttributes = function (externalAttributes, platform) { + var types = { + // In theory, any of these could be set. Realistically, though, it will + // be regular, directory or symlink + 1: 'NamedPipe', + 2: 'Character', + 4: 'Directory', + 6: 'Block', + 8: 'File', + 10: 'SymbolicLink', + 12: 'Socket' + }; + + switch (platform) { + case 0: // MSDOS + var attribs = { + A: (externalAttributes >> 5) & 0x01, + D: (externalAttributes >> 4) & 0x01, + V: (externalAttributes >> 3) & 0x01, + S: (externalAttributes >> 2) & 0x01, + H: (externalAttributes >> 1) & 0x01, + R: externalAttributes & 0x01 + }; + + // With no better guidance we'll make the default permissions ugo+r + var mode = parseInt('0444', 8); + + if (attribs.D) { + mode |= parseInt('0111', 8); // Set the execute bit + } + + if (!attribs.R) { + mode |= parseInt('0222', 8); // Set the write bit + } + + mode &= ~process.umask(); + + return { + platform: 'DOS', + type: attribs.D ? 'Directory' : 'File', + mode: mode + }; + + case 3: // Unix + return { + platform: 'Unix', + type: types[(externalAttributes >> 60) & 0x0F], + mode: (externalAttributes >> 48) & 0xFFF + }; + + default: + throw new Error('Unsupported platform type (' + platform + ')'); + } +}; + var readEndRecord = function (buffer) { var data = binary.parse(buffer) .word32lu('signature') @@ -35,196 +109,114 @@ var readEndRecord = function (buffer) { return data; }; -var readDirectory = function (stream, count) { - var deferred = Q.defer(); - var stage = 'main'; +var directorySort = function (a, b) { + return a.relativeOffsetOfLocalHeader - b.relativeOffsetOfLocalHeader; +}; + +var readDirectory = function (buffer) { var directory = []; var current; - - stream.on('readable', function () { - var chunk; - - while (directory.length < count) { - if (stage === 'main') { - chunk = stream.read(46); - if (chunk === null) { - return; - } - - current = binary.parse(chunk) - .word32lu('signature') - .word8lu('creatorSpecVersion') - .word8lu('creatorPlatform') - .word8lu('requiredSpecVersion') - .word8lu('requiredPlatform') - .word16lu('generalPurposeBitFlag') - .word16lu('compressionMethod') - .word16lu('lastModFileTime') - .word16lu('lastModFileDate') - .word32lu('crc32') - .word32lu('compressedSize') - .word32lu('uncompressedSize') - .word16lu('fileNameLength') - .word16lu('extraFieldLength') - .word16lu('fileCommentLength') - .word16lu('diskNumberStart') - .word16lu('internalFileAttributes') - .word32lu('externalFileAttributes') - .word32lu('relativeOffsetOfLocalHeader') - .vars; - - current.generalPurposeFlags = []; - - for (var i = 0; i < 16; i++) { - current.generalPurposeFlags[i] = (current.generalPurposeBitFlag >> i) & 1; - } - - current.modifiedTime = convertDateTime(current.lastModFileDate, current.lastModFileTime); - current.fileName = current.extraField = current.fileComment = ''; - current.headerLength = 46 + current.fileNameLength + current.extraFieldLength + current.fileCommentLength; - - stage = 'fileName'; - } - - if (stage === 'fileName') { - if (current.fileNameLength > 0) { - chunk = stream.read(current.fileNameLength); - if (chunk === null) { - return; - } - - current.fileName = chunk.toString(); - } - - stage = 'extraField'; - } - - if (stage === 'extraField') { - if (current.extraFieldLength > 0) { - chunk = stream.read(current.extraFieldLength); - if (chunk === null) { - return; - } - - current.extraField = chunk.toString(); - } - - stage = 'fileComment'; - } - - if (stage === 'fileComment') { - if (current.fileCommentLength > 0) { - chunk = stream.read(current.fileCommentLength); - if (chunk === null) { - return; - } - current.fileComment = chunk.toString(); - } - - directory.push(current); - - if (directory.length === count) { - deferred.resolve(directory); - stream.resume(); - } - - stage = 'main'; - } + var index = 0; + + while (index < buffer.length) { + current = binary.parse(buffer.slice(index, index + 46)) + .word32lu('signature') + .word8lu('creatorSpecVersion') + .word8lu('creatorPlatform') + .word8lu('requiredSpecVersion') + .word8lu('requiredPlatform') + .word16lu('generalPurposeBitFlag') + .word16lu('compressionMethod') + .word16lu('lastModFileTime') + .word16lu('lastModFileDate') + .word32lu('crc32') + .word32lu('compressedSize') + .word32lu('uncompressedSize') + .word16lu('fileNameLength') + .word16lu('extraFieldLength') + .word16lu('fileCommentLength') + .word16lu('diskNumberStart') + .word16lu('internalFileAttributes') + .word32lu('externalFileAttributes') + .word32lu('relativeOffsetOfLocalHeader') + .vars; + + index += 46; + + current.generalPurposeFlags = convertGeneralPurposeFlags(current.generalPurposeBitFlag); + current.fileAttributes = parseExternalFileAttributes(current.externalFileAttributes, current.creatorPlatform); + + current.modifiedTime = convertDateTime(current.lastModFileDate, current.lastModFileTime); + current.fileName = current.extraField = current.fileComment = ''; + current.headerLength = 46 + current.fileNameLength + current.extraFieldLength + current.fileCommentLength; + + if (current.fileNameLength > 0) { + current.fileName = buffer.slice(index, index + current.fileNameLength).toString(); + index += current.fileNameLength; } - }); - stream.on('end', function () { - deferred.resolve(directory); - }); + if (current.extraFieldLength > 0) { + current.extraField = buffer.slice(index, index + current.extraFieldLength).toString(); + index += current.extraFieldLength; + } - stream.on('error', function (err) { - deferred.reject(err); - }); + if (current.fileCommentLength > 0) { + current.fileComment = buffer.slice(index, index + current.fileCommentLength).toString(); + index += current.fileCommentLength; + } - return deferred.promise; -}; + directory.push(current); + } -var readFileEntry = function (stream) { - var deferred = Q.defer(); - var stage = 'main'; - var data; - - stream.on('readable', function () { - var chunk; - - if (stage === 'main') { - chunk = stream.read(30); - if (chunk === null) { - return; - } - - data = binary.parse(chunk) - .word32lu('signature') - .word16lu('versionNeededToExtract') - .word16lu('generalPurposeBitFlag') - .word16lu('compressionMethod') - .word16lu('lastModFileTime') - .word16lu('lastModFileDate') - .word32lu('crc32') - .word32lu('compressedSize') - .word32lu('uncompressedSize') - .word16lu('fileNameLength') - .word16lu('extraFieldLength') - .vars; - - data.fileName = data.extraField = ''; - - data.entryLength = 30 + data.fileNameLength + data.extraFieldLength; - - stage = 'fileName'; - } + directory.sort(directorySort); - if (stage === 'fileName') { - if (data.fileNameLength > 0) { - chunk = stream.read(data.fileNameLength); - if (chunk === null) { - return; - } + return directory; +}; - data.fileName = chunk.toString(); - } +var readFileEntry = function (buffer) { + var index = 0; - stage = 'extraField'; - } + var fileEntry = binary.parse(buffer.slice(index, 30)) + .word32lu('signature') + .word16lu('versionNeededToExtract') + .word16lu('generalPurposeBitFlag') + .word16lu('compressionMethod') + .word16lu('lastModFileTime') + .word16lu('lastModFileDate') + .word32lu('crc32') + .word32lu('compressedSize') + .word32lu('uncompressedSize') + .word16lu('fileNameLength') + .word16lu('extraFieldLength') + .vars; - if (stage === 'extraField') { - if (data.extraFieldLength > 0) { - chunk = stream.read(data.extraFieldLength); - if (chunk === null) { - return; - } + index += 30; - data.extraField = chunk.toString(); - } + fileEntry.fileName = fileEntry.extraField = ''; - deferred.resolve(data); - // Run the stream to the end so that it can be closed - stream.resume(); - } - }); + fileEntry.entryLength = 30 + fileEntry.fileNameLength + fileEntry.extraFieldLength; - stream.on('end', function () { - deferred.resolve(data); - }); + if (fileEntry.entryLength > structures.maxFileEntrySize) { + throw new Error('File entry unexpectedly large: ' + fileEntry.entryLength + ' (max: ' + structures.maxFileEntrySize + ')'); + } - stream.on('close', function () { - deferred.resolve(data); - }); + if (fileEntry.fileNameLength > 0) { + fileEntry.fileName = buffer.slice(index, index + fileEntry.fileNameLength).toString(); + index += fileEntry.fileNameLength; + } - stream.on('error', function (err) { - deferred.reject(err); - }); + if (fileEntry.extraFieldLength > 0) { + fileEntry.extraField = buffer.slice(index, index + fileEntry.extraFieldLength).toString(); + index += fileEntry.extraFieldLength; + } - return deferred.promise; + return fileEntry; }; -module.exports = { + +var structures = module.exports = { readEndRecord: readEndRecord, readDirectory: readDirectory, - readFileEntry: readFileEntry + readFileEntry: readFileEntry, + maxFileEntrySize: 4096 }; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json index 97b98eb712c..e5dbbfcef72 100644 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json +++ b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json @@ -31,9 +31,5 @@ "url": "https://github.com/jrajav/mkpath/issues" }, "_id": "mkpath@0.1.0", - "dist": { - "shasum": "7554a6f8d871834cc97b5462b122c4c124d6de91" - }, - "_from": "mkpath@~0.1.0", - "_resolved": "https://registry.npmjs.org/mkpath/-/mkpath-0.1.0.tgz" + "_from": "mkpath@~0.1.0" } diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/package.json index 58703492ee9..f201198fd79 100644 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -30,9 +30,5 @@ "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", "readmeFilename": "README.md", "_id": "core-util-is@1.0.0", - "dist": { - "shasum": "152a6bee4ee9d74c2b90ded347ae32dc2d48eb56" - }, - "_from": "core-util-is@~1.0.0", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.0.tgz" + "_from": "core-util-is@~1.0.0" } diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/package.json index b0bf338620a..670c981c4e4 100644 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/package.json +++ b/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/package.json @@ -21,9 +21,5 @@ "url": "https://github.com/sam-github/debuglog/issues" }, "_id": "debuglog@0.0.2", - "dist": { - "shasum": "d3c0b85f2f80fbc785af38262a87b7d6f863ed2f" - }, - "_from": "debuglog@0.0.2", - "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-0.0.2.tgz" + "_from": "debuglog@0.0.2" } diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/package.json index 92454554212..f924f3c7bca 100644 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/package.json +++ b/src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/package.json @@ -37,9 +37,5 @@ "url": "https://github.com/isaacs/readable-stream/issues" }, "_id": "readable-stream@1.1.9", - "dist": { - "shasum": "498a54a8d00748fa5e4456da4dc58f8515c3cd67" - }, - "_from": "readable-stream@~1.1.8", - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.9.tgz" + "_from": "readable-stream@~1.1.8" } diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/touch/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/touch/package.json index 30fcde44704..3fc55beef72 100644 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/touch/package.json +++ b/src/extensibility/node/node_modules/decompress-zip/node_modules/touch/package.json @@ -24,9 +24,5 @@ "url": "https://github.com/isaacs/node-touch/issues" }, "_id": "touch@0.0.2", - "dist": { - "shasum": "fb15541cd258c79a1e373af9ee0beadec87319b1" - }, - "_from": "touch@0.0.2", - "_resolved": "https://registry.npmjs.org/touch/-/touch-0.0.2.tgz" + "_from": "touch@0.0.2" } diff --git a/src/extensibility/node/node_modules/decompress-zip/package.json b/src/extensibility/node/node_modules/decompress-zip/package.json index 82ed28c56d0..229afbc5075 100644 --- a/src/extensibility/node/node_modules/decompress-zip/package.json +++ b/src/extensibility/node/node_modules/decompress-zip/package.json @@ -57,8 +57,8 @@ "readmeFilename": "README.md", "_id": "decompress-zip@0.0.1", "dist": { - "shasum": "7fddd26e8944714ba79d9c473a9debb339d29030" + "shasum": "8dd672e9b56e4a7a2bc52451aac34841422498c0" }, - "_from": "decompress-zip@0.0.1", - "_resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.0.1.tgz" + "_from": "https://github.com/bower/decompress-zip/archive/705ca19e9843b409b2d01fd3e31285b305753e59.tar.gz", + "_resolved": "https://github.com/bower/decompress-zip/archive/705ca19e9843b409b2d01fd3e31285b305753e59.tar.gz" } diff --git a/src/extensibility/node/node_modules/decompress-zip/test/test.js b/src/extensibility/node/node_modules/decompress-zip/test/test.js index a827deba517..b2c39fed3d7 100644 --- a/src/extensibility/node/node_modules/decompress-zip/test/test.js +++ b/src/extensibility/node/node_modules/decompress-zip/test/test.js @@ -75,7 +75,7 @@ describe('Extract', function () { }); it('should extract without any errors', function (done) { - this.timeout(10000); + this.timeout(60000); var zip = new DecompressZip(path.join(assetsPath, sample)); zip.on('extract', function () { diff --git a/src/extensibility/node/package.json b/src/extensibility/node/package.json index 9ed0d85db29..3cd020b3c40 100644 --- a/src/extensibility/node/package.json +++ b/src/extensibility/node/package.json @@ -3,7 +3,7 @@ "description": "Used in the management of Brackets extensions", "version": "0.32.0", "dependencies": { - "decompress-zip": "0.0.1", + "decompress-zip": "https://github.com/bower/decompress-zip/archive/705ca19e9843b409b2d01fd3e31285b305753e59.tar.gz", "semver": "2.x", "fs-extra": "0.6.x", "async": "0.2.x", diff --git a/src/extensions/default/CSSCodeHints/main.js b/src/extensions/default/CSSCodeHints/main.js index 5f1b07fff00..9aca2bbe1f4 100644 --- a/src/extensions/default/CSSCodeHints/main.js +++ b/src/extensions/default/CSSCodeHints/main.js @@ -173,7 +173,7 @@ define(function (require, exports, module) { }; /** - * Returns a list of availble CSS protertyname or -value hints if possible for the current + * Returns a list of availble CSS propertyname or -value hints if possible for the current * editor context. * * @param {Editor} implicitChar @@ -181,15 +181,20 @@ define(function (require, exports, module) { * that represents the last insertion and that indicates an implicit * hinting request. * - * @return {{hints: Array., match: string, - * selectInitial: boolean}} + * @return {jQuery.Deferred|{ + * hints: Array., + * match: string, + * selectInitial: boolean, + * handleWideResults: boolean}} * Null if the provider wishes to end the hinting session. Otherwise, a - * response object that provides + * response object that provides: * 1. a sorted array hints that consists of strings - * 2. a string match that is used by the manager to emphasize matching - * substrings when rendering the hint list - * 3. a boolean that indicates whether the first result, if one exists, should be - * selected by default in the hint list window. + * 2. a string match that is used by the manager to emphasize matching + * substrings when rendering the hint list + * 3. a boolean that indicates whether the first result, if one exists, + * should be selected by default in the hint list window. + * 4. handleWideResults, a boolean (or undefined) that indicates whether + * to allow result string to stretch width of display. */ CssPropHints.prototype.getHints = function (implicitChar) { this.cursor = this.editor.getCursorPos(); @@ -266,7 +271,8 @@ define(function (require, exports, module) { return { hints: result, match: needle, - selectInitial: selectInitial + selectInitial: selectInitial, + handleWideResults: false }; } return null; diff --git a/src/extensions/default/HTMLCodeHints/main.js b/src/extensions/default/HTMLCodeHints/main.js index cd781b8519a..efdc4ea01ea 100644 --- a/src/extensions/default/HTMLCodeHints/main.js +++ b/src/extensions/default/HTMLCodeHints/main.js @@ -105,14 +105,20 @@ define(function (require, exports, module) { * Returns a list of availble HTML tag hints if possible for the current * editor context. * - * @return {{hints: Array., match: string, - * selectInitial: boolean}} + * @return {jQuery.Deferred|{ + * hints: Array., + * match: string, + * selectInitial: boolean, + * handleWideResults: boolean}} * Null if the provider wishes to end the hinting session. Otherwise, a - * response object that provides 1. a sorted array hints that consists - * of strings; 2. a string match that is used by the manager to emphasize - * matching substrings when rendering the hint list; and 3. a boolean that - * indicates whether the first result, if one exists, should be selected - * by default in the hint list window. + * response object that provides: + * 1. a sorted array hints that consists of strings + * 2. a string match that is used by the manager to emphasize matching + * substrings when rendering the hint list + * 3. a boolean that indicates whether the first result, if one exists, + * should be selected by default in the hint list window. + * 4. handleWideResults, a boolean (or undefined) that indicates whether + * to allow result string to stretch width of display. */ TagHints.prototype.getHints = function (implicitChar) { var query, @@ -132,7 +138,8 @@ define(function (require, exports, module) { return { hints: result, match: query, - selectInitial: true + selectInitial: true, + handleWideResults: false }; } } @@ -358,14 +365,20 @@ define(function (require, exports, module) { * Returns a list of availble HTML attribute hints if possible for the * current editor context. * - * @return {{hints: Array., match: string, - * selectInitial: boolean}} + * @return {jQuery.Deferred|{ + * hints: Array., + * match: string, + * selectInitial: boolean, + * handleWideResults: boolean}} * Null if the provider wishes to end the hinting session. Otherwise, a - * response object that provides 1. a sorted array hints that consists - * of strings; 2. a string match that is used by the manager to emphasize - * matching substrings when rendering the hint list; and 3. a boolean that - * indicates whether the first result, if one exists, should be selected - * by default in the hint list window. + * response object that provides: + * 1. a sorted array hints that consists of strings + * 2. a string match that is used by the manager to emphasize matching + * substrings when rendering the hint list + * 3. a boolean that indicates whether the first result, if one exists, + * should be selected by default in the hint list window. + * 4. handleWideResults, a boolean (or undefined) that indicates whether + * to allow result string to stretch width of display. */ AttrHints.prototype.getHints = function (implicitChar) { var cursor = this.editor.getCursorPos(), @@ -430,12 +443,18 @@ define(function (require, exports, module) { return { hints: result, match: query.queryStr, - selectInitial: true + selectInitial: true, + handleWideResults: false }; } else if (hints instanceof Object && hints.hasOwnProperty("done")) { // Deferred hints var deferred = $.Deferred(); hints.done(function (asyncHints) { - deferred.resolveWith(this, [{ hints : asyncHints, match: query.queryStr, selectInitial: true }]); + deferred.resolveWith(this, [{ + hints: asyncHints, + match: query.queryStr, + selectInitial: true, + handleWideResults: false + }]); }); return deferred; } else { diff --git a/src/extensions/default/HtmlEntityCodeHints/main.js b/src/extensions/default/HtmlEntityCodeHints/main.js index 6ad953fea02..c83ef1ab68e 100644 --- a/src/extensions/default/HtmlEntityCodeHints/main.js +++ b/src/extensions/default/HtmlEntityCodeHints/main.js @@ -102,13 +102,20 @@ define(function (require, exports, module) { * that represents the last insertion and that indicates an implicit * hinting request. * - * @return {{hints: Array.<(string|jQuery.Obj)>, match: string, selectInitial: boolean}} + * @return {jQuery.Deferred|{ + * hints: Array., + * match: string, + * selectInitial: boolean, + * handleWideResults: boolean}} * Null if the provider wishes to end the hinting session. Otherwise, a - * response object that provides 1. a sorted array hints that consists - * of strings; 2. a string match that is used by the manager to emphasize - * matching substrings when rendering the hint list; and 3. a boolean that - * indicates whether the first result, if one exists, should be selected - * by default in the hint list window. + * response object that provides: + * 1. a sorted array hints that consists of strings + * 2. a string match that is used by the manager to emphasize matching + * substrings when rendering the hint list + * 3. a boolean that indicates whether the first result, if one exists, + * should be selected by default in the hint list window. + * 4. handleWideResults, a boolean (or undefined) that indicates whether + * to allow result string to stretch width of display. */ SpecialCharHints.prototype.getHints = function (implicitChar) { var query, @@ -130,7 +137,8 @@ define(function (require, exports, module) { return { hints: result, match: query, - selectInitial: true + selectInitial: true, + handleWideResults: false }; } diff --git a/src/extensions/default/JavaScriptCodeHints/main.js b/src/extensions/default/JavaScriptCodeHints/main.js index 213b2ccb1e1..e684f5447b1 100644 --- a/src/extensions/default/JavaScriptCodeHints/main.js +++ b/src/extensions/default/JavaScriptCodeHints/main.js @@ -85,8 +85,11 @@ define(function (require, exports, module) { * @param {Array.} hints - the list of hints to format * @param {string} query - querystring used for highlighting matched * poritions of each hint - * @return {Array.} - array of hints formatted as jQuery - * objects + * @return {jQuery.Deferred|{ + * hints: Array., + * match: string, + * selectInitial: boolean, + * handleWideResults: boolean}} */ function formatHints(hints, query) { return hints.map(function (token) { diff --git a/src/extensions/default/UrlCodeHints/main.js b/src/extensions/default/UrlCodeHints/main.js index 78ee6e70aa0..9f00c7bab60 100644 --- a/src/extensions/default/UrlCodeHints/main.js +++ b/src/extensions/default/UrlCodeHints/main.js @@ -365,14 +365,20 @@ define(function (require, exports, module) { * Returns a list of availble font hints, if possible, for the current * editor context. * - * @return {{hints: Array., match: string, selectInitial: boolean}} - * + * @return {jQuery.Deferred|{ + * hints: Array., + * match: string, + * selectInitial: boolean, + * handleWideResults: boolean}} * Null if the provider wishes to end the hinting session. Otherwise, a - * response object that provides: - * 1. a sorted array formatted hints; - * 2. a null string match to indicate that the hints are already formatted; - * 3. a boolean that indicates whether the first result, if one exists, - * should be selected by default in the hint list window. + * response object that provides + * 1. a sorted array hints that consists of strings + * 2. a string match that is used by the manager to emphasize matching + * substrings when rendering the hint list + * 3. a boolean that indicates whether the first result, if one exists, should be + * selected by default in the hint list window. + * 4. handleWideResults, a boolean (or undefined) that indicates whether + * to allow result string to stretch width of display. */ UrlCodeHints.prototype.getHints = function (key) { var mode = this.editor.getModeForSelection(), @@ -465,7 +471,8 @@ define(function (require, exports, module) { return { hints: result, match: query.queryStr, - selectInitial: true + selectInitial: true, + handleWideResults: false }; } else if (hints instanceof Object && hints.hasOwnProperty("done")) { @@ -475,7 +482,8 @@ define(function (require, exports, module) { deferred.resolveWith(this, [{ hints: asyncHints, match: query.queryStr, - selectInitial: true + selectInitial: true, + handleWideResults: false }]); }); diff --git a/src/file/FileUtils.js b/src/file/FileUtils.js index 4cfc8290946..4269f0fb6a7 100644 --- a/src/file/FileUtils.js +++ b/src/file/FileUtils.js @@ -237,7 +237,18 @@ define(function (require, exports, module) { return path; } } - + + /** + * Get the name of a file or a directory, removing any preceding path. + * @param {string} fullPath full path to a file or directory + * @return {string} Returns the base name of a file or the name of a + * directory + */ + function getBaseName(fullPath) { + fullPath = canonicalizeFolderPath(fullPath); + return fullPath.substr(fullPath.lastIndexOf("/") + 1); + } + /** * Returns a native absolute path to the 'brackets' source directory. * Note that this only works when run in brackets/src/index.html, so it does @@ -315,17 +326,39 @@ define(function (require, exports, module) { } /** - * Returns the file extension for a file name - * @param {string} fileName file name with extension or just a file extension - * @return {string} File extension if found, otherwise return the original file name + * Get the file extension (excluding ".") given a path OR a bare filename. + * Returns "" for names with no extension. If the name starts with ".", the + * full remaining text is considered the extension. + * + * @param {string} fullPath full path to a file or directory + * @return {string} Returns the extension of a filename or empty string if + * the argument is a directory or a filename with no extension */ - function _getFileExtension(fileName) { - var i = fileName.lastIndexOf("."), - ext = (i === -1 || i >= fileName.length - 1) ? fileName : fileName.substr(i + 1); + function getFileExtension(fullPath) { + var baseName = getBaseName(fullPath), + idx = baseName.lastIndexOf("."); + + if (idx === -1) { + return ""; + } + return baseName.substr(idx + 1); + } + + /** + * Similar to getFileExtension(), but includes the leading "." in the returned value. + * @deprecated Use getFileExtension() instead. This API will be removed soon. + */ + function getFilenameExtension(fullPath) { + console.error("Warning: FileUtils.getFilenameExtension() is deprecated. Use FileUtils.getFileExtension() (which omits the '.') instead."); + + var ext = getFileExtension(fullPath); + if (ext !== "") { + ext = "." + ext; + } return ext; } - + /** @const - hard-coded for now, but may want to make these preferences */ var _staticHtmlFileExts = ["htm", "html"], _serverHtmlFileExts = ["php", "php3", "php4", "php5", "phtm", "phtml", "cfm", "cfml", "asp", "aspx", "jsp", "jspx", "shtm", "shtml"]; @@ -340,7 +373,7 @@ define(function (require, exports, module) { return false; } - return (_staticHtmlFileExts.indexOf(_getFileExtension(fileExt).toLowerCase()) !== -1); + return (_staticHtmlFileExts.indexOf(getFileExtension(fileExt).toLowerCase()) !== -1); } /** @@ -353,47 +386,19 @@ define(function (require, exports, module) { return false; } - return (_serverHtmlFileExts.indexOf(_getFileExtension(fileExt).toLowerCase()) !== -1); + return (_serverHtmlFileExts.indexOf(getFileExtension(fileExt).toLowerCase()) !== -1); } /** * Get the parent directory of a file. If a directory is passed in the directory is returned. * @param {string} fullPath full path to a file or directory - * @return {string} Returns the path to the parent directory of a file or the path of a directory + * @return {string} Returns the path to the parent directory of a file or the path of a directory, + * including trailing "/" */ function getDirectoryPath(fullPath) { return fullPath.substr(0, fullPath.lastIndexOf("/") + 1); } - /** - * Get the base name of a file or a directory. - * @param {string} fullPath full path to a file or directory - * @return {string} Returns the base name of a file or the name of a - * directory - */ - function getBaseName(fullPath) { - fullPath = canonicalizeFolderPath(fullPath); - return fullPath.substr(fullPath.lastIndexOf("/") + 1); - } - - /** - * Get the filename extension. - * - * @param {string} fullPath full path to a file or directory - * @return {string} Returns the extension of a filename or empty string if - * the argument is a directory or a filename with no extension - */ - function getFilenameExtension(fullPath) { - var baseName = getBaseName(fullPath), - idx = baseName.lastIndexOf("."); - - if (idx === -1) { - return ""; - } - - return baseName.substr(idx); - } - /** * @private * Get the file name without the extension. @@ -401,8 +406,8 @@ define(function (require, exports, module) { * @return {string} Returns the file name without the extension */ function _getFilenameWithoutExtension(filename) { - var extension = getFilenameExtension(filename); - return extension ? filename.replace(new RegExp(extension + "$"), "") : filename; + var index = filename.lastIndexOf("."); + return index === -1 ? filename : filename.slice(0, index); } /** @@ -414,8 +419,8 @@ define(function (require, exports, module) { * @return {number} The result of the local compare function */ function compareFilenames(filename1, filename2, extFirst) { - var ext1 = getFilenameExtension(filename1), - ext2 = getFilenameExtension(filename2), + var ext1 = getFileExtension(filename1), + ext2 = getFileExtension(filename2), cmpExt = ext1.toLocaleLowerCase().localeCompare(ext2.toLocaleLowerCase(), undefined, {numeric: true}), cmpNames; @@ -450,6 +455,7 @@ define(function (require, exports, module) { exports.isServerHtmlFileExt = isServerHtmlFileExt; exports.getDirectoryPath = getDirectoryPath; exports.getBaseName = getBaseName; + exports.getFileExtension = getFileExtension; exports.getFilenameExtension = getFilenameExtension; exports.compareFilenames = compareFilenames; }); diff --git a/src/language/CodeInspection.js b/src/language/CodeInspection.js index cf884c494f9..9fa2181a264 100644 --- a/src/language/CodeInspection.js +++ b/src/language/CodeInspection.js @@ -45,6 +45,7 @@ define(function (require, exports, module) { CommandManager = require("command/CommandManager"), DocumentManager = require("document/DocumentManager"), EditorManager = require("editor/EditorManager"), + FileUtils = require("file/FileUtils"), LanguageManager = require("language/LanguageManager"), PreferencesManager = require("preferences/PreferencesManager"), PerfUtils = require("utils/PerfUtils"), @@ -72,7 +73,6 @@ define(function (require, exports, module) { META: "problem_type_meta" }; - /** * @private * @type {PreferenceStorage} @@ -100,6 +100,12 @@ define(function (require, exports, module) { */ var $problemsPanel; + /** + * @private + * @type {$.Element} + */ + var $problemsPanelTable; + /** * @private * @type {boolean} @@ -145,7 +151,69 @@ define(function (require, exports, module) { } _providers[languageId] = provider; } - + + /** + * Returns a provider for given file path, if one is available. + * Decision is made depending on the file extension. + * + * @param {!string} filePath + * @return ?{{name:string, scanFile:function(string, string):?{!errors:Array, aborted:boolean}} provider + */ + function getProviderForPath(filePath) { + return _providers[LanguageManager.getLanguageForPath(filePath).getId()]; + } + + /** + * Runs a file inspection over passed file, specifying a provider is optional. + * This method doesn't update the Brackets UI, just provides inspection results. + * These results will reflect any unsaved changes present in the file that is currently opened. + * + * @param {!FileEntry} fileEntry File that will be inspected for errors. + * @param ?{{name:string, scanFile:function(string, string):?{!errors:Array, aborted:boolean}} provider + * @return {$.Promise} a jQuery promise that will be resolved with ?{!errors:Array, aborted:boolean} + */ + function inspectFile(fileEntry, provider) { + var response = new $.Deferred(); + provider = provider || getProviderForPath(fileEntry.fullPath); + + if (!provider) { + response.resolve(null); + return response.promise(); + } + + var doc = DocumentManager.getOpenDocumentForPath(fileEntry.fullPath), + fileTextPromise; + + if (doc) { + fileTextPromise = new $.Deferred().resolve(doc.getText()); + } else { + fileTextPromise = FileUtils.readAsText(fileEntry); + } + + fileTextPromise + .done(function (fileText) { + var result, + perfTimerInspector = PerfUtils.markStart("CodeInspection '" + provider.name + "':\t" + fileEntry.fullPath); + + try { + result = provider.scanFile(fileText, fileEntry.fullPath); + } catch (err) { + console.error("[CodeInspection] Provider " + provider.name + " threw an error: " + err); + response.reject(err); + return; + } + + PerfUtils.addMeasurement(perfTimerInspector); + response.resolve(result); + }) + .fail(function (err) { + console.error("[CodeInspection] Could not read file for inspection: " + fileEntry.fullPath); + response.reject(err); + }); + + return response.promise(); + } + /** * Run inspector applicable to current document. Updates status bar indicator and refreshes error list in * bottom panel. @@ -159,30 +227,31 @@ define(function (require, exports, module) { return; } - var currentDoc = DocumentManager.getCurrentDocument(); - - var perfTimerDOM, - perfTimerInspector; - - var language = currentDoc ? LanguageManager.getLanguageForPath(currentDoc.file.fullPath) : ""; - var languageId = language && language.getId(); - var provider = language && _providers[languageId]; + var currentDoc = DocumentManager.getCurrentDocument(), + provider = currentDoc && getProviderForPath(currentDoc.file.fullPath); if (provider) { - perfTimerInspector = PerfUtils.markStart("CodeInspection '" + languageId + "':\t" + currentDoc.file.fullPath); - - var result = provider.scanFile(currentDoc.getText(), currentDoc.file.fullPath); - _lastResult = result; - - PerfUtils.addMeasurement(perfTimerInspector); - perfTimerDOM = PerfUtils.markStart("ProblemsPanel render:\t" + currentDoc.file.fullPath); - - if (result && result.errors.length) { + inspectFile(currentDoc.file, provider).then(function (result) { + // check if current document wasn't changed while inspectFile was running + if (currentDoc !== DocumentManager.getCurrentDocument()) { + return; + } + + _lastResult = result; + + if (!result || !result.errors.length) { + Resizer.hide($problemsPanel); + StatusBar.updateIndicator(INDICATOR_ID, true, "inspection-valid", StringUtils.format(Strings.NO_ERRORS, provider.name)); + setGotoEnabled(false); + return; + } + + var perfTimerDOM = PerfUtils.markStart("ProblemsPanel render:\t" + currentDoc.file.fullPath); + // Augment error objects with additional fields needed by Mustache template var numProblems = 0; result.errors.forEach(function (error) { error.friendlyLine = error.pos.line + 1; - error.codeSnippet = currentDoc.getLine(error.pos.line); error.codeSnippet = error.codeSnippet.substr(0, Math.min(175, error.codeSnippet.length)); // limit snippet width @@ -193,27 +262,11 @@ define(function (require, exports, module) { // Update results table var html = Mustache.render(ResultsTemplate, {reportList: result.errors}); - var $selectedRow; - $problemsPanel.find(".table-container") + $problemsPanelTable .empty() .append(html) - .scrollTop(0) // otherwise scroll pos from previous contents is remembered - .on("click", "tr", function (e) { - if ($selectedRow) { - $selectedRow.removeClass("selected"); - } - - $selectedRow = $(e.currentTarget); - $selectedRow.addClass("selected"); - var lineTd = $selectedRow.find(".line-number"); - var line = parseInt(lineTd.text(), 10) - 1; // convert friendlyLine back to pos.line - var character = lineTd.data("character"); - - var editor = EditorManager.getCurrentFullEditor(); - editor.setCursorPos(line, character, true); - EditorManager.focusEditor(); - }); + .scrollTop(0); // otherwise scroll pos from previous contents is remembered $problemsPanel.find(".title").text(StringUtils.format(Strings.ERRORS_PANEL_TITLE, provider.name)); if (!_collapsed) { @@ -231,19 +284,14 @@ define(function (require, exports, module) { StringUtils.format(Strings.MULTIPLE_ERRORS, provider.name, numProblems)); } setGotoEnabled(true); - - } else { - Resizer.hide($problemsPanel); - StatusBar.updateIndicator(INDICATOR_ID, true, "inspection-valid", StringUtils.format(Strings.NO_ERRORS, provider.name)); - setGotoEnabled(false); - } - - PerfUtils.addMeasurement(perfTimerDOM); + PerfUtils.addMeasurement(perfTimerDOM); + }); } else { // No provider for current file _lastResult = null; Resizer.hide($problemsPanel); + var language = currentDoc && LanguageManager.getLanguageForPath(currentDoc.file.fullPath); if (language) { StatusBar.updateIndicator(INDICATOR_ID, true, "inspection-disabled", StringUtils.format(Strings.NO_LINT_AVAILABLE, language.getName())); } else { @@ -339,6 +387,24 @@ define(function (require, exports, module) { var resultsPanel = PanelManager.createBottomPanel("errors", $(panelHtml), 100); $problemsPanel = $("#problems-panel"); + var $selectedRow; + $problemsPanelTable = $problemsPanel.find(".table-container") + .on("click", "tr", function (e) { + if ($selectedRow) { + $selectedRow.removeClass("selected"); + } + + $selectedRow = $(e.currentTarget); + $selectedRow.addClass("selected"); + var lineTd = $selectedRow.find(".line-number"); + var line = parseInt(lineTd.text(), 10) - 1; // convert friendlyLine back to pos.line + var character = lineTd.data("character"); + + var editor = EditorManager.getCurrentFullEditor(); + editor.setCursorPos(line, character, true); + EditorManager.focusEditor(); + }); + $("#problems-panel .close").click(function () { toggleCollapsed(true); }); @@ -363,7 +429,8 @@ define(function (require, exports, module) { // Public API - exports.register = register; - exports.Type = Type; - exports.toggleEnabled = toggleEnabled; + exports.register = register; + exports.Type = Type; + exports.toggleEnabled = toggleEnabled; + exports.inspectFile = inspectFile; }); diff --git a/src/language/JSUtils.js b/src/language/JSUtils.js index 44875777959..1ccb0c9ba75 100644 --- a/src/language/JSUtils.js +++ b/src/language/JSUtils.js @@ -379,7 +379,7 @@ define(function (require, exports, module) { if (!keepAllFiles) { // Filter fileInfos for .js files jsFiles = fileInfos.filter(function (fileInfo) { - return (/^\.js/i).test(FileUtils.getFilenameExtension(fileInfo.fullPath)); + return FileUtils.getFileExtension(fileInfo.fullPath).toLowerCase() === "js"; }); } else { jsFiles = fileInfos; diff --git a/src/language/languages.json b/src/language/languages.json index 9ab2d31e596..4964f40021d 100644 --- a/src/language/languages.json +++ b/src/language/languages.json @@ -36,7 +36,7 @@ "html": { "name": "HTML", "mode": ["htmlmixed", "text/x-brackets-html"], - "fileExtensions": ["html", "htm", "shtm", "shtml", "xhtml", "cfm", "cfml", "cfc", "dhtml", "xht", "tpl", "twig", "hbs", "handlebars", "kit", "jsp", "aspx", "asp"], + "fileExtensions": ["html", "htm", "shtm", "shtml", "xhtml", "cfm", "cfml", "cfc", "dhtml", "xht", "tpl", "twig", "hbs", "handlebars", "kit", "jsp", "aspx", "asp", "master"], "blockComment": [""] }, @@ -57,7 +57,7 @@ "javascript": { "name": "JavaScript", "mode": "javascript", - "fileExtensions": ["js", "jsx", "js.erb"], + "fileExtensions": ["js", "jsx", "js.erb", "jsm"], "blockComment": ["/*", "*/"], "lineComment": ["//"] }, diff --git a/src/nls/cs/strings.js b/src/nls/cs/strings.js index f5f629c8482..59430d921eb 100644 --- a/src/nls/cs/strings.js +++ b/src/nls/cs/strings.js @@ -112,10 +112,14 @@ define({ // Najít, Nahradit, Nahradit v souborech "SEARCH_REGEXP_INFO" : "Použijte /re/ syntax pro regexp hledání", "FIND_RESULT_COUNT" : "{0} výsledků", + "FIND_RESULT_COUNT_SINGLE" : "1 výsledek", + "FIND_NO_RESULTS" : "Žádné výsledky", "WITH" : "S", "BUTTON_YES" : "Ano", "BUTTON_NO" : "Ne", + "BUTTON_REPLACE_ALL" : "Vše\u2026", "BUTTON_STOP" : "Stop", + "BUTTON_REPLACE" : "Nahradit", "OPEN_FILE" : "Otevřít soubor", "SAVE_FILE_AS" : "Uložit soubor", @@ -125,17 +129,21 @@ define({ "NO_UPDATE_TITLE" : "Vše je aktuální!", "NO_UPDATE_MESSAGE" : "Verze {APP_NAME} je aktuální.", - "FIND_IN_FILES_TITLE" : "pro \"{4}\" {5} - {0} {1} v {2} {3}", + "FIND_REPLACE_TITLE_PART1" : "Nahradit \"", + "FIND_REPLACE_TITLE_PART2" : "\" s \"", + "FIND_REPLACE_TITLE_PART3" : "\" — {2} {0} {1}", + + "FIND_IN_FILES_TITLE_PART1" : "\"", + "FIND_IN_FILES_TITLE_PART2" : "\" nalezen", + "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} {2} v {3} {4}", "FIND_IN_FILES_SCOPED" : "v {0}", "FIND_IN_FILES_NO_SCOPE" : "v projektu", - "FIND_IN_FILES_FILE" : "soubor", + "FIND_IN_FILES_FILE" : "souboru", "FIND_IN_FILES_FILES" : "souborech", "FIND_IN_FILES_MATCH" : "výsledek", "FIND_IN_FILES_MATCHES" : "výsledků", "FIND_IN_FILES_MORE_THAN" : "více než ", "FIND_IN_FILES_PAGING" : "{0}—{1}", - "FIND_IN_FILES_LESS" : " Méně", - "FIND_IN_FILES_MORE" : " Více", "FIND_IN_FILES_FILE_PATH" : "Soubor: {0}", "FIND_IN_FILES_LINE" : "řádek: {0}", @@ -444,6 +452,8 @@ define({ // extensions/default/JavaScriptCodeHints "CMD_JUMPTO_DEFINITION" : "Přejít na definici", + "CMD_SHOW_PARAMETER_HINT" : "Zobrazit nápovědu parametru", + "NO_ARGUMENTS" : "<žádné parametry>", // extensions/default/JSLint "CMD_JSLINT" : "Povolit JSLint", diff --git a/src/project/FileIndexManager.js b/src/project/FileIndexManager.js index 1c9fc08231e..d3457e2d370 100644 --- a/src/project/FileIndexManager.js +++ b/src/project/FileIndexManager.js @@ -439,7 +439,7 @@ define(function (require, exports, module) { _addIndex( "css", function (entry) { - return FileUtils.getFilenameExtension(entry.name) === ".css"; + return FileUtils.getFileExtension(entry.name) === "css"; } ); diff --git a/src/search/FindReplace.js b/src/search/FindReplace.js index 89f88d3a799..2a81f4562cc 100644 --- a/src/search/FindReplace.js +++ b/src/search/FindReplace.js @@ -52,8 +52,14 @@ define(function (require, exports, module) { var searchReplacePanelTemplate = require("text!htmlContent/search-replace-panel.html"), searchReplaceResultsTemplate = require("text!htmlContent/search-replace-results.html"); - /** @cost Constant used to define the maximum results to show */ - var FIND_REPLACE_MAX = 300; + /** @const Maximum file size to search within (in chars) */ + var FIND_MAX_FILE_SIZE = 500000; + + /** @const If the number of matches exceeds this limit, inline text highlighting and scroll-track tickmarks are disabled */ + var FIND_HIGHLIGHT_MAX = 2000; + + /** @const Maximum number of matches to collect for Replace All; any additional matches are not listed in the panel & are not replaced */ + var REPLACE_ALL_MAX = 300; /** @type {!Panel} Panel that shows results of replaceAll action */ var replaceAllPanel = null; @@ -152,6 +158,7 @@ define(function (require, exports, module) { }); }); state.marked.length = 0; + ScrollTrackMarkers.clear(); } @@ -178,7 +185,7 @@ define(function (require, exports, module) { modalBar.close(true, animate); } modalBar = new ModalBar(template, autoClose, animate); - $(modalBar).on("closeOk closeBlur closeCancel", function () { + $(modalBar).on("commit close", function () { modalBar = null; }); } @@ -206,13 +213,6 @@ define(function (require, exports, module) { ScrollTrackMarkers.setVisible(editor, enabled); } - - function addHighlight(editor, state, cursor) { - var cm = editor._codeMirror; - state.marked.push(cm.markText(cursor.from(), cursor.to(), { className: "CodeMirror-searching" })); - - ScrollTrackMarkers.addTickmark(editor, cursor.from()); - } /** * If no search pending, opens the search dialog. If search is already open, moves to @@ -264,19 +264,16 @@ define(function (require, exports, module) { //Flag that controls the navigation controls. var enableNavigator = false; - // Highlight all matches + // Find all matches // (Except on huge documents, where this is too expensive) - if (cm.getValue().length < 500000) { - toggleHighlighting(editor, true); - + var resultSet = []; + if (cm.getValue().length <= FIND_MAX_FILE_SIZE) { // FUTURE: if last query was prefix of this one, could optimize by filtering existing result set - var resultCount = 0; var cursor = getSearchCursor(cm, state.query); while (cursor.findNext()) { - addHighlight(editor, state, cursor); - resultCount++; - - //Remove this section when https://github.com/marijnh/CodeMirror/issues/1155 will be fixed + resultSet.push(cursor.pos); // pos is unique obj per search result + + // TODO: remove this section when https://github.com/marijnh/CodeMirror/issues/1155 is fixed if (cursor.pos.match && cursor.pos.match[0] === "") { if (cursor.to().line + 1 === cm.lineCount()) { break; @@ -284,13 +281,27 @@ define(function (require, exports, module) { cursor = getSearchCursor(cm, state.query, {line: cursor.to().line + 1, ch: 0}); } } - - if (resultCount === 0) { + + // Highlight all matches if there aren't too many + if (resultSet.length <= FIND_HIGHLIGHT_MAX) { + toggleHighlighting(editor, true); + + resultSet.forEach(function (result) { + state.marked.push(cm.markText(result.from, result.to, { className: "CodeMirror-searching" })); + }); + var scrollTrackPositions = resultSet.map(function (result) { + return result.from; + }); + + ScrollTrackMarkers.addTickmarks(editor, scrollTrackPositions); + } + + if (resultSet.length === 0) { $("#find-counter").text(Strings.FIND_NO_RESULTS); - } else if (resultCount === 1) { + } else if (resultSet.length === 1) { $("#find-counter").text(Strings.FIND_RESULT_COUNT_SINGLE); } else { - $("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT, resultCount)); + $("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT, resultSet.length)); enableNavigator = true; } @@ -319,7 +330,7 @@ define(function (require, exports, module) { } createModalBar(queryDialog, true); - $(modalBar).on("closeOk", function (e, query) { + $(modalBar).on("commit", function (e, query) { if (!state.findNextCalled) { // If findNextCalled is false, this means the user has *not* // entered any search text *or* pressed Cmd-G/F3 to find the @@ -329,7 +340,7 @@ define(function (require, exports, module) { findFirst(query); } }); - $(modalBar).on("closeOk closeCancel closeBlur", function (e, query) { + $(modalBar).on("commit close", function (e, query) { // Clear highlights but leave search state in place so Find Next/Previous work after closing clearHighlights(cm, state); @@ -427,7 +438,7 @@ define(function (require, exports, module) { post: multiLine ? "\u2026" : line.slice(to.ch) }); - if (results.length >= FIND_REPLACE_MAX) { + if (results.length >= REPLACE_ALL_MAX) { break; } } @@ -438,7 +449,7 @@ define(function (require, exports, module) { Strings.FIND_REPLACE_TITLE_PART3, resultsLength, resultsLength > 1 ? Strings.FIND_IN_FILES_MATCHES : Strings.FIND_IN_FILES_MATCH, - resultsLength >= FIND_REPLACE_MAX ? Strings.FIND_IN_FILES_MORE_THAN : "" + resultsLength >= REPLACE_ALL_MAX ? Strings.FIND_IN_FILES_MORE_THAN : "" ); // Insert the search summary @@ -500,7 +511,7 @@ define(function (require, exports, module) { function replace(editor, all) { var cm = editor._codeMirror; createModalBar(replaceQueryDialog, true); - $(modalBar).on("closeOk", function (e, query) { + $(modalBar).on("commit", function (e, query) { if (!query) { return; } @@ -511,7 +522,7 @@ define(function (require, exports, module) { // Eventually we should rip out all this code (which comes from the old CodeMirror dialog // logic) and just change the content itself. createModalBar(replacementQueryDialog, true, false); - $(modalBar).on("closeOk", function (e, text) { + $(modalBar).on("commit", function (e, text) { text = text || ""; var match, fnMatch = function (w, i) { return match[i]; }; diff --git a/src/search/QuickOpen.js b/src/search/QuickOpen.js index 93e2c51e1e9..af9135a6e64 100644 --- a/src/search/QuickOpen.js +++ b/src/search/QuickOpen.js @@ -309,7 +309,9 @@ define(function (require, exports, module) { selectedDOMItem = $(".smart_autocomplete_container > li:first-child").get(0); } - var selectedItem = domItemToSearchResult(selectedDOMItem); + var selectedItem = domItemToSearchResult(selectedDOMItem), + doClose = true, + self = this; // Delegate to current plugin if (currentPlugin) { @@ -323,21 +325,32 @@ define(function (require, exports, module) { // Navigate to file and line number var fullPath = selectedItem && selectedItem.fullPath; if (fullPath) { + // This case is tricky. We want to switch editors, so we need to deal with + // resizing/rescrolling the current editor first. But we don't actually want + // to start the animation of the ModalBar until afterward (otherwise it glitches + // because it gets starved of cycles during the creation of the new editor). + // So we call `prepareClose()` first, and finish the close later. + doClose = false; + this.modalBar.prepareClose(); CommandManager.execute(Commands.FILE_ADD_TO_WORKING_SET, {fullPath: fullPath}) .done(function () { if (!isNaN(gotoLine)) { var editor = EditorManager.getCurrentFullEditor(); editor.setCursorPos(gotoLine, 0, true); } + }) + .always(function () { + self.close(); }); } else if (!isNaN(gotoLine)) { EditorManager.getCurrentFullEditor().setCursorPos(gotoLine, 0, true); } } - - this.close(); - EditorManager.focusEditor(); + if (doClose) { + this.close(); + EditorManager.focusEditor(); + } }; /** diff --git a/src/search/ScrollTrackMarkers.js b/src/search/ScrollTrackMarkers.js index 6e742236b39..aa60cdb0e91 100644 --- a/src/search/ScrollTrackMarkers.js +++ b/src/search/ScrollTrackMarkers.js @@ -78,14 +78,16 @@ define(function (require, exports, module) { trackHt -= trackOffset * 2; } - /** Add one tickmark to the DOM */ - function _renderMark(pos) { - var top = Math.round(pos.line / editor.lineCount() * trackHt) + trackOffset; - top--; // subtract ~1/2 the ht of a tickmark to center it on ideal pos - - var $mark = $("
"); - - $(".tickmark-track", editor.getRootElement()).append($mark); + /** Add all the given tickmarks to the DOM in a batch */ + function _renderMarks(posArray) { + var html = ""; + posArray.forEach(function (pos) { + var top = Math.round(pos.line / editor.lineCount() * trackHt) + trackOffset; + top--; // subtract ~1/2 the ht of a tickmark to center it on ideal pos + + html += "
"; + }); + $(".tickmark-track", editor.getRootElement()).append($(html)); } @@ -128,9 +130,7 @@ define(function (require, exports, module) { if (marks.length) { _calcScaling(); $(".tickmark-track", editor.getRootElement()).empty(); - marks.forEach(function (pos) { - _renderMark(pos); - }); + _renderMarks(marks); } })); @@ -143,16 +143,20 @@ define(function (require, exports, module) { } } - /** Add a tickmark to the editor's tickmark track, if it's visible */ - function addTickmark(curEditor, pos) { + /** + * Add tickmarks to the editor's tickmark track, if it's visible + * @param curEditor {!Editor} + * @param posArray {!Array.<{line:Number, ch:Number}>} + */ + function addTickmarks(curEditor, posArray) { console.assert(editor === curEditor); - marks.push(pos); - _renderMark(pos); + marks = marks.concat(posArray); + _renderMarks(posArray); } exports.clear = clear; exports.setVisible = setVisible; - exports.addTickmark = addTickmark; + exports.addTickmarks = addTickmarks; }); diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 99b256a4236..4cf338cfda3 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -840,21 +840,6 @@ a, img { /* Modal bar for Find/Quick Open */ -.modal-bar.modal-bar-hide { - position: absolute; - left: 0; - right: 0; - top: 0; - -webkit-transform: translate(0, -44px); - transform: translate(0, -44px); - transition: -webkit-transform 266ms cubic-bezier(0, 0.56, 0, 1); - transition: transform 266ms cubic-bezier(0, 0.56, 0, 1); - - body:not(.has-appshell-menus) & { - top: 37px; - } -} - .modal-bar { display: block; text-align: left; @@ -875,37 +860,56 @@ a, img { // Separator line between us and the HTML menu/titlebar above border-top: 1px solid darken(@background-color-3, @bc-color-step-size); } -} + + &.popout { + position: absolute; + left: 0; + right: 0; + top: 0; + } + + &.offscreen { + -webkit-transform: translate(0, -44px); + transform: translate(0, -44px); + transition: -webkit-transform 266ms cubic-bezier(0, 0.56, 0, 1); + transition: transform 266ms cubic-bezier(0, 0.56, 0, 1); + + body:not(.has-appshell-menus) & { + top: 37px; + } + } -.modal-bar input { - font-family: @sansFontFamily; - outline: none; - width: 20em; - margin: 5px 5px 0; - position: relative; - top: -3px; - &.no-results { - border: 1px solid #bc0023; - box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.12), 0 0 0 2px rgba(255, 0, 120, 0.5); + input { + font-family: @sansFontFamily; + outline: none; + width: 20em; + margin: 5px 5px 0; + position: relative; + top: -3px; + &.no-results { + border: 1px solid #bc0023; + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.12), 0 0 0 2px rgba(255, 0, 120, 0.5); + } } -} -.modal-bar .message { - display: inline-block; -} -.modal-bar .error { - display: none; + .message { + display: inline-block; + } - .alert { - padding-top: 4px; - padding-bottom: 4px; + .error { + display: none; + + .alert { + padding-top: 4px; + padding-bottom: 4px; + } } -} -.modal-bar .navigator { - display: none; - button { - margin: 2px 1px 3px; + .navigator { + display: none; + button { + margin: 2px 1px 3px; + } } } diff --git a/src/styles/brackets_codemirror_override.less b/src/styles/brackets_codemirror_override.less index af2dd9be056..1599ef45329 100644 --- a/src/styles/brackets_codemirror_override.less +++ b/src/styles/brackets_codemirror_override.less @@ -208,7 +208,7 @@ background: darken(@activeline-bgcolor, @bc-color-step-size / 2); } - .CodeMirror-matchingtag { background: @matching-bracket; color: @accent-bracket !important; } + .CodeMirror-matchingtag { background: @matching-bracket; } } /* diff --git a/src/styles/brackets_theme_default.less b/src/styles/brackets_theme_default.less index f99e36e9811..d69ef05e4bf 100644 --- a/src/styles/brackets_theme_default.less +++ b/src/styles/brackets_theme_default.less @@ -92,7 +92,7 @@ @cm-current-match-highlight: rgb(255, 108, 0); /* code highlight */ -@matching-bracket: #b0e3b6; +@matching-bracket: #cfead6; /* inline editor colors */ @inline-background-color-1: #eaeaea; diff --git a/src/styles/brackets_variables.less b/src/styles/brackets_variables.less index d31c146c7e9..a00aca90e02 100644 --- a/src/styles/brackets_variables.less +++ b/src/styles/brackets_variables.less @@ -47,9 +47,9 @@ @z-index-brackets-selection-triangle: (@z-index-brackets-ui + 1); @z-index-brackets-scroller-shadow: (@z-index-brackets-selection-triangle + 1); @z-index-brackets-inline-editor-shadow: @z-index-brackets-ui; -@z-index-brackets-toolbar: @z-index-brackets-ui; +@z-index-brackets-toolbar: (@z-index-brackets-ui + 1); @z-index-brackets-max: @z-index-brackets-toolbar; -@z-index-brackets-modalbar: @z-index-brackets-toolbar - 1; +@z-index-brackets-modalbar: (@z-index-brackets-toolbar - 1); @z-index-brackets-sidebar-resizer: (@z-index-brackets-ui + 2); @z-index-brackets-resizer-div: (@z-index-brackets-sidebar-resizer + 1); diff --git a/src/utils/Global.js b/src/utils/Global.js index 56ab38524fb..3f5bef20bde 100644 --- a/src/utils/Global.js +++ b/src/utils/Global.js @@ -34,7 +34,14 @@ define(function (require, exports, module) { "use strict"; - var configJSON = require("text!config.json"); + var configJSON = require("text!config.json"), + UrlParams = require("utils/UrlParams").UrlParams; + + var params = new UrlParams(), + hasNativeMenus = ""; + + // read URL params + params.parse(); // Define core brackets namespace if it isn't already defined // @@ -77,7 +84,13 @@ define(function (require, exports, module) { global.brackets.inBrowser = !global.brackets.hasOwnProperty("fs"); - global.brackets.nativeMenus = (!global.brackets.inBrowser && (global.brackets.platform !== "linux")); + hasNativeMenus = params.get("hasNativeMenus"); + + if (hasNativeMenus) { + global.brackets.nativeMenus = (hasNativeMenus === "true"); + } else { + global.brackets.nativeMenus = (!global.brackets.inBrowser && (global.brackets.platform !== "linux")); + } global.brackets.isLocaleDefault = function () { return !global.localStorage.getItem("locale"); diff --git a/src/widgets/ModalBar.js b/src/widgets/ModalBar.js index 63b8c08d707..9af1668311e 100644 --- a/src/widgets/ModalBar.js +++ b/src/widgets/ModalBar.js @@ -41,10 +41,9 @@ define(function (require, exports, module) { * * Creates a modal bar whose contents are the given template. * @param {string} template The HTML contents of the modal bar. - * @param {boolean} autoClose If true, then close the dialog if the user hits RETURN or ESC - * in the first input field, or if the modal bar loses focus to an outside item. Dispatches - * jQuery events for these cases: "closeOk" on RETURN, "closeCancel" on ESC, and "closeBlur" - * on focus loss. + * @param {boolean} autoClose If true, then close the dialog if the user hits RETURN + * in the first input field. Dispatches jQuery events for these cases: + * "commit" on RETURN and "close" always. * @param {boolean} animate If true (the default), animate the dialog closed, otherwise * close it immediately. */ @@ -61,11 +60,11 @@ define(function (require, exports, module) { .insertBefore("#editor-holder"); if (animate) { - this._$root.addClass("modal-bar-hide"); - // Forcing the renderer to do a layout, which will cause it to apply the transform for the "modal-bar-hide" + this._$root.addClass("popout offscreen"); + // Forcing the renderer to do a layout, which will cause it to apply the transform for the "offscreen" // class, so it will animate when you remove the class. window.getComputedStyle(this._$root.get(0)).getPropertyValue("top"); - this._$root.removeClass("modal-bar-hide"); + this._$root.removeClass("popout offscreen"); } // If something *other* than an editor (like another modal bar) has focus, set the focus @@ -127,18 +126,57 @@ define(function (require, exports, module) { return this._$root.outerHeight(); }; + /** + * Prepares the ModalBar for closing by popping it out of the main flow and resizing/ + * rescrolling the Editor to maintain its current apparent code position. Useful if + * you want to do that as a separate operation from actually animating the ModalBar + * closed and removing it (for example, if you need to switch full editors in between). + * If you don't call this explicitly, it will get called at the beginning of `close()`. + * + * @param {boolean=} restoreScrollPos If true (the default), adjust the scroll position + * of the editor to account for the ModalBar disappearing. If not set, the caller + * should do it immediately on return of this function (before the animation completes), + * because the editor will already have been resized. + */ + ModalBar.prototype.prepareClose = function (restoreScrollPos) { + if (restoreScrollPos === undefined) { + restoreScrollPos = true; + } + + this._$root.addClass("popout"); + + // Preserve scroll position of the current full editor across the editor refresh, adjusting for the + // height of the modal bar so the code doesn't appear to shift if possible. + var fullEditor = EditorManager.getCurrentFullEditor(), + barHeight, + scrollPos; + if (restoreScrollPos && fullEditor) { + barHeight = this.height(); + scrollPos = fullEditor.getScrollPos(); + } + EditorManager.resizeEditor(); + if (restoreScrollPos && fullEditor) { + fullEditor._codeMirror.scrollTo(scrollPos.x, scrollPos.y - barHeight); + } + }; + /** * Closes the modal bar and returns focus to the active editor. Returns a promise that is * resolved when the bar is fully closed and the container is removed from the DOM. * @param {boolean=} restoreScrollPos If true (the default), adjust the scroll position * of the editor to account for the ModalBar disappearing. If not set, the caller * should do it immediately on return of this function (before the animation completes), - * because the editor will already have been resized. + * because the editor will already have been resized. Note that this is ignored if + * `prepareClose()` was already called (you need to pass the parameter to that + * function if you call it first). * @param {boolean=} animate If true (the default), animate the closing of the ModalBar, * otherwise close it immediately. * @return {$.Promise} promise resolved when close is finished */ ModalBar.prototype.close = function (restoreScrollPos, animate) { + var result = new $.Deferred(), + self = this; + if (restoreScrollPos === undefined) { restoreScrollPos = true; } @@ -146,40 +184,32 @@ define(function (require, exports, module) { animate = true; } - // Store our height before closing, while we can still measure it - var result = new $.Deferred(), - barHeight = this.height(), - self = this; - - function doRemove() { - self._$root.remove(); - result.resolve(); + // If someone hasn't already called `prepareClose()` to pop the ModalBar out of the flow + // and resize the editor, then do that here. + if (!this._$root.hasClass("popout")) { + this.prepareClose(restoreScrollPos); } if (this._autoClose) { window.document.body.removeEventListener("focusin", this._handleFocusChange, true); } + + $(this).triggerHandler("close"); + + function doRemove() { + self._$root.remove(); + result.resolve(); + } if (animate) { - AnimationUtils.animateUsingClass(this._$root.get(0), "modal-bar-hide") + AnimationUtils.animateUsingClass(this._$root.get(0), "offscreen") .done(doRemove); } else { doRemove(); } - // Preserve scroll position of the current full editor across the editor refresh, adjusting for the - // height of the modal bar so the code doesn't appear to shift if possible. - var fullEditor = EditorManager.getCurrentFullEditor(), - scrollPos; - if (restoreScrollPos && fullEditor) { - scrollPos = fullEditor.getScrollPos(); - } - EditorManager.resizeEditor(); - if (restoreScrollPos && fullEditor) { - fullEditor._codeMirror.scrollTo(scrollPos.x, scrollPos.y - barHeight); - } EditorManager.focusEditor(); - + return result.promise(); }; @@ -193,7 +223,9 @@ define(function (require, exports, module) { var value = this._getFirstInput().val(); this.close(); - $(this).triggerHandler(e.keyCode === KeyEvent.DOM_VK_RETURN ? "closeOk" : "closeCancel", [value]); + if (e.keyCode === KeyEvent.DOM_VK_RETURN) { + $(this).triggerHandler("commit", [value]); + } } }; @@ -205,7 +237,6 @@ define(function (require, exports, module) { if (!$.contains(this._$root.get(0), e.target)) { var value = this._getFirstInput().val(); this.close(); - $(this).triggerHandler("closeBlur", [value]); } }; diff --git a/tasks/lib/common.js b/tasks/lib/common.js index 6fb3f61ec28..76dbd466f83 100644 --- a/tasks/lib/common.js +++ b/tasks/lib/common.js @@ -20,7 +20,8 @@ * DEALINGS IN THE SOFTWARE. * */ - /*global module, require, process*/ +/*jslint nomen:true */ +/*global module, require, process */ module.exports = function (grunt) { "use strict"; diff --git a/tasks/test.js b/tasks/test.js index e3e03170213..73470fc992a 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -43,10 +43,10 @@ module.exports = function (grunt) { specRunnerPath = common.resolve("test/SpecRunner.html"), args = " --startup-path=\"" + specRunnerPath + "?suite=" + encodeURIComponent(suite) + "&spec=" + encodeURIComponent(spec) + "&resultsPath=" + encodeURIComponent(resultsPath) + "\""; - if (platform === "win") { - cmd += args; - } else if (platform === "mac") { + if (platform === "mac") { cmd = "open \"" + cmd + "\" -W --args " + args; + } else { + cmd += args; } grunt.log.writeln(cmd); diff --git a/tasks/write-config.js b/tasks/write-config.js index 05c165d38d3..bd847a132aa 100644 --- a/tasks/write-config.js +++ b/tasks/write-config.js @@ -20,7 +20,7 @@ * DEALINGS IN THE SOFTWARE. * */ - /*global module, require*/ +/*global module, require*/ module.exports = function (grunt) { "use strict"; diff --git a/test/spec/Menu-test.js b/test/spec/Menu-test.js index 178fb4b94ff..bbfe63932d8 100644 --- a/test/spec/Menu-test.js +++ b/test/spec/Menu-test.js @@ -36,16 +36,16 @@ define(function (require, exports, module) { KeyEvent = require("utils/KeyEvent"); - describe("Menus", function () { + describe("Menus (Native Shell)", function () { this.category = "integration"; var testWindow; beforeFirst(function () { - // Create a new window that will be shared by ALL tests in this spec. (We need the tests to - // run in a real Brackets window since HTMLCodeHints requires various core modules (it can't - // run 100% in isolation), but popping a new window per testcase is unneeded overhead). + var testWindowOptions = {"hasNativeMenus" : true}; + + // Create a new native menu window that will be shared by ALL tests in this spec. SpecRunnerUtils.createTestWindowAndRun(this, function (w) { testWindow = w; @@ -54,7 +54,7 @@ define(function (require, exports, module) { Commands = testWindow.brackets.test.Commands; KeyBindingManager = testWindow.brackets.test.KeyBindingManager; Menus = testWindow.brackets.test.Menus; - }); + }, testWindowOptions); }); afterLast(function () { @@ -210,11 +210,39 @@ define(function (require, exports, module) { expect($menus.length).toBe(0); }); }); + }); + + + describe("Menus (HTML)", function () { + + this.category = "integration"; + + var testWindow; - if (!brackets.inBrowser) { - return; - } + beforeFirst(function () { + var testWindowOptions = {"hasNativeMenus" : false}; + + // Create a new HTML menu window that will be shared by ALL tests in this spec. + SpecRunnerUtils.createTestWindowAndRun(this, function (w) { + testWindow = w; + // Load module instances from brackets.test + CommandManager = testWindow.brackets.test.CommandManager; + Commands = testWindow.brackets.test.Commands; + KeyBindingManager = testWindow.brackets.test.KeyBindingManager; + Menus = testWindow.brackets.test.Menus; + }, testWindowOptions); + }); + + afterLast(function () { + testWindow = null; + CommandManager = null; + Commands = null; + KeyBindingManager = null; + Menus = null; + SpecRunnerUtils.closeTestWindow(); + }); + describe("Add Menus", function () { function getTopMenus() { diff --git a/test/spec/NativeMenu-test.js b/test/spec/NativeMenu-test.js index ec9277aff7a..19801522dcd 100644 --- a/test/spec/NativeMenu-test.js +++ b/test/spec/NativeMenu-test.js @@ -28,8 +28,10 @@ define(function (require, exports, module) { 'use strict'; - // Don't run tests when running in browser - if (brackets.inBrowser) { + require("utils/Global"); + + // Don't run tests when running in browser or linux + if (brackets.inBrowser || brackets.platform === "linux") { return; } diff --git a/test/spec/SpecRunnerUtils.js b/test/spec/SpecRunnerUtils.js index 74d9fe2547a..a5797a8efb4 100644 --- a/test/spec/SpecRunnerUtils.js +++ b/test/spec/SpecRunnerUtils.js @@ -476,8 +476,7 @@ define(function (require, exports, module) { waitsForDone(promise, "dismiss dialog"); } - - function createTestWindowAndRun(spec, callback) { + function createTestWindowAndRun(spec, callback, options) { runs(function () { // Position popup windows in the lower right so they're out of the way var testWindowWid = 1000, @@ -503,6 +502,11 @@ define(function (require, exports, module) { // disable initial dialog for live development params.put("skipLiveDevelopmentInfo", true); + // option to launch test window with either native or HTML menus + if (options && options.hasOwnProperty("hasNativeMenus")) { + params.put("hasNativeMenus", (options.hasNativeMenus ? "true" : "false")); + } + _testWindow = window.open(getBracketsSourceRoot() + "/index.html?" + params.toString(), "_blank", optionsStr); _testWindow.isBracketsTestWindow = true; @@ -524,7 +528,7 @@ define(function (require, exports, module) { }); }; }); - + // FIXME (issue #249): Need an event or something a little more reliable... waitsFor( function isBracketsDoneLoading() {