Bug 1399217 - Disable wasm disassembly for non-binary source. r=jlast draft
authorYury Delendik <ydelendik@mozilla.com>
Tue, 12 Sep 2017 13:57:31 -0500
changeset 663152 37e3ce57069b4dcf21e2da1e1f9fecd645523387
parent 662980 b0e945eed81db8bf076daf64e381c514f70144f0
child 731124 8ca01788204996e02c77819dff774aee83da4bf5
push id79353
push userydelendik@mozilla.com
push dateTue, 12 Sep 2017 19:00:18 +0000
reviewersjlast
bugs1399217
milestone57.0a1
Bug 1399217 - Disable wasm disassembly for non-binary source. r=jlast MozReview-Commit-ID: KEyyOjyKXPF
devtools/client/sourceeditor/editor.js
--- a/devtools/client/sourceeditor/editor.js
+++ b/devtools/client/sourceeditor/editor.js
@@ -546,17 +546,17 @@ Editor.prototype = {
 
   /**
    * Replaces whatever is in the text area with the contents of
    * the 'value' argument.
    */
   setText: function (value) {
     let cm = editors.get(this);
 
-    if (typeof value !== "string") {  // wasm?
+    if (typeof value !== "string" && 'binary' in value) {  // wasm?
       // binary does not survive as Uint8Array, converting from string
       let binary = value.binary;
       let data = new Uint8Array(binary.length);
       for (let i = 0; i < data.length; i++) {
         data[i] = binary.charCodeAt(i);
       }
       let { lines, done } = getWasmText(this.getDoc(), data);
       const MAX_LINES = 10000000;