From a1a062d915d244cdbd681cf6eb4a0ca71a8c8a67 Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Fri, 2 May 2014 13:52:01 -0700 Subject: can extend, construct, and delete --- system/include/emscripten/bind.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'system') 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 - val wrapped_extend(const val& properties) { - return val::undefined(); + template + val wrapped_extend(const std::string& name, const val& properties) { + return val::take_ownership(_embind_create_inheriting_constructor( + name.c_str(), + TypeID::get())); } }; @@ -1115,7 +1121,7 @@ namespace emscripten { allow_raw_pointer()) .class_function( "extend", - &wrapped_extend) + &wrapped_extend) ; } -- cgit v1.2.3-70-g09d2