aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/include/emscripten/bind.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index 7399bd37..a0545f3f 100644
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -172,6 +172,10 @@ namespace emscripten {
GenericFunction invoker,
GenericFunction method);
+ EM_VAL _embind_create_inheriting_constructor(
+ const char* constructorName,
+ TYPEID wrapperType);
+
void _embind_register_enum(
TYPEID enumType,
const char* name,
@@ -988,9 +992,11 @@ namespace emscripten {
}
};
- template<typename PointerType, typename WrapperType>
- val wrapped_extend(const val& properties) {
- return val::undefined();
+ template<typename WrapperType>
+ val wrapped_extend(const std::string& name, const val& properties) {
+ return val::take_ownership(_embind_create_inheriting_constructor(
+ name.c_str(),
+ TypeID<WrapperType>::get()));
}
};
@@ -1115,7 +1121,7 @@ namespace emscripten {
allow_raw_pointer<ret_val>())
.class_function(
"extend",
- &wrapped_extend<PointerType, WrapperType>)
+ &wrapped_extend<WrapperType>)
;
}