aboutsummaryrefslogtreecommitdiff
path: root/src/embind/embind.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/embind/embind.js')
-rwxr-xr-xsrc/embind/embind.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index d4d428ad..7000ddc4 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -698,11 +698,14 @@ function __embind_register_smart_ptr(
rawGetPointee = FUNCTION_TABLE[rawGetPointee];
var Handle = createNamedFunction(name, function(ptr) {
- this.$$ = {};
- this.$$.count = {value: 1};
- this.$$.smartPtr = ptr; // std::shared_ptr<T>*
- this.$$.ptr = rawGetPointee(ptr); // T*
- this.$$.pointeeType = pointeeType;
+ Object.defineProperty(this, '$$', {
+ value: {
+ count: {value: 1},
+ smartPtr: ptr,
+ ptr: rawGetPointee(ptr),
+ pointeeType: pointeeType,
+ },
+ });
});
// TODO: test for SmartPtr.prototype.constructor property?