aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Lee <tlee@imvu.com>2012-10-26 15:18:35 -0700
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:21:20 +0300
commitf91f1ddf374b4f881cd5cf2ba35263cfbe965224 (patch)
tree8988606b049d79b199a7c0b2acb2e65ccc12c0f0
parentd0bf1b0aea625931255c31641ba53ad6d4cee7c3 (diff)
removed duplicate code / unnecessary code
-rw-r--r--src/embind/embind.js19
-rw-r--r--system/include/emscripten/wire.h7
2 files changed, 3 insertions, 23 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index f63a8eff..1f5da572 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -402,7 +402,7 @@ function __embind_register_smart_ptr(
this.smartPointer = undefined;
this.ptr = undefined;
}
-
+
typeRegistry[pointerType] = {
name: name,
fromWireType: function(ptr) {
@@ -429,20 +429,6 @@ function __embind_register_class(
Handle.prototype.clone = function() {
if (!this.ptr) {
- throw new BindingError(pointeeType.name + ' instance already deleted');
- }
-
- var clone = Object.create(Handle.prototype);
- clone.count = this.count;
- clone.smartPointer = this.smartPointer;
- clone.ptr = this.ptr;
-
- clone.count.value += 1;
- return clone;
- };
-
- Handle.prototype.clone = function() {
- if (!this.ptr) {
throw new BindingError(classType.name + ' instance already deleted');
}
@@ -533,6 +519,7 @@ function __embind_register_class_method(
classType = requireRegisteredType(classType, 'class');
methodName = Pointer_stringify(methodName);
var humanName = classType.name + '.' + methodName;
+
returnType = requireRegisteredType(returnType, 'method ' + humanName + ' return value');
argTypes = requireArgumentTypes(argCount, argTypes, 'method ' + humanName);
invoker = FUNCTION_TABLE[invoker];
@@ -553,7 +540,7 @@ function __embind_register_class_method(
for (var i = 0; i < argCount; ++i) {
args[i + 2] = argTypes[i].toWireType(destructors, arguments[i]);
}
-
+
var rv = returnType.fromWireType(invoker.apply(null, args));
runDestructors(destructors);
return rv;
diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h
index ab4caa97..b618be83 100644
--- a/system/include/emscripten/wire.h
+++ b/system/include/emscripten/wire.h
@@ -31,13 +31,6 @@ namespace emscripten {
}
};
- template<typename T>
- struct TypeID<std::shared_ptr<T>> {
- static TYPEID get() {
- return TypeID<T>::get();
- }
- };
-
// count<>
template<typename... Args>