<p dir="auto">The node module <code class="notranslate">util</code> uses <code class="notranslate">Object.create</code> in the <code class="notranslate">inherit</code>-function. But in IE8 and lower <code class="notranslate">Object.create</code> is not defined. Thus <code class="notranslate">util</code> requires a shim to work properly in these browsers.</p>
<p dir="auto">Not all JavaScript 1.8.5 features available in <code class="notranslate">Object.create</code> can be emulated but for the purpose of <code class="notranslate">inherit</code> I think <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/create#Cross-browser_compatibility" rel="nofollow">this one provided by the MDN</a> will do it.</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
I'd say it's a feature.</p>


<p dir="auto"><strong>What is the current behavior?</strong><br>
Currently, all messages (be it warnings, errors, etcetera) are hard-coded, which reduces maintainability.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
N/A</p>



<p dir="auto"><strong>What is the expected behavior?</strong><br>
N/A</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong><br>
I suggest we create a <code class="notranslate">messages.json</code> (or of any format for that matter, as long as one can parse it fairly easily) that defines all the different types of messages. This</p>
<ul dir="auto">
<li>enhances maintainability</li>
<li>improves readability</li>
<li>reduces the headache of searching through a large code base for the particular message, and <em>then</em> updating it (imagine if the same error message is used in multiple files <g-emoji class="g-emoji" alias="scream" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f631.png">😱</g-emoji>)</li>
</ul>
<p dir="auto">For example,</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...
{
  expectsAnArray: '... expects an array',
  genericWarning: 'Warning: ... generic warning',
  unfathomableError: '... look into this immediately!',
  ...
},"><pre class="notranslate">...
<span class="pl-kos">{</span>
  <span class="pl-c1">expectsAnArray</span>: <span class="pl-s">'... expects an array'</span><span class="pl-kos">,</span>
  <span class="pl-c1">genericWarning</span>: <span class="pl-s">'Warning: ... generic warning'</span><span class="pl-kos">,</span>
  <span class="pl-c1">unfathomableError</span>: <span class="pl-s">'... look into this immediately!'</span><span class="pl-kos">,</span>
  ...
<span class="pl-kos">}</span><span class="pl-kos">,</span></pre></div>
<p dir="auto">... and in some file</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const msgs = require('path/to/messages.json');

fn(...args) {
  if(allGood) { ... }
  throw new Error(msgs.unfathomableError);
}
"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">msgs</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path/to/messages.json'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-en">fn</span><span class="pl-kos">(</span>...<span class="pl-s1">args</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-kos">{</span>
  <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">allGood</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> ... <span class="pl-kos">}</span>
  <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-s1">msgs</span><span class="pl-kos">.</span><span class="pl-c1">unfathomableError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br>
N/A</p>