diff options
author | Chad Austin <chad@imvu.com> | 2013-04-15 17:40:16 -0700 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-18 20:08:13 +0300 |
commit | 181e6abb2f3abb9c3dc07d769adb84f6bc5982bc (patch) | |
tree | ac50bde1a70e95087d61081597dba21d214bf332 /src/embind/embind.js | |
parent | a9539326b89fec17dfe7fb4315eb5d256a1afcf6 (diff) |
cannot pass non-strings to std::string arguments :)
Diffstat (limited to 'src/embind/embind.js')
-rwxr-xr-x | src/embind/embind.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index 9afbf2fb..5fc8c948 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -348,6 +348,10 @@ function __embind_register_std_string(rawType, name) { return a.join(''); }, toWireType: function(destructors, value) { + if (typeof value !== "string") { + throwBindingError('Cannot pass non-string to std::string'); + } + // assumes 4-byte alignment var length = value.length; var ptr = _malloc(4 + length); |