diff options
author | Chad Austin <chad@imvu.com> | 2013-02-26 11:41:19 -0800 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:24:19 +0300 |
commit | 136c2c4457c87d5dbe9477b28b84362dd5a48b64 (patch) | |
tree | 1148284287f07995dad14b2e1c1cf51157061e11 | |
parent | d53d8001aaa3666eb6de40fec25dbec338a75c81 (diff) |
Give a sensible error message if attempting to construct a class with no accessible constructor
-rwxr-xr-x | src/embind/embind.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index 742dbb94..5a49d177 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -773,6 +773,9 @@ function __embind_register_class( throw new BindingError("Use 'new' to construct " + name); } var body = type.constructor.body; + if (undefined === body) { + throw new BindingError(name + " has no accessible constructor"); + } return body.apply(this, arguments); }); type.constructor.prototype = type.Handle.prototype; |