diff options
author | Chad Austin <chad@imvu.com> | 2013-02-28 16:33:00 -0800 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:24:38 +0300 |
commit | 3adc0bd5ed011987ae2c396027e3dcc5ebdea92e (patch) | |
tree | a23c314007a260a4cf79c46935e1be6d09598c4b /src | |
parent | f23cc669e328eec1c088b2a39637ccef7dfb5e84 (diff) |
Turns out we can simplify and reuse a lot of code :o
Diffstat (limited to 'src')
-rwxr-xr-x | src/embind/embind.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index b5be4602..d4d428ad 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -852,39 +852,6 @@ function __embind_register_class_constructor( var ptr = invoker.apply(null, args); runDestructors(destructors); - return classType.Handle.call(this, ptr); - }; - }); -} - -function __embind_register_class_smart_ptr_constructor( - rawClassType, - argCount, - rawArgTypesAddr, - invoker, - rawConstructor -) { - var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); - invoker = FUNCTION_TABLE[invoker]; - - requestDeferredRegistration(function() { - var classType = requireRegisteredType(rawClassType, 'class'); - var humanName = 'constructor ' + classType.name; - var argTypes = requireArgumentTypes(rawArgTypes, humanName); - classType.constructor.body = function() { - if (arguments.length !== argCount - 1) { - throwBindingError(humanName + ' called with ' + arguments.length + ' arguments, expected ' + (argCount-1)); - } - var destructors = []; - var args = new Array(argCount); - args[0] = rawConstructor; - for (var i = 1; i < argCount; ++i) { - args[i] = argTypes[i].toWireType(destructors, arguments[i - 1]); - } - - var ptr = invoker.apply(null, args); - runDestructors(destructors); - return argTypes[0].fromWireType(ptr); }; }); |