diff --git a/src/embind/emval.js b/src/embind/emval.js index a3157d2a7..65becfa34 100644 --- a/src/embind/emval.js +++ b/src/embind/emval.js @@ -70,15 +70,6 @@ function __emval_get_property_by_unsigned_long(handle, k) { return __emval_register(_emval_handle_array[handle].value[k]); } -function __emval_get_length(handle) { - var val = _emval_handle_array[handle].value; - if (Object.prototype.toString.call(val) === "[object Array]") { - return val.length; - } - - return 0; -} - function __emval_eval_global_method(handle, objectName, methodName) { var objectNameStr = Pointer_stringify(objectName); var methodNameStr = Pointer_stringify(methodName); diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h index 945b0d8a6..8db052e8c 100644 --- a/system/include/emscripten/val.h +++ b/system/include/emscripten/val.h @@ -21,7 +21,6 @@ namespace emscripten { EM_VAL _emval_eval_global_method(EM_VAL object, const char* objectName, const char* methodName); void _emval_set_property(EM_VAL object, const char* key, EM_VAL value); void _emval_set_property_by_int(EM_VAL object, long key, EM_VAL value); - unsigned int _emval_get_length(EM_VAL object); void _emval_as(EM_VAL value, TYPEID returnType); EM_VAL _emval_call( EM_VAL value, @@ -118,7 +117,7 @@ namespace emscripten { } unsigned int length() { - return internal::_emval_get_length(handle); + return get("length").as(); } template