File tree Expand file tree Collapse file tree
system/include/emscripten Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,4 +41,5 @@ a license to everyone to use it as detailed in LICENSE.)
4141* Joel Martin <github@martintribe.org>
4242* Manuel Wellmann <manuel.wellmann@autodesk.com> (copyright owned by Autodesk, Inc.)
4343* Xuejie Xiao <xxuejie@gmail.com>
44+ * Dominic Wong <dom@slowbunyip.org>
4445
Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ namespace emscripten {
218218 template <typename ClassType, typename ReturnType, typename ... Args>
219219 struct MethodInvoker {
220220 typedef ReturnType (ClassType::*MemberPointer)(Args...);
221- typename internal::BindingType<ReturnType>::WireType invoke (
221+ static typename internal::BindingType<ReturnType>::WireType invoke (
222222 ClassType* ptr,
223223 const MemberPointer& method,
224224 typename internal::BindingType<Args>::WireType... args
Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ class ValHolder {
9696 this ->v = v;
9797 }
9898
99+ int returnIntPlusFive ( int x ) {
100+ return x + 5 ;
101+ }
102+
99103 static int some_class_method (int i) {
100104 return i;
101105 }
@@ -286,6 +290,7 @@ EMSCRIPTEN_BINDINGS(([]() {
286290 .constructor <val>()
287291 .method (" getVal" , &ValHolder::getVal)
288292 .method (" setVal" , &ValHolder::setVal)
293+ .method (" returnIntPlusFive" , &ValHolder::returnIntPlusFive)
289294 .classmethod (" some_class_method" , &ValHolder::some_class_method)
290295 ;
291296 function (" emval_test_return_ValHolder" , &emval_test_return_ValHolder);
Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ module({
137137 c . setVal ( '1234' ) ;
138138 assert . equal ( '1234' , c . getVal ( ) ) ;
139139
140+ assert . equal ( 1239 , c . returnIntPlusFive ( 1234 ) ) ;
141+
140142 c . delete ( ) ;
141143 assert . equal ( 0 , cm . count_emval_handles ( ) ) ;
142144 } ,
You can’t perform that action at this time.
0 commit comments