Bug 1399217 - Disable wasm disassembly for non-binary source. r=jlast
MozReview-Commit-ID: KEyyOjyKXPF
--- 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;