aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-02-28 17:15:20 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:24:42 +0300
commitd824fcb7ba3f28987761a80a9645ca7c630eb97b (patch)
tree6617c72276551f8639f52f4955ac7ef155fd0582 /src
parent9008c4da5344b55d524a811567e611c901c5c16f (diff)
$$ is never enumerable
Diffstat (limited to 'src')
-rwxr-xr-xsrc/embind/embind.js31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 7000ddc4..aab20b69 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -718,10 +718,13 @@ function __embind_register_smart_ptr(
}
var clone = Object.create(Handle.prototype);
- clone.$$ = {};
- clone.$$.count = this.$$.count;
- clone.$$.smartPtr = this.$$.smartPtr;
- clone.$$.ptr = this.$$.ptr;
+ Object.defineProperty(clone, '$$', {
+ value: {
+ count: this.$$.count,
+ smartPtr: this.$$.smartPtr,
+ ptr: this.$$.ptr,
+ },
+ });
clone.$$.count.value += 1;
return clone;
@@ -760,10 +763,13 @@ function __embind_register_class(
rawDestructor = FUNCTION_TABLE[rawDestructor];
var Handle = createNamedFunction(name, function(ptr) {
- this.$$ = {};
- this.$$.count = {value: 1, ptr: ptr };
- this.$$.ptr = ptr;
- this.$$.pointeeType = type; // set below
+ Object.defineProperty(this, '$$', {
+ value: {
+ count: {value: 1, ptr: ptr},
+ ptr: ptr,
+ pointeeType: type,
+ }
+ });
});
Handle.prototype = Object.create(ClassHandle.prototype, {
@@ -775,9 +781,12 @@ function __embind_register_class(
}
var clone = Object.create(Handle.prototype);
- clone.$$ = {};
- clone.$$.count = this.$$.count;
- clone.$$.ptr = this.$$.ptr;
+ Object.defineProperty(clone, '$$', {
+ value: {
+ count: this.$$.count,
+ ptr: this.$$.ptr,
+ },
+ });
clone.$$.count.value += 1;
return clone;