Bug 686705 - Source Editor with the textarea fallback displays undefined without a placeholderText; r=mihai.sucan
authorPanos Astithas <past@mozilla.com>
Wed, 14 Sep 2011 10:25:43 -0700
changeset 76959 01ef83aa3f02aa7606eeda54b6381148da059324
parent 76958 7107a577e4f6dea4f96b3f6bac117698cdaa1aea
child 76960 31153dfd43070444318a813a6979ee01328dc445
push id169
push usermihai.sucan@gmail.com
push dateFri, 16 Sep 2011 09:20:06 +0000
treeherderfx-team@8e3e1c5f348d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmihai.sucan
bugs686705
milestone9.0a1
Bug 686705 - Source Editor with the textarea fallback displays undefined without a placeholderText; r=mihai.sucan
browser/devtools/sourceeditor/source-editor-textarea.jsm
--- a/browser/devtools/sourceeditor/source-editor-textarea.jsm
+++ b/browser/devtools/sourceeditor/source-editor-textarea.jsm
@@ -1,9 +1,9 @@
-/* vim:set ts=2 sw=2 sts=2 et tw=80:
+/* vim:set ft=javascript ts=2 sw=2 sts=2 et tw=80:
  * ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -124,17 +124,17 @@ SourceEditor.prototype = {
     this._editor = this._textbox.editor;
 
     this._expandTab = aConfig.expandTab !== undefined ?
                       aConfig.expandTab : SourceEditor.DEFAULTS.EXPAND_TAB;
     this._tabSize = aConfig.tabSize || SourceEditor.DEFAULTS.TAB_SIZE;
 
     this._textbox.style.MozTabSize = this._tabSize;
 
-    this._textbox.setAttribute("value", aConfig.placeholderText);
+    this._textbox.setAttribute("value", aConfig.placeholderText || "");
     this._textbox.setAttribute("class", "monospace");
     this._textbox.style.direction = "ltr";
     this._textbox.readOnly = aConfig.readOnly;
 
     // Make sure that the SourceEditor Selection events are fired properly.
     // Also make sure that the Tab key inserts spaces when expandTab is true.
     this._textbox.addEventListener("select", this._onSelect.bind(this), false);
     this._textbox.addEventListener("keypress", this._onKeyPress.bind(this), false);