   <span class="hljs-title">sampleMethod</span> = <span class="hljs-params">(result, arg1)</span> -&gt;</span>

      <span class="hljs-keyword">new</span> Promise (resolve, reject) -&gt;

        <span class="hljs-keyword">if</span> arg1 != <span class="hljs-string">'good'</span>

          result.error <span class="hljs-string">'invalidArg'</span>, arg: <span class="hljs-string">'arg1'</span>, value: arg1

          reject(); <span class="hljs-keyword">return</span>

        resolve()

        <span