aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2014-05-02 14:56:45 -0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2014-05-21 22:55:45 +0700
commita30b438d002a389a523350e2bb0f66b0cf92711d (patch)
treef3f41012eca9acb1cfa32584e3609381b8c38799 /system
parenta2487b69b6d5e0fc81ef67f062f61764fad5af00 (diff)
properties set in constructor persist to methods
Diffstat (limited to 'system')
-rw-r--r--system/include/emscripten/bind.h6
-rw-r--r--system/include/emscripten/val.h5
2 files changed, 9 insertions, 2 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index a0545f3f..3c2d7097 100644
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -174,7 +174,8 @@ namespace emscripten {
EM_VAL _embind_create_inheriting_constructor(
const char* constructorName,
- TYPEID wrapperType);
+ TYPEID wrapperType,
+ EM_VAL properties);
void _embind_register_enum(
TYPEID enumType,
@@ -996,7 +997,8 @@ namespace emscripten {
val wrapped_extend(const std::string& name, const val& properties) {
return val::take_ownership(_embind_create_inheriting_constructor(
name.c_str(),
- TypeID<WrapperType>::get()));
+ TypeID<WrapperType>::get(),
+ properties.__get_handle()));
}
};
diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h
index bfd8610a..8bcc30c4 100644
--- a/system/include/emscripten/val.h
+++ b/system/include/emscripten/val.h
@@ -411,6 +411,11 @@ namespace emscripten {
return fromGenericWireType<T>(result);
}
+ // private: TODO: use a friend?
+ internal::EM_VAL __get_handle() const {
+ return handle;
+ }
+
val typeof() const {
return val(_emval_typeof(handle));
}