henry_flower: A melancholy wolf (Default)
henry_flower ([personal profile] henry_flower) wrote2013-04-16 09:14 pm
Entry tags:

Польза, но только для V8: # Example: # # class MyError extends Error #   construc

Польза, но только для V8:

# Example:
#
# class MyError extends Error
#   constructor: (msg) -> makeError MyError, this, 'my error', msg
#
# throw new MyError 'hi mom'
#
exports.makeError = (klass, errObj, prefix, msg) ->
  errObj.name = klass.name
  errObj.message = "#{prefix}: #{msg}"
  Error.captureStackTrace errObj, klass

Permalink: https://plus.google.com/115290581164606462017/posts/UB7phHENr3N


Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting