diff options
author | Chad Austin <chad@imvu.com> | 2013-03-18 16:53:01 -0700 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:26:05 +0300 |
commit | fc3e58b6915368401a01da8587f014a94a31373d (patch) | |
tree | b479691c6c9d26fc7a802726bcc53f8c1c883ef1 /src | |
parent | bb23c470f034601b70136a3eb56f829e84674bc4 (diff) |
Kill fromWireTypeAutoDowncast
Diffstat (limited to 'src')
-rwxr-xr-x | src/embind/embind.js | 22 | ||||
-rwxr-xr-x | src/embind/emval.js | 2 |
2 files changed, 8 insertions, 16 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index 834aed74..d3690a65 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -277,11 +277,7 @@ function makeInvoker(name, argCount, argTypes, invoker, fn) { args[i] = argTypes[i].toWireType(destructors, arguments[i - 1]); } var rv = invoker.apply(null, args); - if (argTypes[0].fromWireTypeAutoDowncast) { - rv = argTypes[0].fromWireTypeAutoDowncast(rv); - } else { - rv = argTypes[0].fromWireType(rv); - } + rv = argTypes[0].fromWireType(rv); runDestructors(destructors); return rv; }; @@ -589,7 +585,7 @@ RegisteredPointer.prototype.destructor = function(ptr) { } }; -RegisteredPointer.prototype.fromWireType = function(ptr) { +RegisteredPointer.prototype._fromWireType = function(ptr) { if (!this.getPointee(ptr)) { this.destructor(ptr); return null; @@ -625,7 +621,7 @@ RegisteredPointer.prototype.getDynamicDowncastType = function(ptr) { return downcastType; }; -RegisteredPointer.prototype.fromWireTypeAutoDowncast = function(ptr) { // ptr is a raw pointer (or a raw smartpointer) +RegisteredPointer.prototype.fromWireType = function(ptr) { // ptr is a raw pointer (or a raw smartpointer) var handle; if (!this.getPointee(ptr)) { this.destructor(ptr); @@ -634,13 +630,13 @@ RegisteredPointer.prototype.fromWireTypeAutoDowncast = function(ptr) { // ptr is var toType = this.getDynamicDowncastType(ptr); if (toType) { if (this.isSmartPointer) { - handle = toType.smartPointerType.fromWireType(ptr); + handle = toType.smartPointerType._fromWireType(ptr); } else { - handle = toType.fromWireType(ptr); + handle = toType._fromWireType(ptr); } handle.$$.ptr = staticPointerCast(handle.$$.ptr, this.pointeeType.rawType, toType.rawType); } else { - handle = this.fromWireType(ptr); + handle = this._fromWireType(ptr); } return handle; }; @@ -900,11 +896,7 @@ function __embind_register_class_function( args[i + 1] = argTypes[i].toWireType(destructors, arguments[i - 1]); } var rv = rawInvoker.apply(null, args); - if (argTypes[0].fromWireTypeAutoDowncast) { - rv = argTypes[0].fromWireTypeAutoDowncast(rv); - } else { - rv = argTypes[0].fromWireType(rv); - } + rv = argTypes[0].fromWireType(rv); runDestructors(destructors); return rv; }; diff --git a/src/embind/emval.js b/src/embind/emval.js index 37a4970e..c60c62e0 100755 --- a/src/embind/emval.js +++ b/src/embind/emval.js @@ -69,7 +69,7 @@ function __emval_new_cstring(v) { function __emval_take_value(type, v) { type = requireRegisteredType(type, '_emval_take_value'); - v = type.fromWireTypeAutoDowncast ? type.fromWireTypeAutoDowncast(v) : type.fromWireType(v); + v = type.fromWireType(v); return __emval_register(v); } |